Re: Adding a Named Individual to an Ontology via Plugin
Looks like you missed some parts
of my last sentence
So you can use the factory to create the
axioms (probably some OWLObjectPropertyAssertionAxiom ) you have
in mind and add those to the ontology via the manager.
Creating an individual does nothing. I mean, it doesn't say
anything and an ontology is about statements aka axioms. An OWL
ontology is made of axioms, so you have to create an axiom and add
it to the ontology. If you just want to say that there is an
individual, ok - but even then you have to create an axiom, in
that case a declaration axiom. But, the more common axiom for
individuals are indeed class assertions and property assertions.
Once you created the axiom, you have to add it to the ontology.
The OWLOntologyManager provides a method addAxiom
in addition to applyChange (AddAxiom
would be what you need here by the way)
I can create a
Named Individual object, given your suggested code below.
But as far as I
can tell this is an object separate from the ontology. I’ve
exported the data and the new individual is not there.
I would like to
add this object to the current ontology. I see the method:
OWLOntologyManager.applyChange(chg) but am not sure how/if
to use this method to do so.