Repository: apache/jena (java)

Issue:
ontapi: do not allow OntDisjoints with no items
### Version

5.2.0

### What happened?

this is bug, regression of 73699fc1b1268f97121d6e292dafdbd1849cd879 (the problem was found while running owlcs/ont-api tests)

When there is no items it is impossible to distinguish `OntDisjoint.ObjectProperties` and `OntDisjoint.DataProperties`, which currently leads to wrong situation when `OntDisjoint.DataProperties` treated as `OntDisjoint.ObjectProperties` (because the last one has more priority).
Moreover, such `OntDisjoint`s do not make sense, so there must be at least one element even for DL/FULL.

The test-case for catching problem:
```java
        var m = ModelFactory.createDefaultModel().setNsPrefixes(PrefixMapping.Standard);
        var p1 = m.createResource("p1", OWL.DatatypeProperty);
        var p2 = m.createResource("p2", OWL.DatatypeProperty);
        var d = m.createResource().addProperty(RDF.type, OWL.AllDisjointProperties);
        var list = m.createList(p1, p2);
        d.addProperty(OWL.members, list);

        var ont = OntModelFactory.createModel(m.getGraph());
        var actual1 = ont.ontObjects(OntDisjoint.DataProperties.class).toList();
        Assertions.assertEquals(1, actual1.size());

        var actual2 = ont.ontObjects(OntDisjoint.ObjectProperties.class).toList();
        Assertions.assertEquals(0, actual2.size());

        var actual3 = ont.ontObjects(OntDisjoint.class).toList();
        Assertions.assertEquals(1, actual3.size());
        Assertions.assertEquals(OntDisjoint.DataProperties.class, OntModels.getOntType(actual3.get(0)));
```

### Relevant output and stacktrace

_No response_

### Are you interested in making a pull request?

Yes

Pull request description:
GH-2783: [ontapi] do not allow OntDisjoints with no items
GitHub issue resolved #2783

Pull request Description:
do not allow `OntDisjoint`s with no items


