All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.avicomp.ontapi.jena.model.OntOPE Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
/*
 * This file is part of the ONT API.
 * The contents of this file are subject to the LGPL License, Version 3.0.
 * Copyright (c) 2019, Avicomp Services, AO
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program.  If not, see http://www.gnu.org/licenses/.
 *
 * Alternatively, the contents of this file may be used under the terms of the Apache License, Version 2.0 in which case, the provisions of the Apache License Version 2.0 are applicable instead of those above.
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 */

package ru.avicomp.ontapi.jena.model;

import org.apache.jena.rdf.model.Literal;
import org.apache.jena.rdf.model.RDFList;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.vocabulary.RDFS;
import ru.avicomp.ontapi.jena.OntJenaException;
import ru.avicomp.ontapi.jena.vocabulary.OWL;
import ru.avicomp.ontapi.jena.vocabulary.RDF;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * A common interface for any Ontology Object Property Expression.
 * In OWL2 there are two types of object property expressions:
 * named object property (entity) and InverseOf anonymous property expression.
 * Range values for this property expression are restricted to individuals
 * (as distinct from datatype valued {@link OntNDP properties}).
 * 

* Created by @szuev on 08.11.2016. */ public interface OntOPE extends OntDOP { /** * {@inheritDoc} * Note: a {@code PropertyChain} is not included into consideration: * even this property is a member of some chain ({@code P owl:propertyChainAxiom ( P1 ... Pn )}, * where {@code Pj} is this property), it does not mean it has the same super property ({@code P}). * * @return distinct {@code Stream} of object property expressions * @see #propertyChains() * @since 1.4.0 */ @Override Stream superProperties(boolean direct); /** * {@inheritDoc} * Note: a {@code PropertyChain} is not included into consideration, * even this property is a super property of some chain ({@code P owl:propertyChainAxiom ( P1 ... Pn )}, * where {@code P} is this property), each of chain members is not considered as sub property of this property. * * @return distinct {@code Stream} of object property expressions * @see #propertyChains() * @since 1.4.0 */ @Override Stream subProperties(boolean direct); /** * Returns a {@code Stream} over all property chain {@link OntList ontology list}s * that are attached to this Object Property Expression * on the predicate {@link OWL#propertyChainAxiom owl:propertyChainAxiom}. * * @return {@code Stream} of {@link OntList}s with generic-parameter {@code OntOPE} * @since 1.3.0 */ Stream> propertyChains(); /** * Adds a negative property assertion ontology object. * * @param source {@link OntIndividual} * @param target {@link OntIndividual} * @return {@link OntNPA.ObjectAssertion} * @see OntNDP#addNegativeAssertion(OntIndividual, Literal) */ OntNPA.ObjectAssertion addNegativeAssertion(OntIndividual source, OntIndividual target); /** * Creates a property chain logical constructions * as a {@link OntList ontology []-list} of {@link OntOPE Object Property Expression}s * that is attached to this Object Property Expression * at object positions with the predicate {@link OWL#propertyChainAxiom owl:propertyChainAxiom}. * The resulting rdf-list will consist of all the elements of the specified collection * in the given order with the possibility of duplication. * Note: Any {@code null}s in collection will cause {@link OntJenaException.IllegalArgument exception}. * * @param properties {@link Collection} (preferably {@link List}) of {@link OntOPE object property expression}s * @return {@link OntList} of {@link OntOPE}s * @see 9.2.1 Object Subproperties * @see #addPropertyChainAxiomStatement(Collection) * @see #addPropertyChain(Collection) * @see #propertyChains() * @see #findPropertyChain(RDFNode) * @since 1.3.0 */ OntList createPropertyChain(Collection properties); /** * Deletes the given property chain list including all its annotations. * * @param list {@link Resource} can be {@link OntList} or {@link RDFList} * @return this instance to allow cascading calls * @throws OntJenaException if in the whole graph there is no property chain with the specified []-list * @see #clearPropertyChains() * @see #createPropertyChain(Collection) * @since 1.3.0 */ OntOPE removePropertyChain(Resource list) throws OntJenaException; /** * Returns all ranges. * The statement pattern is {@code P rdfs:range C}, where {@code P} is this object property, * and {@code C} is one of the return class expressions. * * @return {@code Stream} of {@link OntCE}s * @since 1.4.0 */ @Override default Stream ranges() { return objects(RDFS.range, OntCE.class); } /** * Lists all direct super properties, the pattern is {@code P1 rdfs:subPropertyOf P2}. * * @return {@code Stream} of {@link OntOPE}s * @see #addSuperProperty(OntOPE) * @see OntPE#removeSuperProperty(Resource) * @see OntPE#superProperties(boolean) * @see #propertyChains() * @since 1.4.0 */ @Override default Stream superProperties() { return objects(RDFS.subPropertyOf, OntOPE.class); } /** * Returns disjoint properties (statement: {@code P1 owl:propertyDisjointWith P2}). * * @return {@code Stream} of {@link OntOPE}s * @see OntNDP#disjointProperties() * @see OntDisjoint.ObjectProperties * @since 1.4.0 */ @Override default Stream disjointProperties() { return objects(OWL.propertyDisjointWith, OntOPE.class); } /** * Returns all equivalent object properties * (i.e. {@code Pi owl:equivalentProperty Pj}, where {@code Pi} - this property). * * @return {@code Stream} of {@link OntOPE}s. * @see OntNDP#equivalentProperties() * @since 1.4.0 */ @Override default Stream equivalentProperties() { return objects(OWL.equivalentProperty, OntOPE.class); } /** * Lists all object properties from the right part of the statement {@code _:this owl:inverseOf P}. * Please note: the return list items are not required to be {@link Inverse Inverse Object Property Expression}s. * * @return {@code Stream} of {@link OntOPE}s (either {@link Inverse} or {@link OntNOP}) * @see OntNOP#createInverse() * @since 1.4.0 */ default Stream inverseProperties() { return objects(OWL.inverseOf, OntOPE.class); } /** * Returns all associated negative object property assertions. * * @return {@code Stream} of {@link OntNPA.ObjectAssertion}s * @see OntNDP#negativeAssertions() * @see OntIndividual#negativeAssertions() */ @Override default Stream negativeAssertions() { return getModel().ontObjects(OntNPA.ObjectAssertion.class).filter(a -> OntOPE.this.equals(a.getProperty())); } /** * Returns all associated negative object property assertions for the specified source individual. * * @param source {@link OntIndividual} * @return {@code Stream} of {@link OntNPA.ObjectAssertion}s * @see OntNDP#negativeAssertions(OntIndividual) * @see OntIndividual#negativeAssertions(OntProperty) */ default Stream negativeAssertions(OntIndividual source) { return negativeAssertions().filter(a -> a.getSource().equals(source)); } /** * Finds the first {@code PropertyChain} logical construction * attached to this property for the specified []-list as object. * * @param list {@link RDFNode} * @return {@code Optional} around the {@link OntList ontology []-list} * with {@link OntOPE object property expression}s as items * @since 1.3.0 */ default Optional> findPropertyChain(RDFNode list) { try (Stream> res = propertyChains().filter(r -> Objects.equals(r, list))) { return res.findFirst(); } } /** * Deletes all property chain lists including their annotations. * * @return this instance to allow cascading calls * @see #removePropertyChain(Resource) * @see #createPropertyChain(Collection) * @since 1.3.0 */ default OntOPE clearPropertyChains() { propertyChains().collect(Collectors.toList()).forEach(this::removePropertyChain); return this; } /** * Lists all members from the right part of statement {@code P owl:propertyChainAxiom ( P1 ... Pn )}, * where {@code P} is this property. * Note: the result ignores repetitions, e.g. for * {@code SubObjectPropertyOf( ObjectPropertyChain( :hasParent :hasParent ) :hasGrandparent )}, * it returns only {@code :hasParent} property. * * @return distinct {@code Stream} of all sub-{@link OntOPE object properties}, * possible empty in case of nil-list or if there is no property-chains at all * @see #propertyChains() * @since 1.4.0 */ default Stream fromPropertyChain() { return propertyChains().flatMap(OntList::members).distinct(); } /** * Creates a property chain {@link OntList ontology list} * and returns the statement {@code P owl:propertyChainAxiom ( P1 ... Pn )} to allow the addition of annotations. * About RDF Graph annotation specification see, for example, * 2.3.1 Axioms that Generate a Main Triple. * * @param properties Array of {@link OntOPE}s without {@code null}s * @return {@link OntStatement} to provide the ability to add annotations subsequently * @see #createPropertyChain(Collection) * @see #addPropertyChainAxiomStatement(Collection) * @since 1.4.0 */ default OntStatement addPropertyChainAxiomStatement(OntOPE... properties) { return addPropertyChainAxiomStatement(Arrays.asList(properties)); } /** * Adds a new sub-property-of chain statement. * * @param properties Collection of {@link OntOPE}s * @return {@link OntStatement} (i.e. {@code _:this owl:propertyChainAxiom ( ... )}) * to provide the ability to add annotations subsequently * @see #createPropertyChain(Collection) * @see #addPropertyChainAxiomStatement(OntOPE...) * @see 2.3.1 Axioms that Generate a Main Triple * @since 1.4.0 */ default OntStatement addPropertyChainAxiomStatement(Collection properties) { return createPropertyChain(properties).getRoot(); } /** * Creates the {@code P rdf:type owl:InverseFunctionalProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setInverseFunctional(boolean) * @since 1.4.0 */ default OntStatement addInverseFunctionalDeclaration() { return addStatement(RDF.type, OWL.InverseFunctionalProperty); } /** * Creates the {@code P rdf:type owl:TransitiveProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setTransitive(boolean) * @since 1.4.0 */ default OntStatement addTransitiveDeclaration() { return addStatement(RDF.type, OWL.TransitiveProperty); } /** * Creates the {@code P rdf:type owl:SymmetricProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setSymmetric(boolean) * @since 1.4.0 */ default OntStatement addSymmetricDeclaration() { return addStatement(RDF.type, OWL.SymmetricProperty); } /** * Creates the {@code P rdf:type owl:AsymmetricProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setAsymmetric(boolean) * @since 1.4.0 */ default OntStatement addAsymmetricDeclaration() { return addStatement(RDF.type, OWL.AsymmetricProperty); } /** * Creates the {@code P rdf:type owl:ReflexiveProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setReflexive(boolean) * @since 1.4.0 */ default OntStatement addReflexiveDeclaration() { return addStatement(RDF.type, OWL.ReflexiveProperty); } /** * Creates the {@code P rdf:type owl:IrreflexiveProperty} property declaration statement, * where {@code P} is this property. * * @return {@link OntStatement} to allow the subsequent addition of annotations * @see #setIrreflexive(boolean) * @since 1.4.0 */ default OntStatement addIrreflexiveDeclaration() { return addStatement(RDF.type, OWL.IrreflexiveProperty); } /** * Adds a property range (i.e. {@code P rdfs:range C} statement). * * @param range {@link OntCE}, not {@code null} * @return {@link OntStatement} to allow processing annotations * @see #addRange(OntCE) */ default OntStatement addRangeStatement(OntCE range) { return addStatement(RDFS.range, range); } /** * Adds the given property as super property returning a new statement to annotate. * The triple pattern is {@code this rdfs:subPropertyOf property}). * * @param property {@link OntOPE}, not {@code null} * @return {@link OntStatement} to allow subsequent annotations adding */ default OntStatement addSubPropertyOfStatement(OntOPE property) { return addStatement(RDFS.subPropertyOf, property); } /** * Adds a new inverse-of statement. * * @param other {@link OntOPE}, not {@code null} * @return {@link OntStatement} to allow subsequent annotations adding * @see #addInverseProperty(OntOPE) * @see #inverseProperties() * @since 1.4.0 */ default OntStatement addInverseOfStatement(OntOPE other) { return addStatement(OWL.inverseOf, other); } /** * Creates and returns a new {@link OWL#equivalentProperty owl:equivalentProperty} statement * with the given property as an object and this property as a subject. * * @param other {@link OntOPE}, not {@code null} * @return {@link OntStatement} to allow subsequent annotations adding * @see #addEquivalentProperty(OntOPE) * @see #removeEquivalentProperty(Resource) * @see OntNDP#addEquivalentPropertyStatement(OntNDP) * @since 1.4.0 */ default OntStatement addEquivalentPropertyStatement(OntOPE other) { return addStatement(OWL.equivalentProperty, other); } /** * Adds a disjoint object property (i.e. the {@code _:this owl:propertyDisjointWith @other} statement). * * @param other {@link OntOPE}, not {@code null} * @return {@link OntStatement} to allow subsequent annotations adding * @see #addDisjointProperty(OntOPE) * @see #removeDisjointProperty(Resource) * @see OntNDP#addPropertyDisjointWithStatement(OntNDP) * @see OntDisjoint.ObjectProperties * @since 1.4.0 */ default OntStatement addPropertyDisjointWithStatement(OntOPE other) { return addStatement(OWL.propertyDisjointWith, other); } /** * Adds the given property as super property returning this property itself. * * @param property {@link OntNDP}, not {@code null} * @return this instance to allow cascading calls * @see OntPE#removeSuperProperty(Resource) * @since 1.4.0 */ default OntOPE addSuperProperty(OntOPE property) { addSubPropertyOfStatement(property); return this; } /** * Adds a statement with the {@link RDFS#range} as predicate * and the specified {@link OntCE class expression} as an object. * * @param range {@link OntCE}, not {@code null} * @return this instance to allow cascading calls * @see #addRangeStatement(OntCE) */ default OntOPE addRange(OntCE range) { addRangeStatement(range); return this; } /** * Adds a statement with the {@link RDFS#domain} as predicate * and the specified {@link OntCE class expression} as an object. * * @param ce {@link OntCE}, not {@code null} * @return this instance to allow cascading calls * @see #addDomainStatement(OntCE) */ @Override default OntOPE addDomain(OntCE ce) { addDomainStatement(ce); return this; } /** * Adds a new {@link OWL#equivalentProperty owl:equivalentProperty} statement. * * @param other {@link OntOPE}, not {@code null} * @return this instance to allow cascading calls * @see #addEquivalentPropertyStatement(OntOPE) * @see OntDOP#removeEquivalentProperty(Resource) * @see OntNDP#addEquivalentProperty(OntNDP) */ default OntOPE addEquivalentProperty(OntOPE other) { addEquivalentPropertyStatement(other); return this; } /** * Adds a new {@link OWL#propertyDisjointWith owl:propertyDisjointWith} statement * for this and the specified property. * * @param other {@link OntNDP}, not {@code null} * @return {@link OntNDP} this instance to allow cascading calls * @see #addPropertyDisjointWithStatement(OntOPE) * @see OntNDP#addDisjointProperty(OntNDP) * @see OntDOP#removeDisjointProperty(Resource) * @see OntDisjoint.ObjectProperties * @since 1.4.0 */ default OntOPE addDisjointProperty(OntOPE other) { addPropertyDisjointWithStatement(other); return this; } /** * Adds a new inverse-of statement, returns this property instance. * * @param other {@link OntOPE}, not {@code null} * @return this instance to allow cascading calls * @see #addInverseOfStatement(OntOPE) * @see #removeInverseProperty(Resource) * @since 1.4.0 */ default OntOPE addInverseProperty(OntOPE other) { addInverseOfStatement(other); return this; } /** * Adds a new sub-property-of chain statement and returns this object itself. * Note: the method saves a collection order with possible duplicates. * * @param properties an {@code Array} of {@link OntOPE object properties} * @return this instance to allow cascading calls * @see #addPropertyChainAxiomStatement(Collection) * @see #addPropertyChain(Collection) * @since 1.4.0 */ default OntOPE addPropertyChain(OntOPE... properties) { return addPropertyChain(Arrays.asList(properties)); } /** * Adds a new sub-property-of chain statement and returns this object itself. * Note: the method saves a collection order with possible duplicates. * * @param properties a {@code Collection} of {@link OntOPE object properties} * @return this instance to allow cascading calls * @see #addPropertyChainAxiomStatement(Collection) * @see #addPropertyChain(OntOPE...) * @since 1.4.0 */ default OntOPE addPropertyChain(Collection properties) { createPropertyChain(properties); return this; } /** * {@inheritDoc} */ @Override default OntOPE removeSuperProperty(Resource property) { remove(RDFS.subPropertyOf, property); return this; } /** * {@inheritDoc} */ @Override default OntOPE removeEquivalentProperty(Resource property) { remove(OWL.equivalentProperty, property); return this; } /** * {@inheritDoc} */ @Override default OntOPE removeDisjointProperty(Resource property) { remove(OWL.propertyDisjointWith, property); return this; } /** * {@inheritDoc} */ @Override default OntOPE removeDomain(Resource domain) { remove(RDFS.domain, domain); return this; } /** * {@inheritDoc} */ @Override default OntOPE removeRange(Resource range) { remove(RDFS.range, range); return this; } /** * Removes the statement with the predicate {@link OWL#inverseOf owl:inverseOf} * and the given object property as object. * If the argument is {@code null}, all {@code owl:inverseOf} statements will be removed for this object property. * No-op in case there is no {@code owl:inverseOf} statements. * * @param other {@link OntOPE} or {@code null} to remove all {@code owl:inverseOf} statements * @return this instance to allow cascading calls * @see #addInverseProperty(OntOPE) * @since 1.4.0 */ default OntOPE removeInverseProperty(Resource other) { remove(OWL.inverseOf, other); return this; } /** * {@inheritDoc} */ @Override default OntOPE setFunctional(boolean functional) { if (functional) { addFunctionalDeclaration(); } else { remove(RDF.type, OWL.FunctionalProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:InverseFunctionalProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param inverseFunctional if {@code true} the property must be inverse-functional * @return this instance to allow cascading calls * @see #addInverseFunctionalDeclaration() */ default OntOPE setInverseFunctional(boolean inverseFunctional) { if (inverseFunctional) { addInverseFunctionalDeclaration(); } else { remove(RDF.type, OWL.InverseFunctionalProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:TransitiveProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param transitive if {@code true} the property must be transitive * @return this instance to allow cascading calls * @see #addTransitiveDeclaration() */ default OntOPE setTransitive(boolean transitive) { if (transitive) { addTransitiveDeclaration(); } else { remove(RDF.type, OWL.TransitiveProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:SymmetricProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param symmetric if {@code true} the property must be symmetric * @return this instance to allow cascading calls * @see #addSymmetricDeclaration() */ default OntOPE setSymmetric(boolean symmetric) { if (symmetric) { addSymmetricDeclaration(); } else { remove(RDF.type, OWL.SymmetricProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:AsymmetricProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param asymmetric if {@code true} the property must be asymmetric * @return this instance to allow cascading calls * @see #addAsymmetricDeclaration() */ default OntOPE setAsymmetric(boolean asymmetric) { if (asymmetric) { addAsymmetricDeclaration(); } else { remove(RDF.type, OWL.AsymmetricProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:ReflexiveProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param reflexive if {@code true} the property must be reflexive * @return this instance to allow cascading calls * @see #addReflexiveDeclaration() */ default OntOPE setReflexive(boolean reflexive) { if (reflexive) { addReflexiveDeclaration(); } else { remove(RDF.type, OWL.ReflexiveProperty); } return this; } /** * Adds or removes the {@code P rdf:type owl:IrreflexiveProperty} statement depending on the given flag * and returns this property to allow cascading calls. * Note: the statement is removed along with all its annotations. * * @param irreflexive if {@code true} the property must be irreflexive * @return this instance to allow cascading calls * @see #addIrreflexiveDeclaration() */ default OntOPE setIrreflexive(boolean irreflexive) { if (irreflexive) { addIrreflexiveDeclaration(); } else { remove(RDF.type, OWL.IrreflexiveProperty); } return this; } /** * Finds the first object property * from the right part of the statements {@code _:x owl:inverseOf PN} or {@code P1 owl:inverseOf P2}. * Here {@code _:x} is an anonymous object property expression (i.e. {@link Inverse Inverse Object Property}), * {@code PN} is a {@link OntNOP named object property} * and {@code P1}, {@code P2} are any object property expressions. * What exactly is the first statement is defined at the level of model; in general it is unpredictable. * * @return {@code Optional} of {@link OntOPE} * @see #inverseProperties() * @see Inverse#getDirect() * @since 1.4.0 */ default Optional findInverseProperty() { try (Stream res = inverseProperties()) { return res.findFirst(); } } /** * @return {@code true} iff it is an inverse functional property */ default boolean isInverseFunctional() { return hasType(OWL.InverseFunctionalProperty); } /** * @return {@code true} iff it is a transitive property */ default boolean isTransitive() { return hasType(OWL.TransitiveProperty); } /** * @return {@code true} iff it is a symmetric property */ default boolean isSymmetric() { return hasType(OWL.SymmetricProperty); } /** * @return {@code true} iff it is an asymmetric property */ default boolean isAsymmetric() { return hasType(OWL.AsymmetricProperty); } /** * @return {@code true} iff it is a reflexive property */ default boolean isReflexive() { return hasType(OWL.ReflexiveProperty); } /** * @return {@code true} iff it is an irreflexive property */ default boolean isIrreflexive() { return hasType(OWL.IrreflexiveProperty); } /** * Represents a ObjectInverseOf. * Anonymous triple {@code _:x owl:inverseOf PN} which is also object property expression. */ interface Inverse extends OntOPE { /** * Returns a named object property companion. * Every {@link Inverse} property has its own {@link OntNOP} property. * The triple pattern is {@code _:x owl:inverseOf PN}. * * @return {@link OntNDP}, not {@code null} */ OntNOP getDirect(); } /** * Add a super-property of this property (i.e. {@code _:this rdfs:subPropertyOf @superProperty} statement). * * @param superProperty {@link OntOPE} * @return {@link OntStatement} * @deprecated (since 1.4.0) use the method {@link #addSubPropertyOfStatement(OntOPE)} */ @Deprecated default OntStatement addSubPropertyOf(OntOPE superProperty) { return addSubPropertyOfStatement(superProperty); } /** * Creates a property chain {@link OntList ontology list} * and returns statement {@code P owl:propertyChainAxiom ( P1 ... Pn )} to allow the addition of annotations. * About RDF Graph annotation specification see, for example, * 2.3.1 Axioms that Generate a Main Triple. * * @param properties Array of {@link OntOPE}s without {@code null}s * @return {@link OntStatement} * @since 1.3.0 * @deprecated since 1.4.0; please use the method {@link #addPropertyChainAxiomStatement(OntOPE...)} */ @Deprecated default OntStatement addSuperPropertyOf(OntOPE... properties) { return addPropertyChainAxiomStatement(properties); } /** * Adds new sub-property-of chain. * * @param properties Collection of {@link OntOPE}s * @return the {@link OntStatement} ({@code _:this owl:propertyChainAxiom ( ... )}) * @deprecated since 1.4.0; please use the method {@link #addPropertyChainAxiomStatement(Collection)} */ @Deprecated default OntStatement addSuperPropertyOf(Collection properties) { return addPropertyChainAxiomStatement(properties); } /** * Adds a new inverse-of statement. * * @param other {@link OntOPE} * @return {@link OntStatement} * @deprecated since 1.4.0; use the method {@link #addInverseOfStatement(OntOPE)} */ @Deprecated default OntStatement addInverseOf(OntOPE other) { return addInverseOfStatement(other); } /** * Gets the first object property * from the right part of the statements {@code _:x owl:inverseOf PN} or {@code P1 owl:inverseOf P2}. * What exactly is the first statement is defined at the level of graph; in general it is unpredictable. * * @return {@link OntOPE} or {@code null} * @deprecated since 1.4.0; use the method {@link #findInverseProperty()} */ @Deprecated default OntOPE getInverseOf() { return findInverseProperty().orElse(null); } /** * Removes the statement with predicate {@code owl:inverseOf} and the given object property as object. * * @param other {@link OntOPE} * @deprecated since 1.4.0; use the method {@link #removeInverseProperty(Resource)} */ @Deprecated default void removeInverseOf(OntOPE other) { removeInverseProperty(other); } /** * Clears all {@code P1 owl:propertyDisjointWith P2} statements * for the specified object property (subject, {@code P1}). * * @param other {@link OntOPE}, not {@code null} * @deprecated since 1.4.0; use the method {@link #removeDisjointProperty(Resource)} */ @Deprecated default void removeDisjointWith(OntOPE other) { removeDisjointProperty(other); } /** * Adds a disjoint object property (i.e. {@code _:this owl:propertyDisjointWith @other} statement). * * @param other {@link OntOPE}, not {@code null} * @return {@link OntStatement} to allow subsequent annotations adding * @deprecated since 1.4.0; use the method {@link #addDisjointProperty(OntOPE)} */ @Deprecated default OntStatement addDisjointWith(OntOPE other) { return addPropertyDisjointWithStatement(other); } /** * {@inheritDoc} * @return {@code Stream} * @deprecated since 1.4.0: use {@link OntOPE#ranges()} instead */ @SuppressWarnings("deprecation") @Deprecated @Override default Stream range() { return ranges(); } /** * {@inheritDoc} * * @return {@code Stream} * @deprecated since 1.4.0: use {@link OntOPE#superProperties()} instead */ @SuppressWarnings("deprecation") @Deprecated @Override default Stream subPropertyOf() { return superProperties(); } /** * {@inheritDoc} * * @return {@code Stream} * @deprecated since 1.4.0: use {@link OntOPE#disjointProperties()} instead */ @SuppressWarnings("deprecation") @Deprecated @Override default Stream disjointWith() { return disjointProperties(); } /** * {@inheritDoc} * * @return {@code Stream} * @deprecated since 1.4.0: use {@link OntOPE#equivalentProperties()} instead */ @SuppressWarnings("deprecation") @Deprecated @Override default Stream equivalentProperty() { return equivalentProperties(); } /** * Lists all object properties, that are inverse to this. * * @return {@code Stream} of {@link OntOPE}s. * @deprecated since 1.4.0: use {@link OntOPE#inverseProperties()} instead */ @Deprecated default Stream inverseOf() { return inverseProperties(); } /** * Returns a {@code Stream} over all property chain {@link OntList ontology list}s. * * @return {@code Stream} of {@link OntList}s with generic-parameter {@code OntOPE} * @since 1.3.0 * @deprecated since 1.4.0: use {@link OntOPE#propertyChains()} instead */ @Deprecated default Stream> listPropertyChains() { return propertyChains(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy