[Xesam] packaging problem

Sebastian Trüg strueg at mandriva.com
Wed Jul 1 08:51:37 PDT 2009


On Wednesday 01 July 2009 17:02:16 Ivan Frade wrote:
> > - Using :metadata and :ontology is not correct. The graphs are described
> > in the metadata file in the statement:
> >     ?metadataGraph nrl:coreGraphMetadataFor ?ontologyGraph
>
> Not sure i get what do you mean. ":ontology" should be the "ontology" URI ?
> we dont have that information in the ontology itself. Should it be a
> different parameter? Can you explain it with an example?

Sorry, sure.

In Nepomuk we defined the NRL ontology. The most important things we use from 
it are cardinalities and named graphs. The latter are typed, most importantly 
nrl:GraphMetadata, nrl:Ontology, and nrl:InstanceBase.
nrl:GraphMetadata described graphs that contains statements describing 
metadata about other named graphs.
nrl:Ontology described graphs that contain the statements that make up an 
ontology.
nrl:InstanceBase describes graphs that contain all other information, i.e. 
instances.
There are a few more but IMHO mostly to build a smooth theory around the rest. 
IN any case, understanding those three is enough for most cases.

Now the metadata graph (the one stored in the second file) contains all the 
statements that state metadata about the ontology. An example is the metadata 
graph for NAO:

<http://www.semanticdesktop.org/ontologies/2007/08/15/nao>
    nao:hasDefaultNamespace 
"http://www.semanticdesktop.org/ontologies/2007/08/15/nao#" ;
    nao:hasDefaultNamespaceAbbreviation "nao" ;
    nao:lastModified "2008-09-03T18:34:34.881Z" ;
    nao:serializationLanguage "TriG" ;
    nao:status "Unstable" ;
    nao:version "2" ;
    nrl:updatable "0" ;
    a nrl:DocumentGraph, nrl:Ontology .

<http://www.semanticdesktop.org/ontologies/2007/08/15/nao/metadata>
    nrl:coreGraphMetadataFor 
<http://www.semanticdesktop.org/ontologies/2007/08/15/nao> ;
    a nrl:GraphMetadata .

As you can see there is information about NAO itself and the basic information 
about the metadata graph (since we need a type and a relation to the ontology 
graph).
The statement I mentioned before is the second from the bottom: it contains 
the URIs for both named graphs and as such is the best place to extract them. 
I figure it can be done with a nice regexp...

Thus, the end result should look like this:

@prefix ....

<http://www.semanticdesktop.org/ontologies/2007/08/15/nao> {
  -- all ontology statements from the first file --
}

<http://www.semanticdesktop.org/ontologies/2007/08/15/nao/metadata> {
  -- all metadata statements from the second file --
}

Hope this helps understanding the issue.

Thanks a lot for lending your scripting skills,
Sebastian


More information about the Xesam mailing list