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.


 @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);
        smallAssertions(ontModel);
        dataset.end();

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

Reply via email to