TBox and multiple Aboxes

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

TBox and multiple Aboxes

moissinac
Hello
I'm newby with owlready2
It's not clear for me what is the best practice to use TBox and multiple ABoxes.
I have a TBox which describes my domain (classes Site, Takeoff, Landing). I have a lot of files; each one describes a site and it's related takeoffs and landings.
I'm loading the TBox with
barbulesXML = get_ontology("file://"+wd+"/ontologies/barbulesXML.owl").load()
then i'm loading the ABoxes with a loopon the files;  like this :
            place_ontology = get_ontology("file://" + path + entry.name).load()
            barbulesXML.imported_ontologies.append(place_ontology)
but I've trouble when accessing the properties of a site. Some properties seam to have the type ThingClass and the following loop fails on these properties
for prop in onto.mysite.get_properties():
     for value in prop[mysite]:
         print(".%s == %s" % (prop.python_name, value))
with the message
for value in prop[mysite]:
TypeError: 'ThingClass' object is not subscriptable
Any help?
Reply | Threaded
Open this post in threaded view
|

Re: TBox and multiple Aboxes

Jiba
Administrator
Hi,

Sorry for the long time for responding, I'm facing some personal problems :-(

You should load your TBox and ABoxes in separate ontologies, as you did.
I think the ABox should import the TBox, but your example does the contrary, is it normal ?

In the second part of the example, I assume that onto is an ontology (is it TBox or ABox ?).

Regarding properties that are ThingClass, are they punning entities? OWL theorically allows a class and a property to have the same IRI, but Owlready does not support that.

Jiba