I have stumbled upon another problem...
I want to achieve something similar to this:
I wanted to do so using RDFList, adding the necessary properties in to the list and then call method createUnionClass (or createIntersectionClass) and combine it together. Then, the result of this method would be added to particular ontClass with addSuperClass().
Is this wrong? I have started with something really simple, like:
RDFList rdfList = ontModel.createList();
rdfList.addProperty(ExampleResource1);
rdfList.addProperty(ExampleResource2);
UnionClass uc = ontModel.createUnionClass(null, rdfList);
ExampleClass.addSuperClass(uc);
But the result was not the subClassOf the union of both stated before, but only subClassOf nil.
Any help would be appreciated.
Creating this in Jena is a little bit tricky because support for the qualified cardinality restrictions is an OWL2 feature, and Jena has limited support for OWL2:
You might also see response that I posted to the Jena mailing list about a similar question, Re: Owl maxCardinality restriction.
You can come pretty close with the following Java code, though.
3.
is the code that we'd like to be able to write, but we end up having to use3a.
instead. You could go and start digging around in RDF serialization and thereby get yourself a genuine qualified restriction. I've shown how you can do that in a related question: How to add qualified cardinality in JENA.Output:
Loaded into Protégé: