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

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


        private final Node gn ;
        ParserOutputSinkTriplesToQuads(Node gn, StreamRDF base)
        { super(base) ; this.gn = gn ; }
       
        @Override public void triple(Triple triple)
        { sink.quad(new Quad(gn, triple)) ; }
View Full Code Here


    @Override
    protected final void runParser()
    {
        while(hasNext())
        {
            Quad x = parseOne() ;
            if ( x != null )
                dest.quad(x) ;
        }
    }
View Full Code Here

        return prologue.getResolver().resolve(uriStr) ;
    }

    @Override
    public Quad createQuad(Node g, Node s, Node p, Node o, long line, long col) {
        return new Quad(g, s, p, o) ;
    }
View Full Code Here

    @Override
    public void addTriple(int index, Triple triple)
    {
        check(triple) ;
        quads.add(index, new Quad(graphNode, triple)) ;
    }
View Full Code Here

    @Override
    public void addTriple(Triple triple)
    {
        check(triple) ;
        sink.send(new Quad(graphNode, triple)) ;
    }
View Full Code Here

    /** Example setup - in-memory dataset with two graphs, one triple in each */
    private static Dataset setup()
    {
        Dataset ds = TDBFactory.createDataset() ;
        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;
        Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)") ;
        Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)") ;
        dsg.add(q1) ;
        dsg.add(q2) ;
        return ds ;
    }
View Full Code Here

                public void run() {
                    try {
                        if (numberGenerator.nextInt(2) == 0) {
                            DatasetGraphTxn txnGraph =
                                    storeConnection.begin(ReadWrite.WRITE);
                            txnGraph.add(new Quad(
                                    NodeFactory.createURI("http://openjena.org/"
                                            + numberGenerator.nextInt()),
                                    NodeFactory.createURI("http://openjena.org/"
                                            + numberGenerator.nextInt()),
                                    NodeFactory.createURI("http://openjena.org/"
View Full Code Here

        int count = 0 ;
        int maxN = 500 ;
        int N = RandomLib.qrandom.nextInt(maxN) ;
        for ( int j = 0 ; j < N; j++ )
        {
            Quad q = genQuad(id*maxN+j) ;
            if ( ! dsg.contains(q) )
            {
                dsg.add(q) ;
                count++ ;
            }
View Full Code Here

        Lib.sleep(x) ;
    }
   
    static Quad genQuad(int value)
    {
        Quad q1 = SSE.parseQuad("(_ <s> <p> <o>)") ;
        Node g1 = q.getGraph() ;
       
        Node g = Quad.defaultGraphNodeGenerated ; // urn:x-arq:DefaultGraphNode
        Node s = NodeFactory.createURI("S") ;
        Node p = NodeFactory.createURI("P") ;
        Node o = NodeFactory.createLiteral(Integer.toString(value), null, XSDDatatype.XSDinteger) ;
        return new Quad(g,s,p,o) ;
    }
View Full Code Here

        public boolean hasNext() { return iter.hasNext() ; }
       
        @Override
        public Triple next()
        {
            Quad q = iter.next();
            if ( graphNode != null && ! q.getGraph().equals(graphNode))
                throw new InternalError("ProjectQuadsToTriples: Quads from unexpected graph (expected="+graphNode+", got="+q.getGraph()+")") ;
            return q.asTriple() ;
        }
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.