Object property assertion instead of Annotation assertion.

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

Object property assertion instead of Annotation assertion.

Christian
Owlready2
Protege 5.2.0

Hi, I'd like to create an Object property assertion instead of Annotation assertion.

Example:

<code>
from owlready2 import *
import os


namespace._LOG_LEVEL = 1
onto = onto_path.append("/home/cj/")
FILENAME = "/home/cj/test.owl"

if os.path.isfile(FILENAME):
    os.remove(FILENAME)
onto = get_ontology(FILENAME)


with onto:
    class A(Thing):
        pass

    class B(Thing):
        pass

    class isConnected(ObjectProperty):
        domain = [A]
        range = [B]
        pass

a_individual = A("a-individual")
b_individual = B("b-individual")
a_individual.isConnected.append(b_individual)
onto.save()
</code>

In Protege 5.2.0 it is shown as Annotation assertion.

What I am doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Object property assertion instead of Annotation assertion.

Jiba
Administrator
Hello,

I tested your program; the problem is the IRI of your ontology: the IRI must use the HTTP protocol.
Note that the ontology does not necessary need to be downloadable at this IRI: as long as a local copy is available, Owlready will not try to download it.
People usually use dummy IRI starting with http://test.org/

For example, your program works well using:

FILENAME = "http://test.org/test.owl"


Kind regards,
Jiba