public static void assertGraphOfTheGods(TitanGraph gotg) { assertCount(12, gotg.query().vertices()); assertCount(3, gotg.query().has(LABEL_NAME, "god").vertices()); TitanVertex h = getOnlyVertex(gotg.query().has("name", "hercules")); assertEquals(30, h.<Integer>value("age").intValue()); assertEquals("demigod", h.label()); assertCount(5, h.query().direction(Direction.BOTH).edges()); gotg.tx().commit(); }
public NativeTitan1GraphQuery(Titan1Graph graph) { this.query = Titan1GraphDatabase.getGraphInstance().query(); this.graph = graph; }
public NativeTitan0GraphQuery(Titan0Graph graph) { query = Titan0GraphDatabase.getGraphInstance().query(); this.graph = graph; }
@Override public Vertex getOrCreate(String value) { Integer intValue = Integer.valueOf(value); final Vertex v; if (titanGraph.query().has("nodeId", Compare.EQUAL, intValue).vertices().iterator().hasNext()) { v = (Vertex) titanGraph.query().has("nodeId", Compare.EQUAL, intValue).vertices().iterator().next(); } else { final long titanVertexId = TitanId.toVertexId(intValue); v = titanGraph.addVertex(titanVertexId); v.setProperty("nodeId", intValue); titanGraph.commit(); } return v; }
pipe.setStarts(titanGraph.query().vertices());
"Only one property value is supported for find operation"); TitanGraphQuery<?> query = titanGraph.query(); query = query.has(TitanStoreSession.XO_DISCRIMINATORS_PROPERTY + discriminator);