Examples of asDatasetGraph()


Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

    @Test public void dataset5()
    {
        String graphName = "http://example/" ;
        Triple triple = SSE.parseTriple("(<x> <y> <z>)") ;
        Dataset ds = graphLocation.getDataset() ;
        Graph g2 = ds.asDatasetGraph().getGraph(com.hp.hpl.jena.graph.NodeFactory.createURI(graphName)) ;
        // Graphs only exists if they have a triple in them
        g2.add(triple) ;
       
        assertTrue(ds.containsNamedModel(graphName)) ;
        List<String> x = Iter.toList(ds.listNames()) ;
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

        assertTrue(ds.containsNamedModel(graphName)) ;
        List<String> x = Iter.toList(ds.listNames()) ;
        List<String> y = Arrays.asList(graphName) ;
        assertEquals(x,y) ;
       
        assertEquals(1, ds.asDatasetGraph().size()) ;
    }
}
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

        // Assumes a single test dataset description in the assembler file.
        Dataset ds = TextDatasetFactory.create(file) ;
        if (ds == null)
            throw new CmdException("No dataset description found") ;
        // get index.
        dataset = (DatasetGraphText)(ds.asDatasetGraph()) ;
        textIndex = dataset.getTextIndex() ;
        if (textIndex == null)
            throw new CmdException("Dataset has no text index") ;
        entityDefinition = textIndex.getDocDef() ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

        // Check if it is in the model.
        if ( ! datasetDesc.hasProperty(RDF.type) )
            throw new FusekiConfigException("No rdf:type for dataset "+nodeLabel(datasetDesc)) ;
       
        Dataset ds = (Dataset)Assembler.general.open(datasetDesc;
        sDesc.dataset = ds.asDatasetGraph() ;
        return sDesc ;
       
    }
   
    private static RDFNode getOne(Resource svc, String property)
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

    // Assumes a single test daatset description in the assembler file.
    Dataset ds = SpatialDatasetFactory.create(file);
    if (ds == null)
      throw new CmdException("No dataset description found");
    // get index.
    dataset = (DatasetGraphSpatial) (ds.asDatasetGraph());
    spatialIndex = dataset.getSpatialIndex();
    if (spatialIndex == null)
      throw new CmdException("Dataset has no text index");
   
    context= new SpatialIndexContext(spatialIndex);
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

    @Test public void dataset_1()
    {
        Dataset ds = DatasetFactory.assemble(dir+"dataset.ttl") ;
        assertNotNull(ds) ;
        // Check it will be dispatched to SDB
        DatasetGraph dsg = ds.asDatasetGraph() ;
        assertTrue( dsg instanceof DatasetGraphSDB ) ;
    }
   
    @Test public void connection_1()
    {
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

   
    private Store create(Model assem)
    {
        // Create a store and format
        Dataset ds = DatasetFactory.assemble(assem) ;
        Store store = ((DatasetGraphSDB)ds.asDatasetGraph()).getStore() ;
        store.getTableFormatter().create() ;
        return store ;
    }
   
    @Test public void model_3()
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

        FileOps.clearDirectory( path );
        Location location = new Location ( path );
        Dataset dataset = TDBFactory.createDataset ( location );
        dataset.begin ( ReadWrite.WRITE );
        try {
            DatasetGraph dsg = dataset.asDatasetGraph();
            DatasetGraph dsg2 = RiotLoader.datasetFromString("<http://example/org> <http://www.w3.org/2000/01/rdf-schema#label> \"Hello \n World!\" .", Lang.TURTLE, null);
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
                Quad quad = quads.next();
                dsg.add(quad);
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

            e.printStackTrace(System.err);
            dataset.abort();
        } finally {
            dataset.end();
        }
        RiotWriter.writeNQuads(System.out, dataset.asDatasetGraph());
    }

}
View Full Code Here

Examples of com.hp.hpl.jena.query.Dataset.asDatasetGraph()

        // Check there is a dataset.
        if ( dataset == null )
            dataset = DatasetFactory.createMem() ;

        modTime.startTimer() ;
        DatasetGraph dsg = dataset.asDatasetGraph() ;

        if ( printOp || printPlan )
        {
            if ( printOp )
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.