Browse the values ​​of a variable with Flask and Owlready

Posted by Barnabe on
URL: http://owlready.306.s1.nabble.com/Browse-the-values-of-a-variable-with-Flask-and-Owlready-tp2467.html

hi,
I would like to iterate through the values ​​of a variable which is supposed to contain the ids of a class.
Here are the steps :

from owlready2 import *
onto_path.append("Ontologie_v1")
onto = get_ontology("http://www.idexationsemantique.bf/index_semantique.owl")
onto.load()
onto.Personne.iri   gives out  "http://www.idexationsemantique.bf#Personne"
pers = onto.Personne()      #Gives an identifiant of name personne1
pers = onto.Personne()      #Gives an identifiant of name personne2

for s in pers2:
...     print(s)            

Gives out "TypeError: 'Personne' object is not iterable"


My final goal is to iterate through all the values ​​of data properties like in relational database and display them on my page

value = onto.personne1.possede = ["Loc"]
value = onto.personne2.possede = ["Mixte"]

Display all data properties through the variable "values" on my website page.

Any help will be welcome.
Thank you