Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model.removeAll()


    if (user < 0) return;
    final Model model = ((TaskEngineWithRdf) agent.getEngine()).getRuntimeRdfModel();
   
    SdbUtil.run(dataSource, storeDesc, "usermodel:" + user, new SdbQuery() {
      public void exec(Model sdbModel) {
        model.removeAll();
        model.add(sdbModel);
      }
    });
  }
 
View Full Code Here


        Model model = (removeDefault) ?
            SDBFactory.connectDefaultModel(getStore()) :
            SDBFactory.connectNamedModel(getStore(), IRI) ;

        model.removeAll();
    }
}
View Full Code Here

        Graph graph = model.getGraph() ;   

        if ( isVerbose() && replace )
            System.out.println("Emptying: "+filename) ;
        if (replace)
            model.removeAll();

        if ( isVerbose() || getModTime().timingEnabled() )
            System.out.println("Start load: "+filename) ;
        if ( getModTime().timingEnabled() )
        {
View Full Code Here

                        store = StoreFactory.create(desc, sdbConn);
       
                        // save model
                        Model m = SDBFactory.connectDefaultModel(store) ;              
                        m.begin();
                        m.removeAll();
                        m.add(model);
                        m.commit();

                    } catch (Exception e) {
                        System.out.println( "\nFailed on iteration " + i);
View Full Code Here

                System.out.println("Model: "+modelNameIterator.next()) ;
            }
            System.out.println("1 -----") ;
            model.write(System.out, "N-TRIPLES") ;
            System.out.println("-----") ;
            model.removeAll() ;
            System.out.println("2 -----") ;
            model.write(System.out, "N-TRIPLES") ;
            System.out.println("-----") ;
            store.close() ;
           
View Full Code Here

    {
        IndexBuilderString indexBuilder = new IndexBuilderString();
      Model model = ModelFactory.createDefaultModel();
        model.register(indexBuilder) ;
        FileManager.get().readModel(model, datafile) ;
        model.removeAll(ResourceFactory.createResource("http://example/doc3"), (Property)null, (RDFNode)null);
        indexBuilder.closeWriter() ;
       
        IndexLARQ index = indexBuilder.getIndex() ;
        assertFalse(index.searchModelByIndex("keyword").hasNext()) ;     
    }
View Full Code Here

      Model model = ModelFactory.createDefaultModel();
        model.register(indexBuilder) ;
        model.add(model.createResource("http://example/r1"), model.createProperty("http://example/p"), model.createLiteral("foo"));
        model.add(model.createResource("http://example/r2"), model.createProperty("http://example/p"), model.createLiteral("foo"));

        model.removeAll(model.getResource("http://example/r1"), model.getProperty("http://example/p"), model.createLiteral("foo"));       
        IndexLARQ index = indexBuilder.getIndex() ;
        assertTrue(index.searchModelByIndex("foo").hasNext()) ; // the Model is used as reference counting, still one literal "foo" is present in the Lucene index

        model.removeAll(model.getResource("http://example/r2"), model.getProperty("http://example/p"), model.createLiteral("foo"));       
        index = indexBuilder.getIndex() ;
View Full Code Here

        model.removeAll(model.getResource("http://example/r1"), model.getProperty("http://example/p"), model.createLiteral("foo"));       
        IndexLARQ index = indexBuilder.getIndex() ;
        assertTrue(index.searchModelByIndex("foo").hasNext()) ; // the Model is used as reference counting, still one literal "foo" is present in the Lucene index

        model.removeAll(model.getResource("http://example/r2"), model.getProperty("http://example/p"), model.createLiteral("foo"));       
        index = indexBuilder.getIndex() ;
        assertFalse(index.searchModelByIndex("foo").hasNext()) ;
    }
   
    @Test public void test_duplicates_1()
View Full Code Here

       
        ds.asDatasetGraph().getDefaultGraph().add(t1) ;
        ds.getNamedModel(graphName).getGraph().add(t1) ;
       
        Model m = ds.getDefaultModel() ;
        m.removeAll() ;
        assertEquals(0, m.size()) ;
       
        // But still in the other graph
        assertTrue(ds.getNamedModel(graphName).getGraph().contains(t1)) ;
    }
View Full Code Here

       
        ds.asDatasetGraph().getDefaultGraph().add(t1) ;
        ds.getNamedModel(graphName).getGraph().add(t1) ;
       
        Model m = ds.getNamedModel(graphName) ;
        m.removeAll() ;
        assertEquals(0, m.size()) ;
       
        // But still in the other graph
        assertTrue(ds.getDefaultModel().getGraph().contains(t1)) ;
    }
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.