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

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


        init() ;
    }
   
    private void init()
    {
        DatasetGraph dsg = (dataset == null) ? null : dataset.asDatasetGraph() ;
        context = Context.setupContext(context, dsg) ;
        if ( query != null )
            context.put(ARQConstants.sysCurrentQuery, query) ;
        // NB: Setting timeouts via the context after creating a QueryExecutionBase
        // will not work. But we can't move it until the point the execution starts because of
View Full Code Here


    public Plan getPlan()
    {
        if ( plan == null )
        {
            DatasetGraph dsg = prepareDataset(dataset, query, fileManager) ;
            Binding inputBinding = null ;
            if ( initialBinding != null )
                inputBinding = BindingUtils.asBinding(initialBinding) ;
            if ( inputBinding == null )
                inputBinding = BindingRoot.create() ;
View Full Code Here

       
        String baseURI = query.getBaseURI() ;
        if ( baseURI == null )
            baseURI = IRIResolver.chooseBaseURI() ;
       
        DatasetGraph dsg = DatasetUtils.createDatasetGraph(query.getDatasetDescription(),
                                                           fileManager, baseURI ) ;
        return dsg ;
    }
View Full Code Here

    }
   
    @Override
    protected QueryIterator nextStage(Binding outerBinding)
    {
        DatasetGraph ds = getExecContext().getDataset() ;
        // Is this closed?
        Iterator<Node> graphNameNodes = makeSources(ds, outerBinding, opGraph.getNode());
       
//        List<Node> x = Iter.toList(graphNameNodes) ;
//        graphNameNodes = x.iterator() ;
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

    protected static QueryExecution make(Query query, Dataset dataset, Context context)
    {
        query.setResultVars() ;
        if ( context == null )
            context = ARQ.getContext()// .copy done in QueryExecutionBase -> Context.setupContext.
        DatasetGraph dsg = null ;
        if ( dataset != null )
            dsg = dataset.asDatasetGraph() ;
        QueryEngineFactory f = findFactory(query, dsg, context);
        if ( f == null )
        {
View Full Code Here

    }
   
    @Override
    protected QueryIterator nextStage(Binding outerBinding)
    {
        DatasetGraph ds = getExecContext().getDataset() ;
        // Is this closed?
        Iterator<Node> graphNameNodes = makeSources(ds, outerBinding, opGraph.getNode());
       
//        List<Node> x = Iter.toList(graphNameNodes) ;
//        graphNameNodes = x.iterator() ;
View Full Code Here

        }

        if ( ! Var.isVar(graphNode) )
            throw new ARQInternalErrorException("OpDatasetNames: Not a URI or variable: "+graphNode) ;

        DatasetGraph dsg = evaluator.getExecContext().getDataset() ;
        Iterator<Node> iter = dsg.listGraphNodes() ;
        List<Binding> list = new ArrayList<Binding>((int)dsg.size()) ;
        for ( ; iter.hasNext(); )
        {
            Node gn = iter.next();
            Binding b = BindingFactory.binding(Var.alloc(graphNode), gn) ;
            list.add(b) ;
View Full Code Here

    {
        if ( opQuad.isEmpty() )
            return TableFactory.createUnit() ;
       
        ExecutionContext cxt = evaluator.getExecContext() ;
        DatasetGraph ds = cxt.getDataset() ;
        BasicPattern pattern = opQuad.getBasicPattern() ;
       
        if ( ! opQuad.getGraphNode().isVariable() )
        {
            if ( ! opQuad.getGraphNode().isURI() )
            { throw new ARQInternalErrorException("Not a URI or variable: "+opQuad.getGraphNode()) ;}
            Graph g = null ;
           
            if ( opQuad.isDefaultGraph() )
                g = ds.getDefaultGraph() ;
            else
                g = ds.getGraph(opQuad.getGraphNode()) ;
            if ( g == null )
                return new TableEmpty() ;
            ExecutionContext cxt2 = new ExecutionContext(cxt, g) ;
            QueryIterator qIter = executeBGP(pattern, QueryIterRoot.create(cxt2), cxt2) ;
            return TableFactory.create(qIter) ;
View Full Code Here

   
    @Override
    public boolean accept(Query query, DatasetGraph dsg, Context context) {
        if ( !dsg instanceof DatasetGraphWrapper ) )
            return false ;   
        DatasetGraph dsg2 = ((DatasetGraphWrapper)dsg).getWrapped() ;
        return QueryEngineRegistry.findFactory(query, dsg2, context).accept(query, dsg2, context) ;
    }
View Full Code Here

TOP

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

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.