You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by xh-zh <xh...@msn.cn> on 2011/12/06 02:06:14 UTC

prefixes problem about tdb

I test the tdb with multi cases, and there is nothing in the file prefixes.dat everytime. why?
the data about prefixes are stored in prefixes.dat, am I right?  

Re: prefixes problem about tdb

Posted by Chris Dollin <ch...@epimorphics.com>.
xh_zh said:

> First, when I load a model from TDB, I will need to get the
> baseURI of the model with OntModel.getNsPrefixURI(""),
> but I always get null. I can only get four prefixes of the model 
> with OntModel.getNsPrefixMapping(), which are rdfs, rdf, owl and xsd.

And what are the prefix declarations in the model you loaded into
TDB?

Chris

-- 
"You're down as expendable. You don't get a weapon."    /Dark Lord of Derkholm/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)

Re: prefixes problem about tdb

Posted by xh-zh <xh...@msn.cn>.
> Some things are not clear:
>   * Is the database empty at the start of the load?
yes,

>   * which version of TDB are you using?
I test with TDB 0.8.10, 0.80.11 and 0.9
>   * what OS are you running?
Redhat Linux 6.0

>   * is this 32 or 64 bit java?
32bit

I load the data by using the cmdline, tdbloader --loc=/home/tdb/ontology /home/timezone.owl

you can test with the timezone.owl, and with the code below the value of ns is null.

public SearchOntology2() {

String directory = "/home/Workspaces/zljDB";
// String directory = "/home/Workspaces/zljDB";
Dataset ds = TDBFactory.createDataset(directory);

model = ds.getDefaultModel();

OntModel ontmodel = ModelFactory.createOntologyModel(
OntModelSpec.OWL_DL_MEM_TRANS_INF, model);

String ns = ontmodel.getNsPrefixURI("");
}



--------------------------------------------------
From: "Andy Seaborne" <an...@apache.org>
Sent: Thursday, December 08, 2011 4:32 PM
To: <je...@incubator.apache.org>
Subject: Re: prefixes problem about tdb

> On 08/12/11 02:19, xh-zh wrote:
>> First, when I load a model from TDB, I will need to get the baseURI
>> of the model with OntModel.getNsPrefixURI(""), but I always get null.
>> I can only get four prefixes of the model with
>> OntModel.getNsPrefixMapping(), which are rdfs, rdf, owl and xsd.
>>
>> second, I read the source code of TDB, when it create the dataset or
>> graph, it does create the prefixes of the graph according to reading
>> the prefixes.dat, but the prefixes.dat is empty.
>>
>> finally, according to the source code of TDB, I did not find the code
>> about processing and storing the prefixes in my input file, such as
>> owl file and N3 file.  If TDB does processing the prefixes in the
>> input file while loading data, can you tell me which classes are
>> related?
> 
> I'm guessing its not storing them.  To investigate, I need a complete, 
> minimal example and until yesterday it has not been clear how you're 
> loading the base data.  The fact it's tdbloader is an important point; 
> Fuseki does not use it.
> 
> Some things are not clear:
>   * Is the database empty at the start of the load?
>   * which version of TDB are you using?
>   * what OS are you running?
>   * is this 32 or 64 bit java?
> 
> Andy
> 

Re: prefixes problem about tdb

Posted by Andy Seaborne <an...@apache.org>.
On 08/12/11 02:19, xh-zh wrote:
> First, when I load a model from TDB, I will need to get the baseURI
> of the model with OntModel.getNsPrefixURI(""), but I always get null.
> I can only get four prefixes of the model with
> OntModel.getNsPrefixMapping(), which are rdfs, rdf, owl and xsd.
>
> second, I read the source code of TDB, when it create the dataset or
> graph, it does create the prefixes of the graph according to reading
> the prefixes.dat, but the prefixes.dat is empty.
>
> finally, according to the source code of TDB, I did not find the code
> about processing and storing the prefixes in my input file, such as
> owl file and N3 file.  If TDB does processing the prefixes in the
> input file while loading data, can you tell me which classes are
> related?

I'm guessing its not storing them.  To investigate, I need a complete, 
minimal example and until yesterday it has not been clear how you're 
loading the base data.  The fact it's tdbloader is an important point; 
Fuseki does not use it.

Some things are not clear:
   * Is the database empty at the start of the load?
   * which version of TDB are you using?
   * what OS are you running?
   * is this 32 or 64 bit java?

	Andy

