creating an instance save my properties values as annotations

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

creating an instance save my properties values as annotations

alevray
Hi,

I'm trying to create an individual of a class which has properties
And I save the ontology in a new file. When I open it in Protege I realised my properties have not saved and instead, annotations have been created with the values of my properties.

Here is my code

with onto:
    c = Context('am', context_title = "Amelie Levray")

And context_title is a DataProperty, functional.

Thanks for your help,

Amélie
Reply | Threaded
Open this post in threaded view
|

Re: creating an instance save my properties values as annotations

Jiba
Administrator
Hi,

How do you created "context_title"? Is it in Python, or from a loaded ontology? If so, how was it defined in that ontology? In particular, RDF properties are not OWL properties, and are treated as annotations.

Finally, what do you mean by "annotations have been created"? Is it after exporting to RDF?

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: creating an instance save my properties values as annotations

alevray
Hi Jiba,

context_tile is created via Protege as a DataProperty
in the owl file it is written as:



    <owl:DatatypeProperty rdf:about="urn:absolute:DareKnowledgeBase#context_title">
        <rdfs:subPropertyOf rdf:resource="urn:absolute:DareKnowledgeBase#context_data_prop"/>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
        <rdfs:domain rdf:resource="urn:absolute:DareKnowledgeBase#Context"/>
        <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    </owl:DatatypeProperty>

In my python code I load this ontology and create an instance of the class Context with :

self.my_context = setting.DKB.namespace.Context(self.prefix)
setting.DKB.namespace.context_title[self.my_context].append(self.title)
setting.DKB.namespace.context_prefix[self.my_context].append(self.prefix)

And now after saving in another ontology rdf/xml file I have these lines added:

<Context rdf:about="#test1">
  <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
  <context_lastset rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</context_lastset>
  <context_prefix rdf:datatype="http://www.w3.org/2001/XMLSchema#string">test1</context_prefix>
  <context_title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Environment for basic tests</context_title>
</Context>

When I open it with Protege I can see that these are annotations not properties.
Am I misunderstanding something?



Thanks for your help.
Amélie



 
Reply | Threaded
Open this post in threaded view
|

Re: creating an instance save my properties values as annotations

alevray
Hi Jiba,

Nevermind, I think protege is just misreading the file as it seems to works perfectly fine when dealing with the saved file in owlready.

Cheers,
Amélie