Trying to create triples between two instances, but...

Posted by Luis Antonio Rodriguez on
URL: http://owlready.306.s1.nabble.com/Trying-to-create-triples-between-two-instances-but-tp2900.html

Hi,

I'm trying to load an owl existent file and create new instances and triples between two instances using existent Object Properties.

My code:

from owlready2 import*

flight_plan_ontology = get_ontology("/home/rodriguez/Desktop/TesteAnimadoInserindoInstancias.owl")
flight_plan_ontology.load()

plano1 = flight_plan_ontology.Flight_Plan_BR("Plano_Teste")

flight_plan_ontology.save("/home/rodriguez/Desktop/TesteAnimadoInserindoInstancias.owl")

print(list(flight_plan_ontology.individuals()))# At this point "Plano_Teste" exists and appears when listing individuals

flight_plan_ontology.Plano_Teste.departureAirport = flight_plan_ontology.SBGL#trying to create a relationship between two #individuals : "Plano_Teste" and "SBGL" using the ObjProperty "departureAirport"

print(flight_plan_ontology.search(type = flight_plan_ontology.Flight_Plan_BR, departureAirport = flight_plan_ontology.SBGL))#trying to find the matching individual

print("%%%%%%%%")

Shell results presents all individuals including Plano_Teste but presents empty for the search method.

Why python doesn't create the relation : flight_plan_ontology.Plano_Teste.departureAirport = flight_plan_ontology.SBGL?

I've opened the ontology with Protegé and the triple is really not there.

What is happening?