public final OClass getEdgeType(final String iTypeName) { return graph.getEdgeType(iTypeName); }
/** * (Internal) Returns the case sensitive edge class names. */ public static void getEdgeClassNames(final OrientBaseGraph graph, final String... iLabels) { if (iLabels != null && graph != null && graph.isUseClassForEdgeLabel()) { for (int i = 0; i < iLabels.length; ++i) { final OrientEdgeType edgeType = graph.getEdgeType(iLabels[i]); if (edgeType != null) // OVERWRITE CLASS NAME BECAUSE ATTRIBUTES ARE CASE SENSITIVE iLabels[i] = edgeType.getName(); } } }
protected void doEdgeTypes(Graph baseGraph) { if (baseGraph instanceof OrientBaseGraph) { // register edge types to prevent premature commit of active transaction when a label is first encountered: OrientBaseGraph obg = (OrientBaseGraph) baseGraph; List<String> labels = new ArrayList<>(Arrays.asList( OrientStorageService.EDGE_LABEL_REGISTERED_BY, Farm.EDGE_LABEL_PART_OF_FARM, CropField.EDGE_LABEL_IN_FIELD, CropProductionUnit.EDGE_LABEL_FOR_CUSTOMER, HasCropInstance.EDGE_LABEL_HAS_CLASSIFICATION, HasCropInstance.EDGE_LABEL_HAS_CROP, HasCropInstance.EDGE_LABEL_HAS_VARIETY)); // see OrientFarmStorageService.store(), new vertex section: for (ItemIdType itemIdType : ItemIdType.values()) { labels.add(Farm.EDGE_LABEL_PREFIX_HAS_OF_TYPE + itemIdType.name()); } for (String label : labels) { if (obg.getEdgeType(label) == null) { //default edge superclassname from: OrientEdge.CLASS_NAME = "E" obg.createEdgeType(label); LOGGER.log(Level.INFO, "created edge type: {0}", label); } } } } }
/** * Creates a new Edge persistent class specifying the super class. * * @param iClassName Edge class name * @param iSuperClassName Edge class name to extend * * @return OrientEdgeType instance representing the persistent class */ public OrientEdgeType createEdgeType(final String iClassName, final String iSuperClassName) { makeActive(); return createEdgeType(iClassName, iSuperClassName == null ? getEdgeBaseType() : getEdgeType(iSuperClassName)); }
/** * Creates a new Edge persistent class specifying the super class. * * @param iClassName Edge class name * @param iSuperClassName Edge class name to extend * @param clusters The number of clusters to create for the new class. By default the MINIMUMCLUSTERS database setting is * used. In v2.2 and later, the number of clusters are proportioned to the amount of cores found on the * machine * * @return OrientEdgeType instance representing the persistent class */ public OrientEdgeType createEdgeType(final String iClassName, final String iSuperClassName, final int clusters) { makeActive(); return createEdgeType(iClassName, iSuperClassName == null ? getEdgeBaseType() : getEdgeType(iSuperClassName), clusters); }
@Override public void begin() { final OClass cls = pipeline.getGraphDatabase().getEdgeType(edgeClass); if (cls == null) pipeline.getGraphDatabase().createEdgeType(edgeClass); super.begin(); }
@Override public List<Object> edgeLookup(String edgeLabel, String indexPostfix, Object key) { OrientBaseGraph orientBaseGraph = unwrapCurrentGraph(); List<Object> ids = new ArrayList<>(); // Load the edge type in order to access the indices of the edge OrientEdgeType edgeType = orientBaseGraph.getEdgeType(edgeLabel); if (edgeType != null) { // Fetch the required index OIndex<?> index = edgeType.getClassIndex("e." + edgeLabel.toLowerCase() + "_" + indexPostfix); if (index != null) { // Iterate over the sb-tree index entries OIndexCursor cursor = index.iterateEntriesMajor(new OCompositeKey(key), true, false); while (cursor.hasNext()) { Entry<Object, OIdentifiable> entry = cursor.nextEntry(); if (entry != null) { OCompositeKey entryKey = (OCompositeKey) entry.getKey(); // The index returns all entries. We thus need to filter it manually if (entryKey.getKeys().get(1).equals(key)) { Object inId = entryKey.getKeys().get(0); // Only add the inbound vertex id to the list of ids ids.add(inId); } } else { break; } } } } return ids; }
public OClass createEdgeType(final String iClassName, final String iSuperClassName) { commitAnyActiveTx("create edge type '" + iClassName + "' as subclass of '" + iSuperClassName + "'"); return getRawGraph().getMetadata().getSchema() .createClass(iClassName, getEdgeType(iSuperClassName)); }
OrientEdgeType edgeType = graph.getEdgeType(connClass); if (edgeType != null) { for (String clsName : iClassNames) { OrientEdgeType edgeType = graph.getEdgeType(connClass); if (edgeType != null) { for (String clsName : iClassNames) {
if (element instanceof EdgeFrame) { String label = ((EdgeFrame) element).getLabel(); elementType = orientBaseGraph.getEdgeType(label); } else { elementType = orientBaseGraph.getVertexType(element.getClass().getSimpleName());
final OClass cls = graph.getEdgeType(label); if (cls != null) for (OProperty p : cls.properties()) {
final OClass cls = graph.getEdgeType(label); if (cls != null) for (OProperty p : cls.properties()) {
final OrientEdgeType edgeType = graph.getEdgeType(label); if (edgeType == null)