Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
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/> . |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
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 |
Loading... |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Ok, thank very much Jiba!
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by Jiba
this tip didnt quite work for me (with version 0.26). I do get some triplets, but the namespaces seem mangled (I need multiple "non-owl" annotations, from dcterms, dc etc.) and the annotations are displayed in protege as instances?
One workaround that seems to be working (and could be adequate for some use cases) is to prepare these "non owl" annotations separately (say in protege in a file template.owl), load the file and work programmatically from then on. The interesting thing is that owlready does parse / does something with these namespaces / annotations. "xmlns:terms="http://purl.org/dc/terms/" is replaced by "xmlns:term="http://purl.org/dc/terms/" "xmlns:dc="http://purl.org/dc/elements/1.1/" becomes "xmlns:x_1.1="http://purl.org/dc/elements/1.1/" but when the updated ontology is saved this does not cause any problem (the annotations are still there) |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
Owlready changed the XMLNS name associated to the full IRI, however, WMLNS names are just abbreviation and have no impact in the semantics of the ontology. (This is why they are modified: Owlready does not store the original XMLNS in the quadstore since they are not quads).
Jiba |
Free forum by Nabble | Edit this page |