----

 - [x] Tests are included.
 - [ ] Documentation change and updates are provided for the [Apache Jena website](https://github.com/apache/jena-site/)
 - [x] Commits have been squashed to remove intermediate development commit messages.
 - [x] Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the [Contributor's Agreement](https://www.apache.org/licenses/contributor-agreements.html).

----

See the [Apache Jena "Contributing" guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).


Patch:
diff --git a/jena-fuseki2/jena-fuseki-ui/yarn.lock b/jena-fuseki2/jena-fuseki-ui/yarn.lock
index d4f1aefb37..9f7ff53e12 100644
--- a/jena-fuseki2/jena-fuseki-ui/yarn.lock
+++ b/jena-fuseki2/jena-fuseki-ui/yarn.lock
@@ -551,9 +551,9 @@
   integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==
 
 "@eslint/js@^9.2.0":
-  version "9.12.0"
-  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.12.0.tgz#69ca3ca9fab9a808ec6d67b8f6edb156cbac91e1"
-  integrity sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==
+  version "9.13.0"
+  resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.13.0.tgz#c5f89bcd57eb54d5d4fa8b77693e9c28dc97e547"
+  integrity sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==
 
 "@fortawesome/fontawesome-common-types@6.6.0":
   version "6.6.0"
@@ -2830,9 +2830,9 @@ eslint-plugin-standard@^5.0.0:
   integrity sha512-eSIXPc9wBM4BrniMzJRBm2uoVuXz2EPa+NXPk2+itrVt+r5SbKFERx/IgrK/HmfjddyKVz2f+j+7gBRvu19xLg==
 
 eslint-plugin-vue@^9.17.0:
-  version "9.29.0"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.29.0.tgz#fa1d62a88c22102be4fb8c275929698a1aee4b04"
-  integrity sha512-hamyjrBhNH6Li6R1h1VF9KHfshJlKgKEg3ARbGTn72CMNDSMhWbgC7NdkRDEh25AFW+4SDATzyNM+3gWuZii8g==
+  version "9.29.1"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.29.1.tgz#1af4f81347734f3e62eee4ba898c025bc5457662"
+  integrity sha512-MH/MbVae4HV/tM8gKAVWMPJbYgW04CK7SuzYRrlNERpxbO0P3+Zdsa2oAcFBW6xNu7W6lIkGOsFAMCRTYmrlWQ==
   dependencies:
     "@eslint-community/eslint-utils" "^4.4.0"
     globals "^13.24.0"
@@ -5419,9 +5419,9 @@ safe-regex-test@^1.0.3:
   integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
 
 sass@^1.69.4:
-  version "1.79.5"
-  resolved "https://registry.yarnpkg.com/sass/-/sass-1.79.5.tgz#646c627601cd5f84c64f7b1485b9292a313efae4"
-  integrity sha512-W1h5kp6bdhqFh2tk3DsI771MoEJjvrSY/2ihJRJS4pjIyfJCw0nTsxqhnrUzaLMOJjFchj8rOvraI/YUVjtx5g==
+  version "1.80.3"
+  resolved "https://registry.yarnpkg.com/sass/-/sass-1.80.3.tgz#3f63dd527647d2b3de35f36acb971bda80517423"
+  integrity sha512-ptDWyVmDMVielpz/oWy3YP3nfs7LpJTHIJZboMVs8GEC9eUmtZTZhMHlTW98wY4aEorDfjN38+Wr/XjskFWcfA==
   dependencies:
     "@parcel/watcher" "^2.4.1"
     chokidar "^4.0.0"
diff --git a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
index 588fa3e26b..ad7bae3c94 100644
--- a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
+++ b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/OntGraphModelImpl.java
@@ -965,8 +965,10 @@ public class OntGraphModelImpl extends ModelCom implements OntModel, OntEnhGraph
 
     @Override
     public OntDisjoint.Classes createDisjointClasses(Collection<OntClass> classes) {
+        if (classes.isEmpty()) {
+            throw new IllegalArgumentException("Empty list is specified");
+        }
         checkType(OntDisjoint.Classes.class);
-        checkType(OntClass.IntersectionOf.class);
         return checkCreate(model ->
                 OntDisjointImpl.createDisjointClasses(model, classes.stream()), OntDisjoint.Classes.class
         );
@@ -974,6 +976,9 @@ public class OntGraphModelImpl extends ModelCom implements OntModel, OntEnhGraph
 
     @Override
     public OntDisjoint.Individuals createDifferentIndividuals(Collection<OntIndividual> individuals) {
+        if (individuals.isEmpty()) {
+            throw new IllegalArgumentException("Empty list is specified");
+        }
         checkType(OntDisjoint.Individuals.class);
         return checkCreate(model ->
                 OntDisjointImpl.createDifferentIndividuals(model, individuals.stream()), OntDisjoint.Individuals.class
@@ -982,6 +987,9 @@ public class OntGraphModelImpl extends ModelCom implements OntModel, OntEnhGraph
 
     @Override
     public OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties) {
+        if (properties.isEmpty()) {
+            throw new IllegalArgumentException("Empty list is specified");
+        }
         checkType(OntDisjoint.ObjectProperties.class);
         return checkCreate(model ->
                 OntDisjointImpl.createDisjointObjectProperties(model, properties.stream()), OntDisjoint.ObjectProperties.class
@@ -990,6 +998,9 @@ public class OntGraphModelImpl extends ModelCom implements OntModel, OntEnhGraph
 
     @Override
     public OntDisjoint.DataProperties createDisjointDataProperties(Collection<OntDataProperty> properties) {
+        if (properties.isEmpty()) {
+            throw new IllegalArgumentException("Empty list is specified");
+        }
         checkType(OntDisjoint.DataProperties.class);
         return checkCreate(model ->
                 OntDisjointImpl.createDisjointDataProperties(model, properties.stream()), OntDisjoint.DataProperties.class
diff --git a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OWL2ObjectFactories.java b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OWL2ObjectFactories.java
index d79b8ea209..fe4daf9772 100644
--- a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OWL2ObjectFactories.java
+++ b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OWL2ObjectFactories.java
@@ -785,16 +785,16 @@ public final class OWL2ObjectFactories {
             OntFacetRestriction.LangRange.class
     );
 
-    public static final EnhNodeFactory CLASSES_DISJOINT = OntDisjoints.createDisjointClassesFactory(0);
+    public static final EnhNodeFactory CLASSES_DISJOINT = OntDisjoints.createDisjointClassesFactory(1);
     public static final EnhNodeFactory EL_CLASSES_DISJOINT = OntDisjoints.createDisjointClassesFactory(2);
     public static final EnhNodeFactory QL_RL_CLASSES_DISJOINT = OntDisjoints.createQLRLDisjointClassesFactory();
     public static final Function<OntConfig, EnhNodeFactory> DIFFERENT_INDIVIDUALS_DISJOINT =
             OntDisjoints::createDLFullDifferentIndividualsFactory;
     public static final EnhNodeFactory EL_QL_RL_DIFFERENT_INDIVIDUALS_DISJOINT =
             OntDisjoints.createELQLRLDifferentIndividualsFactory();
-    public static final EnhNodeFactory OBJECT_PROPERTIES_DISJOINT = OntDisjoints.createDisjointObjectPropertiesFactory(0);
+    public static final EnhNodeFactory OBJECT_PROPERTIES_DISJOINT = OntDisjoints.createDisjointObjectPropertiesFactory(1);
     public static final EnhNodeFactory QL_RL_OBJECT_PROPERTIES_DISJOINT = OntDisjoints.createDisjointObjectPropertiesFactory(2);
-    public static final EnhNodeFactory DATA_PROPERTIES_DISJOINT = OntDisjoints.createDisjointDataPropertiesFactory(0);
+    public static final EnhNodeFactory DATA_PROPERTIES_DISJOINT = OntDisjoints.createDisjointDataPropertiesFactory(1);
     public static final EnhNodeFactory QL_RL_DATA_PROPERTIES_DISJOINT = OntDisjoints.createDisjointDataPropertiesFactory(2);
 
     public static final EnhNodeFactory ANY_PROPERTIES_DISJOINT = OntEnhNodeFactories.createFrom(
diff --git a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OntDisjoints.java b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OntDisjoints.java
index 8b6561a3be..421c74541b 100644
--- a/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OntDisjoints.java
+++ b/jena-ontapi/src/main/java/org/apache/jena/ontapi/impl/factories/OntDisjoints.java
@@ -68,7 +68,7 @@ final class OntDisjoints {
                 OWL2.AllDifferent,
                 OntIndividual.class,
                 it -> true,
-                0,
+                1,
                 predicates
         );
     }
diff --git a/pom.xml b/pom.xml
index ee04abc057..4ad88a55f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
     <ver.commons-fileupload>2.0.0-M2</ver.commons-fileupload>
 
     <ver.dexxcollection>0.7</ver.dexxcollection>
-    <ver.micrometer>1.13.5</ver.micrometer>
+    <ver.micrometer>1.13.6</ver.micrometer>
     <ver.roaringbitmap>1.3.0</ver.roaringbitmap>
 
     <!-- Testing -->
@@ -101,7 +101,7 @@
     <ver.junit5>5.11.2</ver.junit5>
     <ver.junit5-platform>1.10.2</ver.junit5-platform>
  
-    <ver.mockito>5.14.1</ver.mockito>
+    <ver.mockito>5.14.2</ver.mockito>
     <ver.awaitility>4.2.2</ver.awaitility>
     <ver.contract.tests>0.2.0</ver.contract.tests>
 


Test patch:
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelMiscTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelMiscTest.java
index fe11343c04..72cb0acf88 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelMiscTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelMiscTest.java
@@ -22,10 +22,14 @@ import org.apache.jena.graph.Graph;
 import org.apache.jena.graph.Triple;
 import org.apache.jena.ontapi.impl.GraphListenerBase;
 import org.apache.jena.ontapi.model.OntClass;
+import org.apache.jena.ontapi.model.OntDisjoint;
 import org.apache.jena.ontapi.model.OntModel;
+import org.apache.jena.ontapi.utils.OntModels;
 import org.apache.jena.rdf.model.Model;
 import org.apache.jena.rdf.model.ModelFactory;
 import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.shared.PrefixMapping;
+import org.apache.jena.vocabulary.OWL;
 import org.apache.jena.vocabulary.OWL2;
 import org.apache.jena.vocabulary.RDF;
 import org.junit.jupiter.api.Assertions;
@@ -99,4 +103,55 @@ public class OntModelMiscTest {
         Assertions.assertTrue(d.contains(d.createResource("http://ex2/B"), RDF.type, OWL2.Class));
     }
 
+    @Test
+    public void testOntDisjointProperties() {
+        var m = ModelFactory.createDefaultModel().setNsPrefixes(PrefixMapping.Standard);
+        var p1 = m.createResource("p1", OWL.DatatypeProperty);
+        var p2 = m.createResource("p2", OWL.DatatypeProperty);
+        var d = m.createResource().addProperty(RDF.type, OWL.AllDisjointProperties);
+        var list = m.createList(p1, p2);
+        d.addProperty(OWL.members, list);
+
+        var ont = OntModelFactory.createModel(m.getGraph());
+        var actual1 = ont.ontObjects(OntDisjoint.DataProperties.class).toList();
+        Assertions.assertEquals(1, actual1.size());
+
+        var actual2 = ont.ontObjects(OntDisjoint.ObjectProperties.class).toList();
+        Assertions.assertEquals(0, actual2.size());
+
+        var actual3 = ont.ontObjects(OntDisjoint.class).toList();
+        Assertions.assertEquals(1, actual3.size());
+        Assertions.assertEquals(OntDisjoint.DataProperties.class, OntModels.getOntType(actual3.get(0)));
+
+        Assertions.assertThrows(IllegalArgumentException.class, ont::createDisjointObjectProperties);
+        Assertions.assertThrows(IllegalArgumentException.class, ont::createDisjointDataProperties);
+    }
+
+    @Test
+    public void testOntDisjointClasses() {
+        var m = ModelFactory.createDefaultModel().setNsPrefixes(PrefixMapping.Standard);
+        var d = m.createResource().addProperty(RDF.type, OWL.AllDisjointClasses);
+        var list = m.createList();
+        d.addProperty(OWL.members, list);
+
+        var ont = OntModelFactory.createModel(m.getGraph());
+        var actual1 = ont.ontObjects(OntDisjoint.Classes.class).toList();
+        Assertions.assertEquals(0, actual1.size());
+
+        Assertions.assertThrows(IllegalArgumentException.class, ont::createDisjointClasses);
+    }
+
+    @Test
+    public void testOntDisjointIndividuals() {
+        var m = ModelFactory.createDefaultModel().setNsPrefixes(PrefixMapping.Standard);
+        var d = m.createResource().addProperty(RDF.type, OWL.AllDifferent);
+        var list = m.createList();
+        d.addProperty(OWL.members, list);
+
+        var ont = OntModelFactory.createModel(m.getGraph());
+        var actual1 = ont.ontObjects(OntDisjoint.Individuals.class).toList();
+        Assertions.assertEquals(0, actual1.size());
+
+        Assertions.assertThrows(IllegalArgumentException.class, ont::createDifferentIndividuals);
+    }
 }
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL1SpecsTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL1SpecsTest.java
index c2ad938e31..eec304b72f 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL1SpecsTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL1SpecsTest.java
@@ -189,21 +189,24 @@ public class OntModelOWL1SpecsTest {
         OntModel m = OntModelFactory.createModel(spec.inst);
         OntIndividual i1 = m.getOWLThing().createIndividual("A");
         OntIndividual i2 = m.getOWLThing().createIndividual("B");
+        OntClass c1 = m.createOntClass("C");
+        OntDataProperty p1 = m.createDataProperty("p1");
+        OntObjectProperty p2 = m.createObjectProperty("p2");
         OntDisjoint.Individuals d = m.createDifferentIndividuals(i1, i2);
         Assertions.assertEquals(
                 List.of("A", "B"),
                 d.members().map(Resource::getURI).sorted().collect(Collectors.toList())
         );
 
-        Assertions.assertEquals(8, m.statements().count());
+        Assertions.assertEquals(11, m.statements().count());
         Assertions.assertEquals(1, m.ontObjects(OntDisjoint.Individuals.class).count());
         Assertions.assertEquals(1, m.ontObjects(OntDisjoint.class).count());
 
-        Assertions.assertThrows(OntJenaException.Unsupported.class, m::createDisjointClasses);
-        Assertions.assertThrows(OntJenaException.Unsupported.class, m::createDisjointDataProperties);
-        Assertions.assertThrows(OntJenaException.Unsupported.class, m::createDisjointObjectProperties);
+        Assertions.assertThrows(OntJenaException.Unsupported.class, () -> m.createDisjointClasses(c1));
+        Assertions.assertThrows(OntJenaException.Unsupported.class, () -> m.createDisjointDataProperties(p1));
+        Assertions.assertThrows(OntJenaException.Unsupported.class, () -> m.createDisjointObjectProperties(p2));
 
-        Assertions.assertEquals(8, m.statements().count());
+        Assertions.assertEquals(11, m.statements().count());
         Assertions.assertEquals(1, m.ontObjects(OntDisjoint.Individuals.class).count());
         Assertions.assertEquals(1, m.ontObjects(OntDisjoint.class).count());
     }
@@ -244,6 +247,7 @@ public class OntModelOWL1SpecsTest {
     @ParameterizedTest
     @EnumSource(names = {
             "OWL1_MEM",
+            "OWL1_DL_MEM",
             "OWL1_LITE_MEM",
     })
     public void testDisabledFeaturesOWL1(TestSpec spec) {
@@ -259,7 +263,7 @@ public class OntModelOWL1SpecsTest {
                 );
         d.createDataProperty("dp1").addEquivalentProperty(d.createDataProperty("dp2"));
 
-        OntModel m = OntModelFactory.createModel(d.getGraph(), OntSpecification.OWL1_DL_MEM);
+        OntModel m = OntModelFactory.createModel(d.getGraph(), spec.inst);
         OntClass.Named x = m.getOntClass("X");
         OntClass.Named q = m.createOntClass("Q");
         OntDataProperty dp1 = m.createDataProperty("dp1");
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2ELSpecTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2ELSpecTest.java
index d7edeaa0a4..4948dc388b 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2ELSpecTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2ELSpecTest.java
@@ -316,7 +316,9 @@ public class OntModelOWL2ELSpecTest {
     public void testDifferentIndividuals(TestSpec spec) {
         OntModel data = OntModelFactory.createModel();
         data.createDifferentIndividuals(data.createIndividual("a"));
-        data.createDifferentIndividuals();
+        data.createResource()
+                .addProperty(RDF.type, OWL2.AllDifferent)
+                .addProperty(OWL2.members, data.createList());
         data.createDifferentIndividuals(data.createIndividual("b"), data.createIndividual("c"));
 
         OntModel m = OntModelFactory.createModel(data.getGraph(), spec.inst);
@@ -348,7 +350,9 @@ public class OntModelOWL2ELSpecTest {
     public void testDisjointClasses(TestSpec spec) {
         OntModel data = OntModelFactory.createModel();
         data.createDisjointClasses(data.createOntClass("a"));
-        data.createDisjointClasses();
+        data.createResource()
+                .addProperty(RDF.type, OWL2.AllDisjointClasses)
+                .addProperty(OWL2.members, data.createList());
         data.createDisjointClasses(data.createOntClass("b"), data.createOntClass("c"));
 
         OntModel m = OntModelFactory.createModel(data.getGraph(), spec.inst);
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2QLSpecTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2QLSpecTest.java
index 5001096a61..e15b612634 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2QLSpecTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2QLSpecTest.java
@@ -441,7 +441,9 @@ public class OntModelOWL2QLSpecTest {
     public void testDisjointDataProperties(TestSpec spec) {
         OntModel data = OntModelFactory.createModel();
         data.createDisjointDataProperties(data.createDataProperty("a"));
-        data.createDisjointDataProperties();
+        data.createResource()
+                .addProperty(RDF.type, OWL2.AllDisjointProperties)
+                .addProperty(OWL2.members, data.createList());
         data.createDisjointDataProperties(data.createDataProperty("b"), data.createDataProperty("c"));
 
         OntModel m = OntModelFactory.createModel(data.getGraph(), spec.inst);
diff --git a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2RLSpecTest.java b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2RLSpecTest.java
index 04ff59dcdb..1f9a1584df 100644
--- a/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2RLSpecTest.java
+++ b/jena-ontapi/src/test/java/org/apache/jena/ontapi/OntModelOWL2RLSpecTest.java
@@ -644,7 +644,9 @@ public class OntModelOWL2RLSpecTest {
     public void testDisjointObjectProperties(TestSpec spec) {
         OntModel data = OntModelFactory.createModel();
         data.createDisjointObjectProperties(data.createObjectProperty("a"));
-        data.createDisjointObjectProperties();
+        data.createResource()
+                .addProperty(RDF.type, OWL2.AllDisjointProperties)
+                .addProperty(OWL2.members, data.createList());
         data.createDisjointObjectProperties(data.createObjectProperty("b"), data.createObjectProperty("c"));
 
         OntModel m = OntModelFactory.createModel(data.getGraph(), spec.inst);