public SchemaContainer(TitanGraph graph) { vertexLabels = Maps.newHashMap(); relationTypes = Maps.newHashMap(); TitanManagement mgmt = graph.openManagement(); try { for (VertexLabel vl : mgmt.getVertexLabels()) { VertexLabelDefinition vld = new VertexLabelDefinition(vl); vertexLabels.put(vld.getName(),vld); } for (EdgeLabel el : mgmt.getRelationTypes(EdgeLabel.class)) { EdgeLabelDefinition eld = new EdgeLabelDefinition(el); relationTypes.put(eld.getName(),eld); } for (PropertyKey pk : mgmt.getRelationTypes(PropertyKey.class)) { PropertyKeyDefinition pkd = new PropertyKeyDefinition(pk); relationTypes.put(pkd.getName(), pkd); } } finally { mgmt.rollback(); } }
assertEquals(SchemaStatus.ENABLED, ((InternalRelationType) friend).getStatus()); assertEquals(5, Iterables.size(mgmt.getRelationTypes(PropertyKey.class))); assertEquals(6, Iterables.size(mgmt.getRelationTypes(EdgeLabel.class))); assertEquals(11, Iterables.size(mgmt.getRelationTypes(RelationType.class))); assertEquals(3, Iterables.size(mgmt.getVertexLabels())); assertEquals(SchemaStatus.ENABLED, ((InternalRelationType) friend).getStatus()); assertEquals(5, Iterables.size(mgmt.getRelationTypes(PropertyKey.class))); assertEquals(6, Iterables.size(mgmt.getRelationTypes(EdgeLabel.class))); assertEquals(11, Iterables.size(mgmt.getRelationTypes(RelationType.class))); assertEquals(3, Iterables.size(mgmt.getVertexLabels()));
public Titan0Graph() { //determine multi-properties once at startup TitanManagement mgmt = null; try { mgmt = Titan0GraphDatabase.getGraphInstance().getManagementSystem(); Iterable<PropertyKey> keys = mgmt.getRelationTypes(PropertyKey.class); multiProperties = Collections.synchronizedSet(new HashSet<String>()); for(PropertyKey key : keys) { if (key.getCardinality() != Cardinality.SINGLE) { multiProperties.add(key.getName()); } } } finally { if (mgmt != null) { mgmt.rollback(); } } }
public SchemaContainer(TitanGraph graph) { vertexLabels = Maps.newHashMap(); relationTypes = Maps.newHashMap(); TitanManagement mgmt = graph.openManagement(); try { for (VertexLabel vl : mgmt.getVertexLabels()) { VertexLabelDefinition vld = new VertexLabelDefinition(vl); vertexLabels.put(vld.getName(),vld); } for (EdgeLabel el : mgmt.getRelationTypes(EdgeLabel.class)) { EdgeLabelDefinition eld = new EdgeLabelDefinition(el); relationTypes.put(eld.getName(),eld); } for (PropertyKey pk : mgmt.getRelationTypes(PropertyKey.class)) { PropertyKeyDefinition pkd = new PropertyKeyDefinition(pk); relationTypes.put(pkd.getName(), pkd); } } finally { mgmt.rollback(); } }
public SchemaContainer(TitanGraph graph) { vertexLabels = Maps.newHashMap(); relationTypes = Maps.newHashMap(); TitanManagement mgmt = graph.getManagementSystem(); try { for (VertexLabel vl : mgmt.getVertexLabels()) { VertexLabelDefinition vld = new VertexLabelDefinition(vl); vertexLabels.put(vld.getName(),vld); } for (EdgeLabel el : mgmt.getRelationTypes(EdgeLabel.class)) { EdgeLabelDefinition eld = new EdgeLabelDefinition(el); relationTypes.put(eld.getName(),eld); } for (PropertyKey pk : mgmt.getRelationTypes(PropertyKey.class)) { PropertyKeyDefinition pkd = new PropertyKeyDefinition(pk); relationTypes.put(pkd.getName(), pkd); } } finally { mgmt.rollback(); } }
public Titan1Graph() { //determine multi-properties once at startup TitanManagement mgmt = null; try { mgmt = Titan1GraphDatabase.getGraphInstance().openManagement(); Iterable<PropertyKey> keys = mgmt.getRelationTypes(PropertyKey.class); multiProperties = new HashSet<>(); for (PropertyKey key : keys) { if (key.cardinality() != Cardinality.SINGLE) { multiProperties.add(key.name()); } } } finally { if (mgmt != null) { mgmt.rollback(); } } }
assertEquals(SchemaStatus.ENABLED,((InternalRelationType)friend).getStatus()); assertEquals(5,Iterables.size(mgmt.getRelationTypes(PropertyKey.class))); assertEquals(6,Iterables.size(mgmt.getRelationTypes(EdgeLabel.class))); assertEquals(11,Iterables.size(mgmt.getRelationTypes(RelationType.class))); assertEquals(3,Iterables.size(mgmt.getVertexLabels())); assertEquals(SchemaStatus.ENABLED,((InternalRelationType)friend).getStatus()); assertEquals(5,Iterables.size(mgmt.getRelationTypes(PropertyKey.class))); assertEquals(6,Iterables.size(mgmt.getRelationTypes(EdgeLabel.class))); assertEquals(11,Iterables.size(mgmt.getRelationTypes(RelationType.class))); assertEquals(3,Iterables.size(mgmt.getVertexLabels()));