Re: Assigning data and object properties to newly created individuals
Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/Assigning-data-and-object-properties-to-newly-created-individuals-tp2552p2559.html
Hi,
To set the property values, you can do:
sl = SoftwareLicense(newlicense['id'])
sl.url = newlicense["url"] # if the url property is functional
sl.url.append(newlicense["url"]) # if the url property is NOT functional
or :
setattr(sl, "url", newlicense["url"]) # if the url property is functional
getattr(sl, "url").append(newlicense["url"]) # if the url property is NOT functional
or :
onto.url[sl].append(newlicense["url"]) # same syntax whether if the url property is functional or not
You should also ensure that the url property exists.
Jiba