I mean the TDB will convert the owl file into n-triples defaultly, and then store the triples, even I load from owl file. I also convert my owl file into N3 format, and the prefixes do exist in the N3 file. But when I load the N3 file into TDB, and then create OntModel from TDB, the prefixes would be also lost.
below is the head of my N3 file: @prefix : <http://www.bjut.edu.cn/ontology/2011/10/esgrid.owl#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix esesgrid: <http://www.bjut.edu.cn/ontologies/esesgrid.owl#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix AccessControl: <http://www.bjut.edu.cn/ontologies/AccessControl.owl#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owlapi: <http://www.semanticweb.org/owlapi#> . @prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> . @prefix esgrid: <http://www.bjut.edu.cn/ontology/2011/10/esgrid.owl#> . …… i load this N3 file into TDB, and then create OntModel from TDB. i can only get four prefixes with OntModel.getNsPrefixURI() -------------------------------------------------- From: "Andy Seaborne" <[email protected]> Sent: Monday, December 05, 2011 5:59 PM To: <[email protected]> Subject: Re: a problem about TDB > On 05/12/11 09:34, xh-zh wrote: >> because I need to store the owl file into TDB, and then the prefixes >> would be lost when I create the OntModel form tdb. I read the source >> code of TDB, it convert all the formats of rdf data into n-triples, >> the there was no source code dealing with the prefixes when TDB load >> a owl file. is it right? > > You don't have to load from N-triples. If you load from a format with > prefixes, then they should be around. > > Or load a file (i.e. Turtle) with the prefixes in as well as the N-triples. > > Andy > > >
