[redland-dev] Parsing RDF

Ian Upright iupright at visualknowledge.com
Wed Dec 14 21:37:10 GMT 2005


In my storage model, essentially I store the 'source' field.  However, not
all of the ontologies are extracted directly from a URL.  Some are extracted
from a file, which is a copy of an ontology from a particular URL.  Other
times, a URL may provide an alias link to an ontology, but really the true
ontology or "namespace" is defined elsewhere.  Most ontologies define a
namespace, such as xmlns =
"http://www.w3.org/TR/2003/CR-owl-guide-20030818/food#" which indicates
which namespace (source) that these triples originated from.  However, I'm
not sure how this parser toolkit lets me extract the xmlns information so
that I may associate it with each triple to correctly declare the triple's
"source".

Are we saying that the definition of the "source" is not part of the OWL or
RDF spec, and that there really isn't any true meaning or declaration of
source in the RDF?  I'm not an expert on RDF or OWL at all, you people would
probably be far more knowledgeable than I.

Tools such as Protégé and SWOOP seem to have a very clear partitioning with
regards to a triple's source, and present the triples, classes, individuals,
properties, etc. clearly as belonging to a particular source.

So hence, this is where the confusion begins.

Ian

-----Original Message-----
From: Richard Newman [mailto:r.newman at reading.ac.uk] 
Sent: Wednesday, December 14, 2005 11:51 AM
To: Ian Upright
Cc: redland-dev at lists.librdf.org
Subject: Re: [redland-dev] Parsing RDF

> 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.

Triples do not "belong" to an ontology. It's better if you utterly  
forget about files; they aren't meaningful on the Semantic Web,  
really. It's one big graph. Likewise, there aren't really two  
"ontologies". It's one graph.

Redland, along with other RDF systems, often stores a 'source' field  
in a triple. If you really want to keep track of where a triple came  
from, then this is where to look. It's at the granularity of "from  
which URL was this triple retrieved?".

> 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.

"it seems"
Well, if you can't tell them apart, how on earth is an RDF store  
supposed to?

> 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.

You have a deep misunderstanding.

The Semantic Web is *just triples*. Forget about RDF/XML, it's just  
syntax. Dump your files into n-triples; this is the closest you'll  
get to the RDF model.

x p y
y p z
a r g

are *all* you have to work with, if you're operating wholly within RDF.

Notice that there is no concept of a containing ontology, or of a file.

So, the better question is -- why are you trying to figure out in  
which 'ontology' a triple 'belongs'?

-R




More information about the redland-dev mailing list