Re: prefixes problem about tdb

Posted by Dave Reynolds <da...@gmail.com>.
On Thu, 2011-12-08 at 10:19 +0800, xh-zh wrote: 
> First, when I load a model from TDB, I will need to get the baseURI of the model with OntModel.getNsPrefixURI(""), but I always get null. 

Just an aside but OntModel.getNsPrefixURI("") is not the baseURI of the
model it is the default namespace, they are not the same thing.

Dave



Re: prefixes problem about tdb

Posted by xh-zh <xh...@msn.cn>.
First, when I load a model from TDB, I will need to get the baseURI of the model with OntModel.getNsPrefixURI(""), but I always get null. I can only get four prefixes of the model with OntModel.getNsPrefixMapping(), which are rdfs, rdf, owl and xsd.

second, I read the source code of TDB, when it create the dataset or graph, it does create the prefixes of the graph according to reading the prefixes.dat, but the prefixes.dat is empty.

finally, according to the source code of TDB, I did not find the code about processing and storing the prefixes in my input file, such as owl file and N3 file.  If TDB does processing the prefixes in the input file while loading data, can you tell me which classes are related?



--------------------------------------------------
From: "Chris Dollin" <ch...@epimorphics.com>
Sent: Tuesday, December 06, 2011 11:21 PM
To: <je...@incubator.apache.org>
Subject: Re: prefixes problem about tdb

> xh-zh said:
> 
>> ok, I download timezone.owl from internet and then load it into tdb, with tdbloader --loc=/home/tdb/ontology /home/timezone.owl
>> 
>> the prefixes.dat in the /home/tdb/ontology/ are empty, why?  is it normal?
> 
> There are other prefix files than prefixes.dat; perhaps they live in there.
> 
> But anyway, /why do you care/? What matters isn't what's in what
> files, but whether the TDB model has the correct prefix mapping in
> it. You don't need to look at the TDB files to find the prefixes: just
> ask the model (or graph, if you're at the graph level).
> 
> Chris
> 
> -- 
> "I know it was late, but Mountjoy never bothers,                /Archer's Goon/
> so long as it's the full two thousand words."
> 
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
> Epimorphics Ltd. is a limited company registered in England (number 7016688)
> 

Re: prefixes problem about tdb

Posted by Chris Dollin <ch...@epimorphics.com>.
xh-zh said:

> ok, I download timezone.owl from internet and then load it into tdb, with tdbloader --loc=/home/tdb/ontology /home/timezone.owl
> 
> the prefixes.dat in the /home/tdb/ontology/ are empty, why?  is it normal?

There are other prefix files than prefixes.dat; perhaps they live in there.

But anyway, /why do you care/? What matters isn't what's in what
files, but whether the TDB model has the correct prefix mapping in
it. You don't need to look at the TDB files to find the prefixes: just
ask the model (or graph, if you're at the graph level).

Chris

-- 
"I know it was late, but Mountjoy never bothers,                /Archer's Goon/
 so long as it's the full two thousand words."

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)

Re: prefixes problem about tdb

Posted by xh-zh <xh...@msn.cn>.
ok, I download timezone.owl from internet and then load it into tdb, with tdbloader --loc=/home/tdb/ontology /home/timezone.owl

the prefixes.dat in the /home/tdb/ontology/ are empty, why?  is it normal?


--------------------------------------------------
From: "Andy Seaborne" <an...@apache.org>
Sent: Tuesday, December 06, 2011 8:30 PM
To: <je...@incubator.apache.org>
Subject: Re: prefixes problem about tdb

> On 06/12/11 01:06, xh-zh wrote:
>> I test the tdb with multi cases, and there is nothing in the file prefixes.dat everytime. why?
>> the data about prefixes are stored in prefixes.dat, am I right?
> 
> Please could you provide a complete, minimal example, please?  Some 
> might well be wrong but without some details it's hard to identify what.
> 
> Andy
> 

Re: prefixes problem about tdb

Posted by Andy Seaborne <an...@apache.org>.
On 06/12/11 01:06, xh-zh wrote:
> I test the tdb with multi cases, and there is nothing in the file prefixes.dat everytime. why?
> the data about prefixes are stored in prefixes.dat, am I right?

Please could you provide a complete, minimal example, please?  Some 
might well be wrong but without some details it's hard to identify what.

	Andy