Hi Roland,
Thank you very much! This info was a big help. Here is what I have found:
Multiple inheritance does indeed work (except for a problem with owl:maxCardinality, see below),
using both current version 5.0.1 and earlier version 4.8.3 (via the maven plugin, in both cases).
Whatever problem was in my way with it before is not there anymore, and that was probably some
misconfiguration or missed observations on my part. So, for the most part we are now in the
clear on this topic; hooray! I apologize for not testing more thoroughly before my first posting
to the list; I just had it in my mind somehow that this feature was broken, but I was wrong.
[I have not yet had a chance to actually *run* any Java application code using the multiple inheritance
feature, but I don't expect that to be an issue. If I find any problems, I will report them separately].
Thanks again for your clear and accurate description of the actual feature status. :-)
I did find one apparent RDFReactor code-generation bug related to multiple inheritance, however.
We often use owl:maxCardinality (with a value of 1) to mark the properties that should have no more
than one value. In general, this marking is correctly picked up by RDFReactor, and used to make
the method signatures appropriate for a single value (rather than the default collection-oriented
signatures). This feature appears to *almost* work properly in combination with multiple
inheritance. The generated method signatures are as expected. However, the generated code (in
the Java classes with extra patched-up fields+methods) is missing an import statement for the java
class:
org.ontoware.rdfreactor.runtime.CardinalityException.
...and this causes the generated Java code to not compile.
This problem occurs with both Semweb4j 5.0.1 and 4.8.3.
I set up a test project using Semweb4j 5.0.1. A static snapshot of the whole project, in a state
where it fails to compile, can be seen here:
https://www.assembla.com/code/friendularity/subversion/nodes/822/trunk/maven/org.friendularity.demo.sweb4jYou will see that it generates code from two separate variants of a single toy ontology.
The full ontology is called PhysicsTest_owl2.n3. It has lots of classes (about 40)
and uses lots of multiple inheritance, but is careful to avoid using owl:maxCardinality in
places where it could apply to a property that is inherited indirectly. The code generated
from this ontology compiles OK. I locally generate Javadoc from those classes to make it
easier to verify that all the fields are bound to all the classes I expect, and they are!
(Others who wish to experiment with multiple inheritance may want to look at this file and
the output code for themselves).
Then the owl:maxCardinality exception import problem is demonstrated by a second, smaller ontology
called PhysicsTest_brokenCard_owl2.n3. Here is a snapshot of the ontology file in its broken state:
https://www.assembla.com/code/friendularity/subversion/nodes/822/trunk/maven/org.friendularity.demo.sweb4j/src/test/resources/schemas/PhysicsTest_brokenCard_owl2.n3The code generation is broken by the assertion of owl:maxCardinality 1 on the two properties
:hasElementaryCharge
and :hasRestMassInGrams
I get 12 Java compile errors total, because the generated code for CompositeParticle.java,
Lepton.java and Positron.java are all missing the import statement
import org.ontoware.rdfreactor.runtime.CardinalityException;
...which in contrast is correctly included in Electron.java (because it is the domain for
:hasSimpleSingleValuedDataProp), so we get no compile errors in Electron.java.
This looks like a simple problem in the RDFReactor template rules that is only exposed under
the conditions described above and in the comments in the PhysicsTest_brokenCard_owl2.n3 ontology.
I am using JDK 1.7-update 72, Maven 3.0.5, on Windows 7(x64). The ontologies were edited using
Protege 4.3.0.
If the relevant template rule can be fixed in a future Semweb4J release, that would be great.
I will be happy to re-enter this information into a bug report if you think that is a good idea.
peace,
Stu