Package org.neo4j.cypherdsl.result

Examples of org.neo4j.cypherdsl.result.JSONSerializer


    }, autoIndexNodes = true)
    public void testJSONSerialization()
    {
        data.get();

        JSONSerializer serializer = new JSONSerializer();
        String query = start( lookup( "john", "node_auto_index", "name", "John" ) ).
                match( node( "john" ).out( "friend" ).node().out( "friend" ).node( "fof" ) ).
                returns( as( identifier( "john" ).property( "name" ), "name" ), as( identifier( "fof" ).property(
                        "name" ), "friend" ), identifier( "john" ), as( count(), "count" ) )
                .toString();
        try (Transaction tx = graphdb.beginTx()) {
            String json = serializer.toJSON( engine.execute( query ) ).toString();
            System.out.println( json );
            tx.success();
        }
    }
View Full Code Here


    }, autoIndexNodes = true)
    public void testIterableJSONSerialization()
    {
        data.get();

        JSONSerializer serializer = new JSONSerializer();
        String query = start( lookup( "john", "node_auto_index", "name", "John" ), lookup( "maria",
                "node_auto_index", "name", "Maria" ) )
                .match( path( "p", shortestPath( node( "john" ).out().hops( null, 3 ).node( "maria" ) ) ) )
                .returns( identifier( "p" ) )
                .toString();
        System.out.println( query );
        try (Transaction tx = graphdb.beginTx()) {
            String json = serializer.toJSON( engine.execute( query ) ).toString();
            System.out.println( json );
            tx.success();
        }
    }
View Full Code Here

TOP

Related Classes of org.neo4j.cypherdsl.result.JSONSerializer

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.