@@ -199,11 +199,6 @@ public final Collection<A> splitToAnnotatedPairs() {
199
199
return walkPairwise ((a , b ) -> createAxiom (a , b , annotations ));
200
200
}
201
201
202
- @ Override
203
- public final boolean canContainAnnotationProperties () {
204
- return isAnnotated ();
205
- }
206
-
207
202
/**
208
203
* Answers {@code true} if the given axiom has mirror triple.
209
204
*
@@ -245,6 +240,11 @@ boolean testSameContent(ONTStatementImpl other) {
245
240
protected <T > Stream <T > fromPairs (OWLPairwiseVisitor <T , M > visitor ) {
246
241
return OWLAPIStreamUtils .allPairs (operands ()).map (v -> visitor .visit (v .i , v .j )).filter (Objects ::nonNull );
247
242
}
243
+
244
+ @ Override
245
+ public final boolean canContainAnnotationProperties () {
246
+ return isAnnotated ();
247
+ }
248
248
}
249
249
250
250
/**
@@ -357,6 +357,37 @@ public Object toContentItem(ONTObject x) {
357
357
}
358
358
}
359
359
360
+ /**
361
+ * An abstract {@link OWLNaryPropertyAxiom} implementation for member-type {@link OWLObjectPropertyExpression}.
362
+ *
363
+ * @param <A> either {@link OWLEquivalentObjectPropertiesAxiom} or {@link OWLDisjointObjectPropertiesAxiom}
364
+ */
365
+ @ SuppressWarnings ("WeakerAccess" )
366
+ protected abstract static class ObjectPropertyNaryAxiomImpl <A extends OWLNaryPropertyAxiom <OWLObjectPropertyExpression >>
367
+ extends PropertyNaryAxiomImpl <A , OWLObjectPropertyExpression > {
368
+
369
+ protected ObjectPropertyNaryAxiomImpl (Object subject , String predicate , Object object , Supplier <OntGraphModel > m ) {
370
+ super (subject , predicate , object , m );
371
+ }
372
+
373
+ @ Override
374
+ public ExtendedIterator <ONTObject <? extends OWLObjectPropertyExpression >> listONTComponents (OntStatement statement ,
375
+ InternalObjectFactory factory ) {
376
+ return Iter .of (factory .getProperty (statement .getSubject (OntOPE .class )),
377
+ factory .getProperty (statement .getObject (OntOPE .class )));
378
+ }
379
+
380
+ @ Override
381
+ public ONTObject <? extends OWLObjectPropertyExpression > findByURI (String uri , InternalObjectFactory factory ) {
382
+ return ONTObjectPropertyImpl .find (uri , factory , model );
383
+ }
384
+
385
+ @ Override
386
+ public final boolean canContainDataProperties () {
387
+ return false ;
388
+ }
389
+ }
390
+
360
391
/**
361
392
* An abstraction, that combines common properties for {@link OWLNaryIndividualAxiom} and {@link OWLNaryClassAxiom}.
362
393
*
@@ -386,4 +417,54 @@ public Collection<OWLSubClassOfAxiom> asOWLSubClassOfAxioms() {
386
417
return walkAllPairwise ((a , b ) -> createSubClassOf (eraseModel (a ), eraseModel (b )));
387
418
}
388
419
}
420
+
421
+ /**
422
+ * An abstract {@link OWLNaryPropertyAxiom} implementation.
423
+ *
424
+ * @param <A> subtype of {@link OWLNaryPropertyAxiom}
425
+ * @param <P> subtype of {@link OWLPropertyExpression}
426
+ */
427
+ abstract static class PropertyNaryAxiomImpl <A extends OWLNaryPropertyAxiom <P >, P extends OWLPropertyExpression >
428
+ extends NaryAxiomImpl <A , P > implements OWLNaryPropertyAxiom <P > {
429
+
430
+ PropertyNaryAxiomImpl (Object subject , String predicate , Object object , Supplier <OntGraphModel > m ) {
431
+ super (subject , predicate , object , m );
432
+ }
433
+
434
+ @ Override
435
+ public Stream <P > properties () {
436
+ return sorted ().map (ONTObject ::getOWLObject );
437
+ }
438
+
439
+ @ SuppressWarnings ({"unchecked" , "NullableProblems" })
440
+ @ Override
441
+ public Set <P > getPropertiesMinus (P property ) {
442
+ return getSetMinus (property );
443
+ }
444
+
445
+ @ Override
446
+ public final boolean canContainNamedClasses () {
447
+ return false ;
448
+ }
449
+
450
+ @ Override
451
+ public final boolean canContainClassExpressions () {
452
+ return false ;
453
+ }
454
+
455
+ @ Override
456
+ public final boolean canContainNamedIndividuals () {
457
+ return false ;
458
+ }
459
+
460
+ @ Override
461
+ public final boolean canContainDatatypes () {
462
+ return isAnnotated ();
463
+ }
464
+
465
+ @ Override
466
+ public final boolean canContainAnonymousIndividuals () {
467
+ return isAnnotated ();
468
+ }
469
+ }
389
470
}
0 commit comments