Examples of vertices()


Examples of com.thinkaurelius.titan.core.TitanVertexQuery.vertices()

        for (int t = 0; t < 4; t++) {
            time = time();
            for (int i = 0; i < numVertices; i++) {
                TitanVertexQuery q = ((TitanVertexQuery) vertices[i].query()).direction(Direction.OUT).labels("connect");
                if (inMemory) { //TODO: this has been disabled
                    for (Vertex v : q.vertices()) {
                        v.getId();
                    }
                } else {
                    VertexList vl = q.vertexIds();
                    for (int j = 0; j < vl.size(); j++) {
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

        }

        GraphQuery query = graph.query()
                .has(RelationshipProperty.NAME.getName(), name)
                .has(RelationshipProperty.TYPE.getName(), type.getName());
        Iterator<Vertex> results = query.vertices().iterator();
        return results.hasNext() ? results.next() : null// returning one since name is unique
    }

    protected Vertex createVertex(String name, RelationshipType type) {
        return createVertex(name, type, getCurrentTimeStamp());
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

    private Vertex getEntityVertex(String entityName, RelationshipType entityType) {
        GraphQuery entityQuery = getQuery()
                .has(RelationshipProperty.NAME.getName(), entityName)
                .has(RelationshipProperty.TYPE.getName(), entityType.getName());
        Iterator<Vertex> iterator = entityQuery.vertices().iterator();
        Assert.assertTrue(iterator.hasNext());

        Vertex entityVertex = iterator.next();
        Assert.assertNotNull(entityVertex);
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

        GraphQuery userQuery = getQuery()
                .has(RelationshipProperty.NAME.getName(), FALCON_USER)
                .has(RelationshipProperty.TYPE.getName(), RelationshipType.USER.getName());

        List<String> feedNames = new ArrayList<String>();
        for (Vertex userVertex : userQuery.vertices()) {
            for (Vertex feed : userVertex.getVertices(Direction.IN, RelationshipLabel.USER.getName())) {
                if (feed.getProperty(RelationshipProperty.TYPE.getName()).equals(feedType)) {
                    System.out.println(FALCON_USER + " owns -> " + GraphUtils.vertexString(feed));
                    feedNames.add(feed.<String>getProperty(RelationshipProperty.NAME.getName()));
                }
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

        GraphQuery classQuery = getQuery()
                .has(RelationshipProperty.NAME.getName(), "Secure")
                .has(RelationshipProperty.TYPE.getName(), RelationshipType.TAGS.getName());

        List<String> actual = new ArrayList<String>();
        for (Vertex feedVertex : classQuery.vertices()) {
            for (Vertex feed : feedVertex.getVertices(Direction.BOTH, "classified-as")) {
                if (feed.getProperty(RelationshipProperty.TYPE.getName()).equals(feedType)) {
                    System.out.println(" Secure classification -> " + GraphUtils.vertexString(feed));
                    actual.add(feed.<String>getProperty(RelationshipProperty.NAME.getName()));
                }
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

    verify(mockGraphQuery).limit(1);
   
   
   
    List<Vertex> v = new ArrayList<Vertex>();
    stub(mockGraphQuery.vertices()).toReturn(v);
    query.vertices();
    verify(mockGraphQuery).vertices();
   
    Iterable<Person> people = query.vertices(Person.class);
    verify(mockGraphQuery, times(2)).vertices();
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

                if (this.highRange != Integer.MAX_VALUE) {
                    query = query.limit(this.highRange - this.count);
                }

                this.currentIterator = this.elementClass.equals(Vertex.class) ?
                        (Iterator<E>) query.vertices().iterator() :
                        (Iterator<E>) query.edges().iterator();
            }
        }
    }
View Full Code Here

Examples of com.tinkerpop.blueprints.GraphQuery.vertices()

    // NO INDEX: EXECUTE A QUERY
    GraphQuery query = query();
    for (int i = 0; i < iKey.length; i++) {
      query.has(iKey[i], iValue[i]);
    }
    return query.vertices();
  }

  /**
   * Returns all the edges in Graph.
   *
 
View Full Code Here

Examples of com.tinkerpop.blueprints.VertexQuery.vertices()

        VertexQuery query = vertex.query().direction(queryDirection);

        JSONArray elementArray = new JSONArray();
        long counter = 0;
        if (returnType == ReturnType.VERTICES || returnType == ReturnType.VERTEX_IDS) {
            Iterable<Vertex> vertexQueryResults = query.vertices();
            for (Vertex v : vertexQueryResults) {
                if (returnType.equals(ReturnType.VERTICES)) {
                    elementArray.put(GraphSONUtility.jsonFromElement(
                            v, getVertexIndexedKeys(), GraphSONMode.NORMAL));
                } else {
View Full Code Here

Examples of com.tinkerpop.blueprints.VertexQuery.vertices()

                        int temp = this.highRange - this.count;
                        query = query.limit(temp < this.branchFactor ? temp : this.branchFactor);
                    }
                }
                this.currentIterator = this.elementClass.equals(Vertex.class) ?
                        (Iterator<E>) query.vertices().iterator() :
                        (Iterator<E>) query.edges().iterator();
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.