Hummm... Not sure to be a model to follow, but below is my own approach to peuplate my ontology with Individuals :
"""
As I don't have resolvable namespace yet like
http://mydomain/.../myonto/, I use a base ontology using the local C:/path/to/local/ontologies/myonto.owl (and I'm using Stanford Protégé to describe the logic)
"""
onto = get_ontology('file://C:/path/to/local/ontologies/myonto.owl').load()
skos = get_ontology("
http://www.w3.org/2004/02/skos/core#").load()
onto.imported_ontologies.append(skos)
#I want to create individuals of
http://mydomain/.../myonto/MyClassMyClass = IRIS['
http://mydomain/.../myonto/MyClass']
with onto:
Individual1 = MyClass('MyClass/1') # thus creating
http://mydomain/.../myonto/MyClass/1 Individual
Individual1.label = 'My Class Individual 1' # giving a label to it
Individual1.prefLabel = 'a preferred label' # remember that skos:prefLabel id defined in SKOS !
Individual1.other = [something] # assuming namespace:other is not functional and already defined in myonto.owl or any imported ontology
Individual1.other.append(something else to add to other) # wanted to add another value to other property
#... and so on
# and saving the result as RDF/XML file (to open/inspect using Stanford Protégé for example)
onto.save(file='C:/path/to/local/ontologies/myonto.rdf', format='rdfxml')
But things could be different if you are more interested in creating the classes using owlready2
Hope this helps
Richard