On 01/12/11 10:23, Chris Dollin wrote:
I can not get the default namespace of a OntModel, the OntModel was got from
TDB with fuseki, and the code is below,
DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST);
Model o = du.getModel();
OntModel om = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM, o);
System.out.println( om.getNsPrefixURI(""));
in addition, I can only get four prefixmappings with om.getNsPrefixMap(), which
are {rdfs=http://www.w3.org/2000/01/rdf-schema#,
xsd=http://www.w3.org/2001/XMLSchema#, owl=http://www.w3.org/2002/07/owl#,
rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#}. But there are ten prefixes in
the model actually.
What do you mean by "actually"?
The prefix mappings of a model are those that come from prefix
declarations in the loaded model, ie xml namespace declarations
in RDF/XML or @prefix declarations in Turtle, or prefixes that have
been added by calls in your code.
If the original data didn't define prefixes, they won't be in your model
either.
Chris
(which version of Fuseki?)
Hi there,
You're getting the model over HTTP. This will transfer the triples but
may not have the prefixes depending on how you've stored it in Fuseki
(and version).
Are the prefixes in model o?
Andy