On 27/06/14 14:25, Benson Margulies wrote:
here's a little test method. The second call to smallAssertions sees
no triples at all. There's a todo on the doc for ontologies, and I'll
cheerfully write some doc if someone will tell me what dumb thing I've
missed here.



Hi Benson,

There seem to be details that might matter but aren't included. Do you have a complete, standalone, test case?

  @Test
     public void tdb() throws Exception {
         Dataset dataset =
TDBFactory.createDataset(tempDataset.getAbsolutePath());
         dataset.begin(ReadWrite.WRITE);
         Model model = dataset.getDefaultModel();
         OntModel ontModel =
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, model);
         ResRdfBuilder resRdfBuilder = new ResRdfBuilder(ontModel, 1);
         ResTsvReader reader = new ResTsvReader();
         URL dataUrl = Resources.getResource(ResTsvReaderTest.class, 
"data.txt");
         ByteSource dataSource = Resources.asByteSource(dataUrl);
         reader.read(dataSource, resRdfBuilder);

ResRdfBuilder and ResTsvReader.read -- what do they do?

         smallAssertions(ontModel);
         dataset.end();

         dataset.begin(ReadWrite.READ);
         model = dataset.getDefaultModel();
         smallAssertions(model);
         dataset.end();
     }


        Andy

Reply via email to