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

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


       
//        if ( update.getUsing().size() > 0 || update.getUsingNamed().size() > 0 )
//            Log.warn(this, "Graph selection from the dataset not supported very well") ;
//        //return null ;
       
        DatasetGraphMap dsg = new DatasetGraphMap(graphStore) ;
        if ( update.getUsing().size() > )
        {
            if ( update.getUsing().size() > 1 )
            {
                // Lack of scaling here
                // Need to take a copy to merge.
                Graph g = GraphFactory.createGraphMem() ;
               
                for ( Node gn : update.getUsing() )
                {
                    Graph g2 = graphStore.getGraph(gn) ;
                    g.getBulkUpdateHandler().add(g2) ;
                }
                dsg.setDefaultGraph(g) ;
            }
            else
            {
                Node gn = update.getUsing().get(0) ;
                dsg.setDefaultGraph(graphStore.getGraph(gn)) ;
            }
        }
       
        if ( update.getUsingNamed().size() > )
        {
            // Replace with a no named graphs version.
            dsg = new DatasetGraphMap(dsg.getDefaultGraph()) ;
           
            for ( Node gn : update.getUsingNamed() )
                dsg.addGraph(gn, graphStore.getGraph(gn)) ;
        }
        return dsg ;
    }
View Full Code Here


     * that go to make up the default graph (union) and named graphs. 
     */
    public static DatasetGraph dynamicDataset(Collection<Node> defaultGraphs, Collection<Node> namedGraphs, DatasetGraph dsg, boolean defaultUnionGraph)
    {
        Graph dft = new GraphUnionRead(dsg, defaultGraphs) ;
        DatasetGraph dsg2 = new DatasetGraphMap(dft) ;
       
        // The named graphs.
        for ( Node gn : namedGraphs )
        {
            Graph g = GraphOps.getGraph(dsg, gn) ;
            if ( g != null )
                dsg2.addGraph(gn, g) ;
        }
       
        if ( dsg.getContext() != null )
            dsg2.getContext().putAll(dsg.getContext()) ;

        if ( defaultUnionGraph && defaultGraphs.size() == 0 )
        {
            // Create a union graph - there were no defaultGraphs explicitly named.
            Graph unionGraph = new GraphUnionRead(dsg, namedGraphs) ;
            dsg2.setDefaultGraph(unionGraph) ;
        }

        // read-only, <urn:x-arq:DefaultGraph> and <urn:x-arq:UnionGraph> processing.
        dsg2 = new DynamicDatasetGraph(dsg2) ;
        return dsg2 ;
View Full Code Here

    protected DatasetGraph processUsing(UpdateModify update, Query query)
    {
        if ( update.getUsing().size() == 0 && update.getUsingNamed().size() == 0 )
            return null ;
       
        DatasetGraphMap dsg = new DatasetGraphMap(graphStore) ;
        if ( update.getUsing().size() > )
        {
            if ( update.getUsing().size() > 1 )
            {
                // Lack of scaling here
                // Need to take a copy to merge.
                Graph g = GraphFactory.createGraphMem() ;
               
                for ( Node gn : update.getUsing() )
                {
                    Graph g2 = graphStore.getGraph(gn) ;
                    g.getBulkUpdateHandler().add(g2) ;
                }
                dsg.setDefaultGraph(g) ;
            }
            else
            {
                Node gn = update.getUsing().get(0) ;
                dsg.setDefaultGraph(graphStore.getGraph(gn)) ;
            }
        }
       
        if ( update.getUsingNamed().size() > )
        {
            // Replace with a no named graphs version.
            dsg = new DatasetGraphMap(dsg.getDefaultGraph()) ;
           
            for ( Node gn : update.getUsingNamed() )
                dsg.addGraph(gn, graphStore.getGraph(gn)) ;
        }
        return dsg ;
    }
View Full Code Here

TOP

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

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.