Creating data property dynamically

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

Creating data property dynamically

Jui Guram
 
When I am trying to create data property dynamically like below.

with onto:
                ontology_data_property = types.new_class(tuple[0],(DataProperty,))

I get the following Error.

   return self.unabbreviate_d[storid]
KeyError: 'http://www.w3.org/2002/07/owl#DataProperty'


Regards,
Jui
Reply | Threaded
Open this post in threaded view
|

Re: Creating data property dynamically

Jiba
Administrator
Hi,

I tested the small program below, but without trouble.
Can you give me a (preferably small) code example that show the problems?

from owlready2 import *

onto = get_ontology("http://test/jiba.owl")

with onto:
    ontology_data_property = types.new_class("prop_name", (DataProperty,))

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13