On 24/10/2021 15:16, Steve Vestal wrote:
I searched a bit for a way to declare a HasKey axiom.  Does this mean that is a futile exercise?

As Lorenz says, there is no API or reasoner support in Jena for OWL 2 so no there's no convenient API for declaring a HasKey axiom.

HasKey, like all OWL axioms, is expressed syntactically as just a set of RDF statements so you could manually create the correct triples using the RDF API which would allow you to create a model that you could export to other tools. However, there's no reasoner support in Jena itself for it.

Dave

On 10/24/2021 6:57 AM, Lorenz Buehmann wrote:
yeah, punning is a new feature of OWL 2, Jena does only support OWL 1 and some parts of OWL 2. Whether there is a workaround or room for a feature request, Dave Reynolds knows better for sure.

On 24.10.21 13:48, Martynas Jusevičius wrote:
Could this be the reason?
“ OWL DL includes all OWL language constructs with restrictions such as
type separation (a class can not also be an individual or property, a
property can not also be an individual or class).”

https://www.w3.org/TR/owl-guide/

On Sun, 24 Oct 2021 at 13.43, Steve Vestal <[email protected]>
wrote:

I omitted a detail that seems to be important.

                          //OntModel m = ModelFactory.createOntologyModel();
                          OntModel m =
ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
                          String uri = "http://ex.org/A";;
                          OntClass cls = m.createClass(uri);
                          cls.createIndividual(uri);
                          System.out.println("Test model " + uri);
                          m.write(System.out, "Turtle");

If I run the version without an OntModelSpec, it works.  If I run the
version with OntModelSpec.OWL_DL_MEM, then I get a ConversionException.
I am running Jena 3.17.  The Javadoc says the default is a "weak
reasoner."  I may be able to work around this in this one app, but I'm
wondering what will happen when the model is later loaded with another
choice of reasoner such as OWL_DL_MEM or Openllet.

On 10/20/2021 5:30 AM, Lorenz Buehmann wrote:
OntModel m = ModelFactory.createOntologyModel();
String uri = "http://ex.org/A";;
OntClass cls = m.createClass(uri);
cls.createIndividual(uri);
m.write(System.out, "Turtle");

Reply via email to