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

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


        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


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

        model.removeAll();
    }
}
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

    // check that the models are isomorphic but ignoring all statements
    // about the ontology resource:
    _log("Removing statements about ontology resource from both models ");
    Resource ontologyResource = ResourceFactory.createResource(ontologyUri);
    sweetModel.removeAll(ontologyResource, null, null);
    orrModel.removeAll(ontologyResource, null, null);

    _log("Comparing models wih isIsomorphicWith (sweetModel size = "
        + sweetModel.size() + ", orrModel size = " + orrModel.size()
        + ")");
    assertTrue(orrModel.isIsomorphicWith(sweetModel));
View Full Code Here

      try {
        dataset.begin(ReadWrite.WRITE);
        Model m = dataset.getDefaultModel();

        m.removeAll();
        Resource subject = m.createResource(INDEX_INFO_SUBJECT);
        Property predicate = m.createProperty(TIMESTAMP_PREDICATE);
        m.addLiteral(subject, predicate, System.currentTimeMillis());
        predicate = m.createProperty(URI_PREDICATE);
        for (String uri : lastProcessedUris) {
View Full Code Here

      logger.info("cannot add the model because the given name is null.");
      return;
    }
   
    Model namedModel = this.dataset.getNamedModel(name);
    namedModel.removeAll();
    namedModel.add(m.listStatements());
    namedModel.setNsPrefixes(m.getNsPrefixMap());
    namedModel.commit();
    TDB.sync(this.dataset);
  }
View Full Code Here

            .format("Should not have thrown AccessDenied Exception: %s - %s",
                e, e.getTriple()));
      }
    }

    m2.removeAll();
    final SecuredModel m3 = Factory.getInstance(securityEvaluator,
        "http://example.com/securedGraph2", m2);

    try
    {
View Full Code Here

      try {
        dataset.begin(ReadWrite.WRITE);
        Model m = dataset.getDefaultModel();

        m.removeAll();
        Resource subject = m.createResource(INDEX_INFO_SUBJECT);
        Property predicate = m.createProperty(TIMESTAMP_PREDICATE);
        m.addLiteral(subject, predicate, System.currentTimeMillis());
        predicate = m.createProperty(URI_PREDICATE);
        for (String uri : lastProcessedUris) {
View Full Code Here

        Model a = ModelFactory.createDefaultModel();
        Model b = ModelFactory.createDefaultModel();

        a.read(new StringReader(testData), null, "TTL");
        b.read(new StringReader(testData2), null, "TTL");
        b.removeAll(b.createResource("http://r1"), null, null);
        Assert.assertEquals(1, b.size());

        this.testDeltas(a, b, 1);
        this.testDeltas(b, a, 0);
    }
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.