[redland-dev] Parsing RDF

Ian Upright iupright at visualknowledge.com
Wed Dec 14 19:31:03 GMT 2005


Hi Benno,

Perhaps I should explain myself a little clearer.  Lets suppose that we had
two ontology definitions in a single RDF file.  Some of the triples would
belong to one ontology and some of the triples would belong to the other
ontology.  What is the correct way of determining what triples belong to
which ontology?  Sometimes it seems there are multiple definitions of
ontologies in the same RDF file, so I'm not certain that the last one is
always the one that should be used as the overall context for the triples.
Also, since the Ontology definition
(http://www.w3.org/1999/02/22-rdf-syntax-ns#type) usually comes last, I'm
not sure how I can determine what ontology the triples reside in (to set the
context) without doing 2 passes of the RDF file.  I would have thought that
the ontology definition would come first, and then I would immediately set
that as the context, but it appears like the parser is actually parsing the
file in reverse, from the end to the beginning??  Clearly there is some
concept I am missing, or I have a deep misunderstanding of something.

Ian

-----Original Message-----
From: Benno Blumenthal [mailto:benno at iri.columbia.edu] 
Sent: Tuesday, December 13, 2005 7:06 PM
To: Ian Upright
Subject: Re: [redland-dev] Parsing RDF

Ian Upright wrote:

> Hello, I am using the Raptor parser to parse an OWL file, by using 
> librdf_parser_parse_as_stream.
>
> When I have an anonymous resource such as r1r417, what is the correct 
> means of determining what Ontology that statement belongs to?
>
> For example, the very last statement always seems to be something like:
>
> http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine
>
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
>
> http://www.w3.org/2002/07/owl#Ontology
>
> So by this do I know that all the restrictions and such in this file 
> belong to http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine because 
> it is the last statement? Or is there some more correct way of 
> determining this that I am missing? I assume, that an ontology can 
> extend another ontology, so there must be a way of easily determining 
> what ontology is in context.
>
> Hopefully I've made myself clear.
>
> Thanks, Ian
>
>  
>
If you set the context when you store the triples, you can query by 
context (assuming the storage that you are using supports context). Or 
am I missing your point?

Benno





More information about the redland-dev mailing list