pythondatabaseowlontologyowlready

How do I assimilate to an individual the same data property n times


For example, I have the data property "name" in my ontology and I want to assimilate to an individual more than one data property "name".

onto = get_ontology("teste.owl").load()
for line in list:
    individual = onto.Class('individuo1')
    individual.nome = [line['name']]

I do this and it doesn't work and creates just one data property with the last value in the list.


Solution

  • Instead of:

    individual.name = [line['name']]
    

    try:

    individual.name = []
    

    and then, in each iteration:

    individual.name.append([line['name'])