Examples of TitanKey


Examples of com.thinkaurelius.titan.core.TitanKey

        TitanType dstType = dstTx.getType("name");
        Assert.assertNotNull(dstType);
        Assert.assertTrue(dstType instanceof TitanKey);

        TitanKey dstKey = (TitanKey) dstType;
        Assert.assertEquals(dstKey.getName(), "name");
        Assert.assertEquals(dstKey.getDataType(), String.class);

        // Make sure the vertices got copied.
        Vertex dstJoeVertex = dstTx.getVertices("name", "Joe").iterator().next();
        Assert.assertNotNull(dstJoeVertex);
        Assert.assertEquals(dstJoeVertex.getProperty("name"), "Joe");
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

        TitanTransaction tx = g.newTransaction();
        // Add a vertex that has an out edge to every other vertex
        Vertex hiOutDeg = tx.addVertex(Schema.SUPERNODE_UID);
        String label = schema.getSupernodeOutLabel();
        TitanKey uidKey = tx.getPropertyKey(Schema.UID_PROP);
        hiOutDeg.setProperty(Schema.UID_PROP, Schema.SUPERNODE_UID);
        String pKey = schema.getSortKeyForLabel(label);
        for (long i = INITIAL_VERTEX_UID; i < schema.getVertexCount(); i++) {
            Vertex in = tx.getVertex(uidKey, i);
            Edge e = hiOutDeg.addEdge(label, in);
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

            tx.makeKey(getEdgePropertyName(i)).dataType(Integer.class).indexed(Edge.class).single().make();
        }
        for (int i = 0; i < edgeLabels; i++) {
            String labelName = getEdgeLabelName(i);
            String pkName = getSortKeyForLabel(labelName);
            TitanKey pk = tx.getPropertyKey(pkName);
            tx.makeLabel(getEdgeLabelName(i)).sortKey(pk).make();
        }

        tx.makeKey(UID_PROP).dataType(Long.class).indexed(Vertex.class).single().unique().make();
        tx.commit();
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

    public void testTransactionalMemory() throws Exception {
        graph.makeKey("uid").dataType(Long.class).indexed(Vertex.class).single(TypeMaker.UniquenessConsistency.NO_LOCK)
                .unique(TypeMaker.UniquenessConsistency.NO_LOCK).make();
        graph.makeKey("name").dataType(String.class).single(TypeMaker.UniquenessConsistency.NO_LOCK)
                .make();
        TitanKey time = graph.makeKey("time").dataType(Integer.class).single(TypeMaker.UniquenessConsistency.NO_LOCK).make();
        graph.makeLabel("friend").signature(time).directed().make();
        graph.commit();

        final Random random = new Random();
        final int rounds = 100;
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

        graph.makeKey("name").dataType(String.class).indexed(Vertex.class).unique().make();
        graph.makeKey("age").dataType(Integer.class).indexed(INDEX_NAME, Vertex.class).make();
        graph.makeKey("type").dataType(String.class).make();

        final TitanKey time = graph.makeKey("time").dataType(Integer.class).make();
        final TitanKey reason = graph.makeKey("reason").dataType(String.class).indexed(INDEX_NAME, Edge.class).make();
        graph.makeKey("place").dataType(Geoshape.class).indexed(INDEX_NAME, Edge.class).make();

        graph.makeLabel("father").manyToOne().make();
        graph.makeLabel("mother").manyToOne().make();
        graph.makeLabel("battled").sortKey(time).make();
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

    @Override
    public void testGraphQueryForVertices() {
        TitanGraph g = (TitanGraph) graphTest.generateGraph();
        if (g.getType("age") == null) {
            TitanKey age = g.makeKey("age").dataType(Integer.class).single().make();
        }
        g.shutdown();
        super.testGraphQueryForVertices();
    }
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanKey

    @Override
    public void testGraphQueryForEdges() {
        TitanGraph g = (TitanGraph) graphTest.generateGraph();
        if (g.getType("weight") == null) {
            TitanKey weight = g.makeKey("weight").dataType(Double.class).single().make();
        }
        g.shutdown();
        super.testGraphQueryForEdges();
    }
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.