Package com.thinkaurelius.titan.graphdb.database

Examples of com.thinkaurelius.titan.graphdb.database.StandardTitanGraph


public class EdgeSerializerTest {


    @Test
    public void testValueOrdering() {
        StandardTitanGraph graph = (StandardTitanGraph) StorageSetup.getInMemoryGraph();
        TitanLabel father = graph.makeLabel("father").manyToOne().make();
        for (int i=1;i<=5;i++) graph.makeKey("key"+i).single().dataType(Integer.class).make();

        TitanVertex v1 = graph.addVertex(null), v2 = graph.addVertex(null);
        TitanEdge e1 = v1.addEdge("father",v2);
        for (int i=1;i<=5;i++) e1.setProperty("key"+i,i);

        graph.commit();

        e1.remove();
        graph.commit();

    }
View Full Code Here


     * @param configuration Configuration for the graph database
     * @return Titan graph database
     * @see <a href="https://github.com/thinkaurelius/titan/wiki/Graph-Configuration">Graph Configuration Wiki</a>
     */
    public static TitanGraph open(Configuration configuration) {
        return new StandardTitanGraph(new GraphDatabaseConfiguration(configuration));
    }
View Full Code Here

     * @throws com.thinkaurelius.titan.core.TitanException if clearing the storage is unsuccessful
     */
    public static final void clear(TitanGraph graph) {
        Preconditions.checkNotNull(graph);
        Preconditions.checkArgument(graph instanceof StandardTitanGraph,"Invalid graph instance detected: %s",graph.getClass());
        StandardTitanGraph g = (StandardTitanGraph)graph;
        Preconditions.checkArgument(!g.isOpen(),"Graph needs to be shut down before it can be cleared.");
        final GraphDatabaseConfiguration config = g.getConfiguration();
        BackendOperation.execute(new Callable<Boolean>(){
            @Override
            public Boolean call() throws Exception {
                config.getBackend().clearStorage();
                return true;
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.graphdb.database.StandardTitanGraph

Copyright © 2018 www.massapicom. 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.