Package com.thinkaurelius.faunus

Examples of com.thinkaurelius.faunus.FaunusElement$Comparator


        config.setBoolean(RDFInputFormat.FAUNUS_GRAPH_INPUT_RDF_LITERAL_AS_PROPERTY, true);
        config.set(RDFInputFormat.FAUNUS_GRAPH_INPUT_RDF_FORMAT, "n-triples");
        RDFBlueprintsHandler handler = new RDFBlueprintsHandler(config);

        handler.parse("<http://tinkerpop.com#josh> <http://tinkerpop.com#age> \"32\"^^<http://www.w3.org/2001/XMLSchema#int> .");
        FaunusElement subject = handler.next();
        assertEquals(subject.getProperty("name"), "josh");
        assertEquals(subject.getProperty("age"), 32);
        assertFalse(handler.hasNext());

        handler.parse("<http://tinkerpop.com#marko> <http://tinkerpop.com#firstname> \"marko\"^^<http://www.w3.org/2001/XMLSchema#string> .");
        subject = handler.next();
        assertEquals(subject.getProperty("name"), "marko");
        assertEquals(subject.getProperty("firstname"), "marko");
        assertFalse(handler.hasNext());

        handler.parse("<http://tinkerpop.com#stephen> <http://tinkerpop.com#location> \"1.023\"^^<http://www.w3.org/2001/XMLSchema#double> .");
        subject = handler.next();
        assertEquals(subject.getProperty("name"), "stephen");
        assertEquals(subject.getProperty("location"), 1.023d);
        assertFalse(handler.hasNext());

        handler.parse("<http://tinkerpop.com#stephen> <http://tinkerpop.com#alive> \"true\"^^<http://www.w3.org/2001/XMLSchema#boolean> .");
        subject = handler.next();
        assertEquals(subject.getProperty("name"), "stephen");
        assertEquals(subject.getProperty("alive"), true);
        assertFalse(handler.hasNext());

        handler.parse("<http://tinkerpop.com#stephen> <http://tinkerpop.com#ttl> \"1234567890005543\"^^<http://www.w3.org/2001/XMLSchema#long> .");
        subject = handler.next();
        assertEquals(subject.getProperty("name"), "stephen");
        assertEquals(subject.getProperty("ttl"), 1234567890005543l);
        assertFalse(handler.hasNext());

        handler.parse("<http://tinkerpop.com#stephen> <http://tinkerpop.com#height> \"0.45\"^^<http://www.w3.org/2001/XMLSchema#float> .");
        subject = handler.next();
        assertEquals(subject.getProperty("name"), "stephen");
        assertEquals(subject.getProperty("height"), 0.45f);
        assertFalse(handler.hasNext());

    }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.faunus.FaunusElement$Comparator

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.