Duplicated Data Properties

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

Duplicated Data Properties

feknorr
Hello everyone,

as far as I have understand if there are two classes in two imported ontologies lets say class A in onto1 and onto2
I can still access those by using their corresponding namespaces: onto1.A or onto2.A respectively.

My problem is now that I have two data properties (has_name) that are already defined in my two imported ontologies
and when I create a new instance of onto2.A in my new ontology (onto), e.g.

my_inst = onto2.A(namespace=onto)

and want to use the data property has_name of onto2 as well it doesn't work:

my_inst.has_name = ["blabla"]

Instead the has_name data property of onto1 will be used.

So my question is, is there some possibility to add the information (i.e. the namespace) which data property should be used?

PS: I have also tried to use the python aliases, so:

onto1.has_name.python_name = "onto1name"
onto2.has_name.python_name = "onto2name"

which results in an error.

Thanks in advance

Felix
Reply | Threaded
Open this post in threaded view
|

Re: Duplicated Data Properties

Jiba
Administrator
Hi,

There are 2 solutions:

1) you can (or you should be able to) use Python alias.

I've just fixed a bug in Prop.python_name in the development version on BitBucket.


2) you can also use the following alternative syntax :

    onto2.has_name[my_inst]

Jiba
Reply | Threaded
Open this post in threaded view
|

Proposed solution works

feknorr
Hello Jiba,

thanks so much, I have tried your second proposed solution
and now everything works fine.

Felix