Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Node


        test(nodeFormatter, str, str) ;
    }

    public static void test(NodeFormatter nodeFormatter, String nStr , String str)
    {
        Node n = NodeFactory.parseNode(nStr) ;
        test(nodeFormatter, n, str) ;
    }
View Full Code Here


        system.addProperty(DOAP.maintainer, who) ;
       
        Resource release = model.createResource(DOAP.Version) ;
        system.addProperty(DOAP.release, release) ;
       
        Node today_node = NodeFactory.todayAsDate() ;
        Literal today = model.createTypedLiteral(today_node.getLiteralLexicalForm(), today_node.getLiteralDatatype()) ;
        release.addProperty(DOAP.created, today) ;
        release.addProperty(DOAP.name, releaseName) ;      // Again
       
        TestSuite suite = ScriptTestSuiteFactory.make(testManifest) ;
        SimpleTestRunner.runSilent(suite) ;
View Full Code Here

        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "data-2.ru") ;
       
       
        Graph g = GraphFactory.createPlainGraph() ;
        Node b = Node.createAnon() ;
       
        g.add(new Triple(s, p, b)) ;
        g.add(new Triple(b, q, v)) ;
        assertTrue(g.isIsomorphicWith(gStore.getDefaultGraph())) ;
    }
View Full Code Here

    {
        DatasetGraph dsg = emptyDataset() ;
        assertNotNull(dsg) ;
        Quad quad1 = SSE.parseQuad("(quad <g> <s> <p> <o1>)") ;
        Quad quad2 = SSE.parseQuad("(quad <g> <s> <p> <o2>)") ;
        Node g  = SSE.parseNode("<g>") ;
        Node s  = SSE.parseNode("<s>") ;
        Node p  = SSE.parseNode("<p>") ;
        Node o1 = SSE.parseNode("<o1>") ;
        Node o2 = SSE.parseNode("<o2>") ;
       
        dsg.add(g,s,p,o1) ;
        assertTrue(dsg.contains(quad1)) ;
        assertTrue(dsg.contains(g,s,p,o1)) ;
        assertFalse(dsg.contains(g,s,p,o2)) ;
View Full Code Here

    // Graph centric operations
    @Test public void graph_01()
    {
        DatasetGraph dsg = emptyDataset() ;
        assertNotNull(dsg) ;
        Node g = Node.createURI("g") ;

        // Assumes an empty graph is detectable
        dsg.addGraph(g, GraphFactory.createDefaultGraph());
        assertTrue(dsg.containsGraph(g)) ;
        Triple t = SSE.parseTriple("(<s> <p> <o>)") ;
View Full Code Here

        assertFalse(dsg.getGraph(Node.createURI("g")).isEmpty()) ;
    }

    @Test public void graph_02()
    {
        Node g = Node.createURI("g") ;
        DatasetGraph dsg = emptyDataset() ;
        assertNotNull(dsg) ;
        Quad quad = SSE.parseQuad("(quad <g> <s> <p> <o>)") ;
        dsg.add(quad) ;
       
View Full Code Here

        assertFalse(dsg.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY).hasNext()) ;
    }
   
    @Test public void graph_03()
    {
        Node g = Node.createURI("g") ;
        DatasetGraph dsg = emptyDataset() ;
        Graph data = SSE.parseGraph("(graph (<s> <p> <o>))") ;
        dsg.addGraph(g, data) ;
        Quad quad = SSE.parseQuad("(quad <g> <s> <p> <o>)") ;
        assertTrue(dsg.contains(quad)) ;
View Full Code Here

        assertTrue(dsg.contains(quad)) ;
    }
   
    @Test public void find_01()
    {
        Node g1 = Node.createURI("g1") ;
        DatasetGraph dsg = emptyDataset() ;
        Quad quad1 = SSE.parseQuad("(quad <g1> <s1> <p1> <o1>)") ;
        Quad quad2 = SSE.parseQuad("(quad <g2> <s2> <p2> <o2>)") ;
        dsg.add(quad1) ;
        dsg.add(quad2) ;
View Full Code Here

    }
   
    @Test public void deleteAny_01()
    {
        DatasetGraph dsg = emptyDataset() ;
        Node subject = Node.createURI("http://example/s");
        Node predicate = Node.createURI("http://example/p");
        Node object = Node.createAnon();
        dsg.add(new Quad(Quad.defaultGraphIRI, subject, predicate, object));
        dsg.deleteAny(Node.ANY, subject, null, null);
    }
View Full Code Here

        assertFalse("Not false: "+v, XSDFuncOp.booleanEffectiveValue(v)) ;
    }
   
    static NodeValue make(String str)
    {
        Node n = NodeFactory.parseNode(str) ;
        NodeValue nv = NodeValue.makeNode(n) ;
        return nv ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Node

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.