onto.metadata creator, publisher, date and license

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

onto.metadata creator, publisher, date and license

Olaf
Is it possible to add creator, publisher, date and license metadata to a new ontology through the onto.metadata interface?

example from http://linkeddatabook.com/editions/1.0/#htoc51

1 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3 @prefix owl: <http://www.w3.org/2002/07/owl#> .
4 @prefix dcterms: <http://purl.org/dc/terms/> .
5 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
6 @prefix cc: <http://creativecommons.org/ns#> .
7 @prefix prod: <http://biglynx.co.uk/vocab/productions#> .
8
9 <>
10   rdf:type owl:Ontology ;
11   rdfs:label "Big Lynx Productions Vocabulary" ;
12   dcterms:creator <http://biglynx.co.uk/people/nelly-jones> ;
13   dcterms:publisher <http://biglynx.co.uk/company.rdf#company> ;
14   dcterms:date "2010-10-31"^^xsd:date ;
15   cc:license <http://creativecommons.org/licenses/by-sa/3.0/> .
Reply | Threaded
Open this post in threaded view
|

Re: onto.metadata creator, publisher, date and license

Jiba
Administrator
Hi,

Adding those relations is not easy, for several reasons:

1) http://purl.org/dc/terms/ is in Turtle format, which is not understood by Owlready yet.

2) the creator, etc, properties are RDF properties and not OWL annotations.

Currently, Owlready works at the OWL level, but not at the RDF level (though I'm thinking about extending it to RDF). Consequently, it cannot use plain RDF properties like creator.

However, if you just need a few metadata properties, you can easily re-create them in a dummy ontology, as in the following example:


from owlready2 import *
   
with get_ontology("http://purl.org/dc/terms/"):
    class creator(AnnotationProperty): pass

onto = get_ontology("http://test.org/onto.owl")
   
with onto:
    my_creator = Thing("nelly-jones")
    onto.metadata.creator = my_creator


It will produce the expected RDF triple :

<http://test.org/onto.owl> <http://purl.org/dc/terms/creator> <http://test.org/onto.owl#nelly-jones> .

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: onto.metadata creator, publisher, date and license

Olaf
Ok, thank very much Jiba!