|
Dear all,
I am working with several ontologies, but I am new to owlready. I can't wrap my head around the ways to assert a relation when the resources, particularly the property, are defined in a second or several other ontologies. The main way to assert a relation seems to be setting the attribute on the subject instance with the same name as the property. But how can I make sure that the property in the relation triple has the correct IRI?
"""Example: I am manipulating onto1 using ressources from onto2"""
onto1 = get_ontology(iri)
onto2 = get_ontology("file://...").load()
onto1.imported_ontologies.append(onto2)
with onto1:
simulator = onto2.Simulator_FSI("my_fsi") # no problem with individuals
sim = onto2.Structural_Mechanics_Simulation("my_sim")
# trying to assert triple (onto1.simulator, onto2.conductsSimulation, onto1.sim)
# but can't use "onto2." to access correct property, so gets a different attribute
simulator.conductsSimulation = [sim]
print(list(onto2.conductsSimulation.get_relations())) # prints []
Many thanks for ideas and clarification.
Best, Mo
|