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

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


        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 = Node.createURI("S") ;
        Node p = Node.createURI("P") ;
        Node o = Node.createLiteral(Integer.toString(value), null, XSDDatatype.XSDinteger) ;
        return new Quad(g,s,p,o) ;
    }
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

        Node g = Quad.defaultGraphNodeGenerated ; // urn:x-arq:DefaultGraphNode
        Node s = Node.createURI("S") ;
        Node p = Node.createURI("P"+value) ;
        // Integer - that gets inlined.
        Node o = Node.createLiteral(Integer.toString(value), null, XSDDatatype.XSDinteger) ;
        return new Quad(g,s,p,o) ;
    }
View Full Code Here

                            Node g = createURI(gn) ;
                            for ( Map<String, Object> q : quads ) {
                                Node s = createNode(q, "subject") ;
                                Node p = createNode(q, "predicate") ;
                                Node o = createNode(q, "object") ;
                                Quad quad = parserProfile.createQuad(g, s, p, o, -1, -1) ;
                                output.quad(quad) ;
                            }
                        }
                    }
                    return null ;
View Full Code Here

    }

    private static List<Tuple<Node>> tuplesQuads(Iterator<Quad> iter) {
        List<Tuple<Node>> tuples = new ArrayList<Tuple<Node>>() ;
        for ( ; iter.hasNext() ; ) {
            Quad q = iter.next() ;
            Tuple<Node> tuple = createTuple(q.getGraph(), q.getSubject(), q.getPredicate(), q.getObject()) ;
            tuples.add(tuple) ;
        }
        return tuples ;
    }
View Full Code Here

            DatasetGraph dsg = (DatasetGraph)object ;

            Iterator<Quad> iter = dsg.find() ;
            for ( ; iter.hasNext() ; )
            {
                Quad q = iter.next() ;
                Node s = q.getSubject() ;
                Node p = q.getPredicate() ;
                Node o = q.getObject() ;
                Node g = q.getGraph() ;
               
                String gq = (g == null || Quad.isDefaultGraph(g) ) ? null : g.getURI() ;
                String sq = resourceString(s) ;
                String pq = p.getURI() ;
                if ( o.isLiteral() )
View Full Code Here

            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

    {
        Node gNode = nodeTable.getNodeForNodeId(g) ;
        Node sNode = nodeTable.getNodeForNodeId(s) ;
        Node pNode = nodeTable.getNodeForNodeId(p) ;
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        return new Quad(gNode, sNode, pNode, oNode) ;
    }
View Full Code Here

    /** Example setup - in-memory dataset with two graphs, one triple in each */
    private static Dataset setup()
    {
        Dataset ds = TDBFactory.createDataset() ;
        DatasetGraph dsg = 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

    {
        Node gNode = nodeTable.getNodeForNodeId(g) ;
        Node sNode = nodeTable.getNodeForNodeId(s) ;
        Node pNode = nodeTable.getNodeForNodeId(p) ;
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        return new Quad(gNode, sNode, pNode, oNode) ;
    }
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.