Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.IndexableGraph.createIndex()


    public void testAddUniqueVertex() {
        IndexableGraph graph = new TinkerGraph();
        Vertex marko = graph.addVertex(0);
        marko.setProperty("name", "marko");
        Index<Vertex> index = graph.createIndex("txIdx", Vertex.class);
        index.put("name", "marko", marko);
        Vertex vertex = IndexableGraphHelper.addUniqueVertex(graph, null, index, "name", "marko");
        assertEquals(vertex.getProperty("name"), "marko");
        assertEquals(vertex, graph.getVertex(0));
        assertEquals(count(graph.getVertices()), 1);
View Full Code Here


                    throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(error).build());
                }

                final Index newIndex;
                try {
                    newIndex = graph.createIndex(indexName, c, indexParameters);
                    rag.tryCommit();
                } catch (Exception e) {
                    logger.info(e.getMessage());

                    rag.tryRollback();
View Full Code Here

    protected ResourceHolder<IndexResource> constructIndexResource(final boolean useToyGraph,
                                                                     final HashMap<String, Object> parameters,
                                                                     final MediaType mediaType) {
        final IndexableGraph indexableGraph = (IndexableGraph) this.toyGraph;
        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
View Full Code Here

    protected ResourceHolder<IndexResource> constructIndexResource(final boolean useToyGraph,
                                                                     final HashMap<String, Object> parameters,
                                                                     final MediaType mediaType) {
        final IndexableGraph indexableGraph = (IndexableGraph) this.toyGraph;
        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
View Full Code Here

                                                                     final HashMap<String, Object> parameters,
                                                                     final MediaType mediaType) {
        final IndexableGraph indexableGraph = (IndexableGraph) this.toyGraph;
        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
View Full Code Here

                                                                     final MediaType mediaType) {
        final IndexableGraph indexableGraph = (IndexableGraph) this.toyGraph;
        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
        indexableGraph.createIndex("index-name-8", Vertex.class);
View Full Code Here

        final IndexableGraph indexableGraph = (IndexableGraph) this.toyGraph;
        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
        indexableGraph.createIndex("index-name-8", Vertex.class);
        final Index<Vertex> madeUpIndex = indexableGraph.createIndex("index-name-9", Vertex.class);
View Full Code Here

        final Index<Vertex> basicNameIndex = indexableGraph.createIndex("index-name-0", Vertex.class);
        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
        indexableGraph.createIndex("index-name-8", Vertex.class);
        final Index<Vertex> madeUpIndex = indexableGraph.createIndex("index-name-9", Vertex.class);
View Full Code Here

        indexableGraph.createIndex("index-name-1", Edge.class);
        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
        indexableGraph.createIndex("index-name-8", Vertex.class);
        final Index<Vertex> madeUpIndex = indexableGraph.createIndex("index-name-9", Vertex.class);

        basicNameIndex.put("name", "marko", this.toyGraph.getVertex(1));
View Full Code Here

        indexableGraph.createIndex("index-name-2", Vertex.class);
        indexableGraph.createIndex("index-name-3", Vertex.class);
        indexableGraph.createIndex("index-name-4", Vertex.class);
        final Index<Edge> edgeIndex = indexableGraph.createIndex("index-name-5", Edge.class);
        indexableGraph.createIndex("index-name-6", Vertex.class);
        indexableGraph.createIndex("index-name-7", Vertex.class);
        indexableGraph.createIndex("index-name-8", Vertex.class);
        final Index<Vertex> madeUpIndex = indexableGraph.createIndex("index-name-9", Vertex.class);

        basicNameIndex.put("name", "marko", this.toyGraph.getVertex(1));
        basicNameIndex.put("name", "vadas", this.toyGraph.getVertex(2));
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.