Hi everyone,
I'm using owlready2 for manipulating
foaf:Person individuals in my application.
These individuals have a namespace which is specific to my application and hence different from the foaf namespace.
When I try to retrieve a
foaf:Person person = onto.search_one(type=Person, iri=my_person_iri_with_a_non_foaf_namespace)
I get a None type object. Therefore, I remove the type filter:
person = onto.search_one(iri=my_person_iri_with_a_non_foaf_namespace)
which gives me the individual I'm looking for. Then I change some of its attributes:
person.firstName = "John" [and] person.lastName = "Doe"
Finally, I try to save the ontology
onto.save()
But the changes in attributes values are not persisted.
I noticed that removing the
type filter in the
search_one() function I end up with an
owl:Thing individual.
Therefore, I tried to cast the
owl:Thing individual to a
foaf:Person with
contributor.__class__ = Person
But here again I can't persist the edited attributes values.
Any idea?
Thanks for your help!
Anthony