Package com.hp.hpl.jena.sparql.core

Examples of com.hp.hpl.jena.sparql.core.Quad


        namedGraphData(gStore, graphIRI, data(t));
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)")) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)")) ;
        UpdateAction.execute(modify, gStore) ;
       
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
View Full Code Here


   
    // ---- update
   
    @Test public void graphDGS_update_1()
    {
        Quad q9 = SSE.parseQuad("(<g3> <s> <p> 9)") ;
        Graph g = makeNamedGraph(baseDSG, gn3;
        baseDSG.add(q9) ;
        Triple t = SSE.parseTriple("(<s> <p> 9)") ;
        assertTrue(g.contains(t)) ;
    }
View Full Code Here

    @Test public void graphDGS_update_2()
    {
        Triple t = SSE.parseTriple("(<s> <p> 9)") ;
        Graph g = makeNamedGraph(baseDSG, gn3;
        g.add(t) ;
        Quad q9 = SSE.parseQuad("(<g3> <s> <p> 9)") ;
        assertTrue(baseDSG.contains(q9)) ;
    }
View Full Code Here

            @Override
            public void run() {
                out.start();
                // Generate quads
                for (int i = 1; i <= generateSize; i++) {
                    Quad q = new Quad(com.hp.hpl.jena.graph.NodeFactory.createURI("http://graph"), com.hp.hpl.jena.graph.NodeFactory.createAnon(), com.hp.hpl.jena.graph.NodeFactory.createURI("http://predicate"),
                            NodeFactoryExtra.intToNode(i));
                    out.quad(q);
                }
                out.finish();
                return;
View Full Code Here

        Node graph = getCurrentGraph() ;
       
        if ( graph == Quad.defaultGraphNodeGenerated )
            graph = Quad.tripleInQuad ;
       
        Quad quad = profile.createQuad(graph, subject, predicate, object, currLine, currCol) ;
        sink.send(quad) ;
    }
View Full Code Here

    {
        if ( quads == null )
        {
            quads = new QuadPattern() ;
            for (Triple t : triples )
                quads.add(new Quad(graphNode, t)) ;
        }
    }
View Full Code Here

    public boolean equivalent(OpQuadPattern opQuads)
    {
        QuadPattern quads = opQuads.getPattern() ;
        if ( quads.size() != 1 ) return false ;
        Quad q = quads.get(0) ;
        return quad.equals(q)
    }
View Full Code Here

                @Override
                public Quad convert(Quad quad)
                {
                    if ( ! quad.isDefaultGraph() ) return quad ;
                   
                    return new Quad(dftGraph, quad.getSubject(), quad.getPredicate(), quad.getObject()) ;
                }
            };
            quads = Iter.map(quads, nt) ;
        }
        return quads;
View Full Code Here

        return acc ;
    }

    static void subst(MultiMap<Node, Triple> acc, Quad quad, Binding b, Map<Node, Node> bNodeMap)
    {
        Quad q = subst(quad, b, bNodeMap) ;
        if ( ! q.isConcrete() )
        {
            Log.warn(TemplateLib.class, "Unbound quad: "+FmtUtils.stringForQuad(quad)) ;
            return ;
        }
        acc.put(q.getGraph(), q.asTriple()) ;
    }
View Full Code Here

                final Map<Node, Node> bNodeMap = new HashMap<Node, Node>() ;

                List<Quad> quadList = new ArrayList<Quad>(quads.size());
                for (Quad quad : quads)
                {
                    Quad q = subst(quad, b, bNodeMap) ;
                    if ( ! q.isConcrete() )
                    {
                        Log.warn(TemplateLib.class, "Unbound quad: "+FmtUtils.stringForQuad(quad)) ;
                        continue ;
                    }
                    quadList.add(q);
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.core.Quad

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.