Thx guys for the quick response.
I will set the base and see what happens.
Regards,
Bruno
On 14-10-21 11:16 AM, Andy Seaborne wrote:
On 21/10/14 16:07, Jean-Marc Vanel wrote:
From 10000m heigth, a likely cause is an error in the prefix
product: .
I agree.
The data has relative URIs in it so it depends how and where you rad
the file.
(try using "riot" to parse your file and see the "Food" declarations
as full URIs).
Maybe setting XML base in the XML to the same a xmlns:product
Andy
Anyway, unless you have a special reason to use XML ,
it's better to use Turtle format all the way.
2014-10-21 16:53 GMT+02:00 Bruno Baloi <[email protected]>:
Hello,
I am new to Jena, and to the semantic space as well.
I am trying to build an application using Jena and I am encountering
some
issues.
I built the Ontology using the Ontology APIs. It all looks good, and
I can
use a reasoner to get information out.
I then generate the XML doc representing the Ontology. I can also use
Protege to visualize the ontology.
So far so good.
The problem comes when I try to use SPARQL. When i use the query "
?subject rdfs:subClassOf ?object " it works fine. However if i try
to use
something to the effect of: "?subject rdfs:subclassOf product:Food"
I get
nothing (I am trying to get all the classes that are subclasses of
Food),
and there are many subclasses of Food declared. I have attached the
generated XML Ontology.
If however I use OWL-DL (DL-Query in Protege) or in code, it works fine
i.e. I get the necessary subclasses.
So my question is what am I doing wrong ? Is the way the graph is
stored
in XML causing the problem for SPARQL, or am I misunderstanding the
way to
use the SPARQL query ?
Any insight or guidance would be greatly appreciated
regards,
Bruno
P.S. I had a look at the Wine ontology that is publicly available,
and I
noticed that in the XML doc, that Sub Classes are referred to by
"resource"
, whereas in the "Product" graph that I generate, they are referred
to by
"ID". Could that be a problem ? And if it is what do I need to use
in the
APIs to rectify this ?