Package io.opencaesar.oml.util
Class OmlBuilder
java.lang.Object
io.opencaesar.oml.util.OmlBuilder
The Builder for the model. This builder uses the
OmlWrite
API and provides additional features.
It allows clients to specify cross references by IRI and defers their resolution and setting until the build process is finished.
This allows clients to have a single-phase build process as opposed to the typical two-phase builds (where objects are created
in the first phase, and cross references are set in the second phase).-
Constructor Summary
ConstructorDescriptionOmlBuilder
(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) Creates a new instance of the OML Builder for a given resource set -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation
(Ontology ontology, IdentifiedElement element, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a given annotated element in the context of a given ontology Note that if the element is already added to an ontology, it is expected to be the same as the given ontologyaddAnnotation
(Ontology ontology, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a given ontologyaddAnnotation
(Ontology ontology, String memberIri, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a a given member (identified by iri) in the context of a given ontologyaddAnnotationProperty
(Vocabulary vocabulary, String name) Creates a new annotation property and adds it to the given vocabularyaddAspect
(Vocabulary vocabulary, String name) Creates a new aspect and adds it to the given vocabularyaddBuiltIn
(Vocabulary vocabulary, String name) Creates a builtIn and adds it to the given vocabularyaddClassifierEquivalenceAxiom
(Vocabulary vocabulary, String subClassifierIri, List<String> superClassifierIris) Creates a classifier equivalence axiom between the sub classifier and super classifiers and adds it to the given vocabularyaddConcept
(Vocabulary vocabulary, String name) Creates a new concept and adds it to the given vocabularyaddConceptInstance
(Description description, String name) Creates a concept instance and adds it to the given descriptionaddForwardRelation
(RelationEntity entity, String name) Creates a forward relation and adds it to the given relation entityaddImport
(Ontology ontology, ImportKind kind, String namespace, String prefix) Creates an import and adds it to the given ontologyaddInstanceEnumerationAxiom
(Vocabulary vocabulary, String domainIri, List<String> instanceIris) Creates an instance enumeration axiom and adds it to the given vocabularyaddKeyAxiom
(Vocabulary vocabulary, String domainIri, List<String> keyPropertyIris) Creates a key axiom and adds it to the given vocabularyaddLiteralEnumerationAxiom
(Vocabulary vocabulary, String domainIri, Literal... literals) Creates an literal enumeration axiom and adds it to the given vocabularyaddPropertyCardinalityRestrictionAxiom
(Vocabulary vocabulary, Object owner, String propertyIri, CardinalityRestrictionKind restrictionKind, int cardinality, String rangeIri) Creates a property cardinality restriction axiom and adds it to the given vocabularyaddPropertyEquivalenceAxiom
(Vocabulary vocabulary, String subPropertyIri, String superPropertyIri) Creates a property equivalence axiom between the sub property and super property and adds it to the given vocabularyaddPropertyRangeRestrictionAxiom
(Vocabulary vocabulary, Object owner, String propertyIri, String rangeIri, RangeRestrictionKind restrictionKind) Creates a property range restriction axiom and adds it to the given vocabularyaddPropertySelfRestrictionAxiom
(Vocabulary vocabulary, Object owner, String relationIri) Creates a self restriction axiom on a relation and adds it to the given vocabularyaddPropertyValueAssertion
(Ontology ontology, Object owner, String propertyIri, Literal literalValue) Creates a property value assertion for a scalar property and adds it to the given ontologyaddPropertyValueAssertion
(Ontology ontology, Object owner, String propertyIri, StructureInstance containedValue) Creates a property value assertion for a structured property and adds it to the given ontologyaddPropertyValueAssertion
(Ontology ontology, Object owner, String propertyIri, String referencedValueIri) Creates a property value assertion for a relation and adds it to the given ontologyaddPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Object owner, String propertyIri, Literal literal) Creates a property value restriction axiom for a scalar property and adds it to the given vocabularyaddPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Object owner, String propertyIri, StructureInstance containedValue) Creates a property value restriction axiom for a structured property and adds it to the given vocabularyaddPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Object owner, String relationIri, String referencedValueIri) Creates a property value restriction axiom for a relation and adds it to the given vocabularyaddRelationEntity
(Vocabulary vocabulary, String name, List<String> sourceIris, List<String> targetIris, boolean functional, boolean inverseFunctional, boolean symmetric, boolean asymmetric, boolean reflexive, boolean irreflexive, boolean transitive) Creates a new relation entity and adds it to the given vocabularyaddRelationInstance
(Description description, String name, List<String> sourceIris, List<String> targetIris) Creates a relation instance and adds it to the given descriptionaddReverseRelation
(RelationBase base, String name) Creates a reverse relation and adds it to the given relation baseaddRule
(Vocabulary vocabulary, String name, Predicate[] antecedent, Predicate[] consequent) Creates a rule and adds it to the given vocabularyaddScalar
(Vocabulary vocabulary, String name) Creates a new scalar and adds it to the given vocabularyaddScalarEquivalenceAxiom
(Vocabulary vocabulary, String subScalarIri, String superScalarIri, Integer length, Integer minLength, Integer maxLength, String pattern, String language, Literal minInclusive, Literal minExclusive, Literal maxInclusive, Literal maxExclusive) Creates a scalar equivalence axiom between the sub scalar and super scalar and adds it to the given vocabularyaddScalarProperty
(Vocabulary vocabulary, String name, List<String> domainIris, List<String> rangeIris, boolean functional) Creates a new scalar property and adds it to the given vocabularyaddSpecializationAxiom
(Vocabulary vocabulary, String subTermIri, String superTermIri) Creates a specialization axiom between two terms and adds it to the given vocabularyaddStructure
(Vocabulary vocabulary, String name) Creates a new structure and adds it to the given vocabularyaddStructuredProperty
(Vocabulary vocabulary, String name, List<String> domainIris, List<String> rangeIris, boolean functional) Creates a new structured property and adds it to the given vocabularyprotected void
addToNewResources
(Ontology ontology, org.eclipse.emf.common.util.URI resourceURI) Creates a new resource with the given URI and adds the given ontology as its root The new resource will be created in the resource set and added to the set of new resourcesaddTypeAssertion
(Description description, String instanceIri, String typeIri) Creates a type assertion and adds it to the given descriptionaddUnreifiedRelation
(Vocabulary vocabulary, String name, List<String> sourceIris, List<String> targetIris, boolean functional, boolean inverseFunctional, boolean symmetric, boolean asymmetric, boolean reflexive, boolean irreflexive, boolean transitive) Creates a new unreified relation and adds it to the given vocabularycreateArgument
(Vocabulary vocabulary, String variable, Literal literal, String instanceIri) Creates an argumentcreateBooleanLiteral
(boolean value) Creates an boolean literalcreateBuiltInPredicate
(Vocabulary vocabulary, String builtInIri, Argument... arguments) Creates a builtIn predicatecreateDecimalLiteral
(BigDecimal value) Creates a decimal literalcreateDescription
(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new description and add it as content of a resource with the given URIcreateDescriptionBundle
(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new description bundle and add it as content of a resource with the given URIcreateDifferentFromPredicate
(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a differentFrom predicatecreateDoubleLiteral
(double value) Creates a double literalcreateIntegerLiteral
(int value) Creates an integer literalcreateLiteral
(Object value) Creates a literalcreatePropertyPredicate
(Vocabulary vocabulary, String propertyIri, Argument argument1, Argument argument2) Creates a property predicatecreateQuotedLiteral
(Ontology ontology, String value, String typeIri, String langTag) Creates a quoted literal in the given ontologycreateRelationEntityPredicate
(Vocabulary vocabulary, String typeIri, Argument argument1, Argument argument, Argument argument2) Creates an relation entity predicatecreateSameAsPredicate
(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a sameAs predicatecreateStructureInstance
(Ontology ontology, String structureIri) Creates a structure instance and adds it to the given ontologycreateTypePredicate
(Vocabulary vocabulary, String typeIri, Argument argument) Creates a type predicatecreateVocabulary
(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new vocabulary and add it as content of a resource with the given URIcreateVocabularyBundle
(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new vocabulary bundle and add it as content of a resource with the given URIvoid
finish()
Perform actions at the end of the building processCollection<org.eclipse.emf.ecore.resource.Resource>
Gets all the newly created resources by the builderorg.eclipse.emf.ecore.resource.ResourceSet
Gets the builder's resource setprotected <T extends Member>
TResolves the given iri to an element of the given type in the context of the given ontology This function will throw aRuntimeException
if the element was not resolvedprotected void
setContainmentReference
(Ontology ontology, String subjectIri, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given object to be contained by the given subject that is resolved by iri in the context of the given ontologyprotected void
setCrossReference
(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, String objectIri) Sets the given eRef on the given subject to an object that is resolved by iri in the context of the given ontology Object iri resolution and setting of the cross reference is deferred until the building is finishedprotected void
setCrossReferences
(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, List<String> objectIris) Sets the given eRef on the given subject to a List of objects that are resolved by iri in the context of the given ontology Object iri resolution and setting of the cross reference is deferred until the building is finishedvoid
setRelationBase
(Vocabulary vocabulary, String relationIri, String sourceIri, String targetIri, Boolean functional, Boolean inverseFunctional, Boolean symmetric, Boolean asymmetric, Boolean reflexive, Boolean irreflexive, Boolean transitive) Sets relation base details in the given vocabularyvoid
setRelationInstance
(Description description, String relationInstanceIri, String sourceIri, String targetIri) Sets a relation instance details in the given descriptionvoid
setScalarProperty
(Vocabulary vocabulary, String propertyIri, String domainIri, String rangeIri, Boolean functional) Sets a scalar property details in the given vocabularyvoid
setStructuredProperty
(Vocabulary vocabulary, String propertyIri, String domainIri, String rangeIri, Boolean functional) Sets structured property details in the given vocabularyvoid
start()
Perform actions at the start of the building process
-
Constructor Details
-
OmlBuilder
public OmlBuilder(org.eclipse.emf.ecore.resource.ResourceSet resourceSet) Creates a new instance of the OML Builder for a given resource set- Parameters:
resourceSet
- the given resource set
-
-
Method Details
-
getResourceSet
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()Gets the builder's resource set- Returns:
- the builder's resource set
-
addToNewResources
Creates a new resource with the given URI and adds the given ontology as its root The new resource will be created in the resource set and added to the set of new resources- Parameters:
ontology
- the given ontologyresourceURI
- the given resourceURI
-
getNewResources
Gets all the newly created resources by the builder- Returns:
- a List of newly created resources
-
start
public void start()Perform actions at the start of the building process -
finish
public void finish()Perform actions at the end of the building process -
setCrossReference
protected void setCrossReference(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, String objectIri) Sets the given eRef on the given subject to an object that is resolved by iri in the context of the given ontology Object iri resolution and setting of the cross reference is deferred until the building is finished- Parameters:
ontology
- the given ontologysubject
- the given subjecteRef
- the given non-containment eReferenceobjectIri
- an iri of the object
-
setCrossReferences
protected void setCrossReferences(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, List<String> objectIris) Sets the given eRef on the given subject to a List of objects that are resolved by iri in the context of the given ontology Object iri resolution and setting of the cross reference is deferred until the building is finished- Parameters:
ontology
- the given ontologysubject
- the given subjecteRef
- the given non-containment eReferenceobjectIris
- a list of iris of objects
-
setContainmentReference
protected void setContainmentReference(Ontology ontology, String subjectIri, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given object to be contained by the given subject that is resolved by iri in the context of the given ontology- Parameters:
ontology
- the given ontologysubjectIri
- the given iri of a member to be resolved as subjecteRef
- the containment eRef to use on subject if it belongs to the given ontologyobject
- the given object
-
resolve
Resolves the given iri to an element of the given type in the context of the given ontology This function will throw aRuntimeException
if the element was not resolved- Parameters:
type
- The given Oml type that is a subtype ofIdentifiedElement
context
- The given ontology contextiri
- the given iri of the element- Returns:
- an element with the given iri and type that is resolved in the context of the given ontology
-
addAnnotation
public Annotation addAnnotation(Ontology ontology, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a given ontology- Parameters:
ontology
- the ontology to annotatepropertyIri
- the annotation property identified by iriliteralValue
- the annotation literal valuereferencedValueIri
- the annotation (member) referenced value identified by iri- Returns:
- a new annotation on the given ontology
-
addAnnotation
public Annotation addAnnotation(Ontology ontology, IdentifiedElement element, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a given annotated element in the context of a given ontology Note that if the element is already added to an ontology, it is expected to be the same as the given ontology- Parameters:
ontology
- the context ontology that will have the annotation axiomelement
- the annotated element to put the annotation onpropertyIri
- the annotation property identified by iriliteralValue
- the annotation literal valuereferencedValueIri
- the annotation (member) referenced value identified by iri- Returns:
- a new annotation on the given annotated element in the context of the given ontology
-
addAnnotation
public Annotation addAnnotation(Ontology ontology, String memberIri, String propertyIri, Literal literalValue, String referencedValueIri) Adds a new annotation with a literal or reference value (but not both) on a a given member (identified by iri) in the context of a given ontology- Parameters:
ontology
- the context ontology that will have the annotation axiommemberIri
- the iri of a member to put the annotation onpropertyIri
- the annotation property identified by iriliteralValue
- the annotation literal valuereferencedValueIri
- the annotation (member) referenced value identified by iri- Returns:
- a new annotation on the given member in the context of the given ontology
-
createVocabulary
public Vocabulary createVocabulary(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new vocabulary and add it as content of a resource with the given URI- Parameters:
resourceURI
- the URI of a new resource to add the vocabulary to its contentsnamespace
- the namespace of the new vocabularyprefix
- the prefix of the new vocabulary- Returns:
- a newly created vocabulary added to the contents of a resource with the given URI
-
createVocabularyBundle
public VocabularyBundle createVocabularyBundle(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new vocabulary bundle and add it as content of a resource with the given URI- Parameters:
resourceURI
- the URI of a new resource to add the vocabulary bundle to its contentsnamespace
- the namespace of the new vocabulary bundleprefix
- the prefix of the new vocabulary bundle- Returns:
- a newly created vocabulary bunel added to the contents of a resource with the given URI
-
createDescription
public Description createDescription(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new description and add it as content of a resource with the given URI- Parameters:
resourceURI
- the URI of a new resource to add the description to its contentsnamespace
- the namespace of the new descriptionprefix
- the prefix of the new description- Returns:
- a newly created description added to the contents of a resource with the given URI
-
createDescriptionBundle
public DescriptionBundle createDescriptionBundle(org.eclipse.emf.common.util.URI resourceURI, String namespace, String prefix) Creates a new description bundle and add it as content of a resource with the given URI- Parameters:
resourceURI
- the URI of a new resource to add the description bundle to its contentsnamespace
- the namespace of the new description bundleprefix
- the prefix of the new description bundle- Returns:
- a newly created description bundle added to the contents of a resource with the given URI
-
addAspect
Creates a new aspect and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new aspect- Returns:
- a new aspect that is added to the given vocabulary
-
addConcept
Creates a new concept and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new concept- Returns:
- a new concept that is added to the given vocabulary
-
addRelationEntity
public RelationEntity addRelationEntity(Vocabulary vocabulary, String name, List<String> sourceIris, List<String> targetIris, boolean functional, boolean inverseFunctional, boolean symmetric, boolean asymmetric, boolean reflexive, boolean irreflexive, boolean transitive) Creates a new relation entity and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new relation entitysourceIris
- the iris of the source entitiestargetIris
- the iris of the target entitiesfunctional
- whether the relation entity is functionalinverseFunctional
- whether the relation entity is inverse functionalsymmetric
- whether the relation entity is symmetricasymmetric
- whether the relation entity is asymmetricreflexive
- whether the relation entity is reflexiveirreflexive
- whether the relation entity is irreflexivetransitive
- whether the relation entity is transitive- Returns:
- a new relation entity that is added to the given vocabulary
-
addStructure
Creates a new structure and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new structure- Returns:
- a new structure that is added to the given vocabulary
-
addAnnotationProperty
Creates a new annotation property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new annotation property- Returns:
- a new annotation property that is added to the given vocabulary
-
addScalarProperty
public ScalarProperty addScalarProperty(Vocabulary vocabulary, String name, List<String> domainIris, List<String> rangeIris, boolean functional) Creates a new scalar property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new scalar propertydomainIris
- the iris of the domain classifiersrangeIris
- the iris of the range scalarsfunctional
- whether the scalar property is functional- Returns:
- a new scalar property that is added to the given vocabulary
-
setScalarProperty
public void setScalarProperty(Vocabulary vocabulary, String propertyIri, String domainIri, String rangeIri, Boolean functional) Sets a scalar property details in the given vocabulary- Parameters:
vocabulary
- the context vocabularypropertyIri
- the iri of the scalar propertydomainIri
- the iri of a domain classifierrangeIri
- the iri of a range scalarfunctional
- whether the scalar property is functional (can be null)
-
addStructuredProperty
public StructuredProperty addStructuredProperty(Vocabulary vocabulary, String name, List<String> domainIris, List<String> rangeIris, boolean functional) Creates a new structured property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new structured propertydomainIris
- the iris of the domain classifiersrangeIris
- the iris of the range structuresfunctional
- whether the structured property is functional- Returns:
- a new structured property that is added to the given vocabulary
-
setStructuredProperty
public void setStructuredProperty(Vocabulary vocabulary, String propertyIri, String domainIri, String rangeIri, Boolean functional) Sets structured property details in the given vocabulary- Parameters:
vocabulary
- the context vocabularypropertyIri
- the iri of the structured propertydomainIri
- the iri of a domain classifiersrangeIri
- the iri of a range structuresfunctional
- whether the structured property is functional
-
addScalar
Creates a new scalar and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new faceted scalar- Returns:
- a new scalar that is added to the given vocabulary
-
addForwardRelation
Creates a forward relation and adds it to the given relation entity- Parameters:
entity
- the context relation entityname
- the name of the new forward relation- Returns:
- a forward relation that is added to the given relation entity
-
addReverseRelation
Creates a reverse relation and adds it to the given relation base- Parameters:
base
- the context relation basename
- the name of the new reverse relation- Returns:
- a reverse relation that is added to the given relation base
-
addUnreifiedRelation
public UnreifiedRelation addUnreifiedRelation(Vocabulary vocabulary, String name, List<String> sourceIris, List<String> targetIris, boolean functional, boolean inverseFunctional, boolean symmetric, boolean asymmetric, boolean reflexive, boolean irreflexive, boolean transitive) Creates a new unreified relation and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new relationsourceIris
- the iri of the source entitytargetIris
- the iri of the target entityfunctional
- whether the relation entity is functionalinverseFunctional
- whether the relation entity is inverse functionalsymmetric
- whether the relation entity is symmetricasymmetric
- whether the relation entity is asymmetricreflexive
- whether the relation entity is reflexiveirreflexive
- whether the relation entity is irreflexivetransitive
- whether the relation entity is transitive- Returns:
- a new relation entity that is added to the given vocabulary
-
setRelationBase
public void setRelationBase(Vocabulary vocabulary, String relationIri, String sourceIri, String targetIri, Boolean functional, Boolean inverseFunctional, Boolean symmetric, Boolean asymmetric, Boolean reflexive, Boolean irreflexive, Boolean transitive) Sets relation base details in the given vocabulary- Parameters:
vocabulary
- the context vocabularyrelationIri
- the iri of the relationsourceIri
- the iri of a source entitytargetIri
- the iri of a target entityfunctional
- whether the relation entity is functionalinverseFunctional
- whether the relation entity is inverse functionalsymmetric
- whether the relation entity is symmetricasymmetric
- whether the relation entity is asymmetricreflexive
- whether the relation entity is reflexiveirreflexive
- whether the relation entity is irreflexivetransitive
- whether the relation entity is transitive
-
addRule
public Rule addRule(Vocabulary vocabulary, String name, Predicate[] antecedent, Predicate[] consequent) Creates a rule and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new ruleantecedent
- a list of antecedent predicates of the ruleconsequent
- a list of consequent predicates of the rule- Returns:
- a rule that is added to the given vocabulary
-
addBuiltIn
Creates a builtIn and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new builtIn- Returns:
- a builtIn that is added to the given vocabulary
-
createStructureInstance
Creates a structure instance and adds it to the given ontology- Parameters:
ontology
- the context ontologystructureIri
- the iri of a structure that is the type of the structure instance- Returns:
- a structure instance that is added to the given ontology
-
addConceptInstance
Creates a concept instance and adds it to the given description- Parameters:
description
- the context descriptionname
- the name of the new concept instance- Returns:
- a concept instance that is added to the given description
-
addRelationInstance
public RelationInstance addRelationInstance(Description description, String name, List<String> sourceIris, List<String> targetIris) Creates a relation instance and adds it to the given description- Parameters:
description
- the context descriptionname
- the name of the new relation instancesourceIris
- a list of Iris for source instancestargetIris
- a list of Iris of target instances- Returns:
- a relation instance that is added to the given description
-
setRelationInstance
public void setRelationInstance(Description description, String relationInstanceIri, String sourceIri, String targetIri) Sets a relation instance details in the given description- Parameters:
description
- the context descriptionrelationInstanceIri
- the iri of a relation instancesourceIri
- the iri of a source instancetargetIri
- the iri of a target instance
-
addImport
Creates an import and adds it to the given ontology- Parameters:
ontology
- the importing ontologykind
- the kind of importnamespace
- the namespace of the imported ontologyprefix
- the prefix of the imported ontology (optional)- Returns:
- an import that is added to the importing ontology
-
addSpecializationAxiom
public SpecializationAxiom addSpecializationAxiom(Vocabulary vocabulary, String subTermIri, String superTermIri) Creates a specialization axiom between two terms and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubTermIri
- the iri of the sub termsuperTermIri
- the iri of the super term- Returns:
- a specialization axiom that is added to the vocabulary
-
addClassifierEquivalenceAxiom
public ClassifierEquivalenceAxiom addClassifierEquivalenceAxiom(Vocabulary vocabulary, String subClassifierIri, List<String> superClassifierIris) Creates a classifier equivalence axiom between the sub classifier and super classifiers and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubClassifierIri
- the given iri of sub classifiersuperClassifierIris
- the given iris of super classifiers- Returns:
- a classifier equivalence axiom that is added to the vocabulary
-
addScalarEquivalenceAxiom
public ScalarEquivalenceAxiom addScalarEquivalenceAxiom(Vocabulary vocabulary, String subScalarIri, String superScalarIri, Integer length, Integer minLength, Integer maxLength, String pattern, String language, Literal minInclusive, Literal minExclusive, Literal maxInclusive, Literal maxExclusive) Creates a scalar equivalence axiom between the sub scalar and super scalar and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubScalarIri
- the given iri of sub scalarsuperScalarIri
- the given iri of super scalarlength
- the length facetminLength
- the min length facetmaxLength
- the max length facetpattern
- the string pattern facetlanguage
- the language facetminInclusive
- the min inclusive facetminExclusive
- the min exclusive facetmaxInclusive
- the max inclusive facetmaxExclusive
- the max exclusive facet- Returns:
- a scalar equivalence axiom that is added to the vocabulary
-
addPropertyEquivalenceAxiom
public PropertyEquivalenceAxiom addPropertyEquivalenceAxiom(Vocabulary vocabulary, String subPropertyIri, String superPropertyIri) Creates a property equivalence axiom between the sub property and super property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubPropertyIri
- the iri of the given sub propertysuperPropertyIri
- the iri of the given super property- Returns:
- a property equivalence axiom that is added to the vocabulary
-
addPropertyRangeRestrictionAxiom
public PropertyRangeRestrictionAxiom addPropertyRangeRestrictionAxiom(Vocabulary vocabulary, Object owner, String propertyIri, String rangeIri, RangeRestrictionKind restrictionKind) Creates a property range restriction axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the owner (either a String representing the iri of the owning classifier, or the owning classifier equivalence axiom object)propertyIri
- the iri of the restricted propertyrangeIri
- the iri of the restricted rangerestrictionKind
- the kind of the restriction- Returns:
- a property range restriction axiom that is added to the given vocabulary
-
addPropertyCardinalityRestrictionAxiom
public PropertyCardinalityRestrictionAxiom addPropertyCardinalityRestrictionAxiom(Vocabulary vocabulary, Object owner, String propertyIri, CardinalityRestrictionKind restrictionKind, int cardinality, String rangeIri) Creates a property cardinality restriction axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the owner (either a String representing the iri of the owning classifier, or the owning classifier equivalence axiom object)propertyIri
- the iri of the restricted propertycardinality
- the restricted cardinalityrangeIri
- the iri of the restricted range (optional)restrictionKind
- the kind of the restriction- Returns:
- a property cardinality restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Object owner, String propertyIri, Literal literal) Creates a property value restriction axiom for a scalar property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the owner (either a String representing the iri of the owning classifier, or the owning classifier equivalence axiom object)propertyIri
- the iri of the restricted scalar propertyliteral
- the (literal) value of the restriction- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Object owner, String propertyIri, StructureInstance containedValue) Creates a property value restriction axiom for a structured property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the owner (either a String representing the iri of the owning classifier, or the owning classifier equivalence axiom object)propertyIri
- the iri of the restricted structured propertycontainedValue
- the contained value of the restriction- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Object owner, String relationIri, String referencedValueIri) Creates a property value restriction axiom for a relation and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the owner (either a String representing the iri of the owning classifier, or the owning classifier equivalence axiom object)relationIri
- the iri of the restricted relationreferencedValueIri
- the Iri of a referenced value of the restriction- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertySelfRestrictionAxiom
public PropertySelfRestrictionAxiom addPropertySelfRestrictionAxiom(Vocabulary vocabulary, Object owner, String relationIri) Creates a self restriction axiom on a relation and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the given restricting owner (classifier or classifier equivalence axiom)relationIri
- the iri of the restricted relation- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addKeyAxiom
Creates a key axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomainIri
- the iri of the (concept) domainkeyPropertyIris
- the list of iris of the properties that are part of the key- Returns:
- a key axiom that is added to the given vocabulary
-
addInstanceEnumerationAxiom
public InstanceEnumerationAxiom addInstanceEnumerationAxiom(Vocabulary vocabulary, String domainIri, List<String> instanceIris) Creates an instance enumeration axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomainIri
- the iri of the (concept) domaininstanceIris
- the list of iris of the concept instances- Returns:
- an instance enumeration axiom that is added to the given vocabulary
-
addLiteralEnumerationAxiom
public LiteralEnumerationAxiom addLiteralEnumerationAxiom(Vocabulary vocabulary, String domainIri, Literal... literals) Creates an literal enumeration axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomainIri
- the iri of the (scalar) domainliterals
- the list of enumerated literals- Returns:
- a literal enumeration axiom that is added to the given vocabulary
-
addTypeAssertion
Creates a type assertion and adds it to the given description- Parameters:
description
- the context descriptioninstanceIri
- the iri of the named instancetypeIri
- the iri of the type- Returns:
- a type assertion that is added to the given description
-
addPropertyValueAssertion
public PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Object owner, String propertyIri, Literal literalValue) Creates a property value assertion for a scalar property and adds it to the given ontology- Parameters:
ontology
- the context ontologyowner
- either a structure instance or the iri of a named instancepropertyIri
- the iri of the scalar propertyliteralValue
- the asserted (literal) value of the property- Returns:
- a property value assertion that is added to the given description
-
addPropertyValueAssertion
public PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Object owner, String propertyIri, StructureInstance containedValue) Creates a property value assertion for a structured property and adds it to the given ontology- Parameters:
ontology
- the context ontologyowner
- either a structure instance or the iri of a named instancepropertyIri
- the iri of the structured propertycontainedValue
- the asserted contained value of the property- Returns:
- a property value assertion that is added to the given description
-
addPropertyValueAssertion
public PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Object owner, String propertyIri, String referencedValueIri) Creates a property value assertion for a relation and adds it to the given ontology- Parameters:
ontology
- the context ontologyowner
- either a structure instance or the iri of a named instancepropertyIri
- the iri of the relation propertyreferencedValueIri
- the asserted referenced value (identified by iri) of the property- Returns:
- a property value assertion that is added to the given description
-
createArgument
public Argument createArgument(Vocabulary vocabulary, String variable, Literal literal, String instanceIri) Creates an argument- Parameters:
vocabulary
- the context vocabularyvariable
- a given variable nameliteral
- a given literalinstanceIri
- an IRI of a given named instance- Returns:
- an argument
-
createTypePredicate
Creates a type predicate- Parameters:
vocabulary
- the context vocabularytypeIri
- the iri of the typeargument
- the argument bound to a value of the type- Returns:
- a type predicate
-
createRelationEntityPredicate
public RelationEntityPredicate createRelationEntityPredicate(Vocabulary vocabulary, String typeIri, Argument argument1, Argument argument, Argument argument2) Creates an relation entity predicate- Parameters:
vocabulary
- the context vocabularytypeIri
- the iri of the relation entityargument1
- the argument bound to a named instance representing the source of a relation instanceargument
- the argument bound to a relation instanceargument2
- the argument bound to a named instance representing the target of a relation instance- Returns:
- a relation entity predicate
-
createPropertyPredicate
public PropertyPredicate createPropertyPredicate(Vocabulary vocabulary, String propertyIri, Argument argument1, Argument argument2) Creates a property predicate- Parameters:
vocabulary
- the context vocabularypropertyIri
- the iri of the propertyargument1
- the argument bound to a instance representing the subject of the given propertyargument2
- the argument bound to a value representing the object of the given property- Returns:
- a relation predicate
-
createSameAsPredicate
public SameAsPredicate createSameAsPredicate(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a sameAs predicate- Parameters:
vocabulary
- the context vocabularyargument1
- the argument bound to the first named instanceargument2
- the argument bound to the second named instance- Returns:
- a sameAs predicate
-
createDifferentFromPredicate
public DifferentFromPredicate createDifferentFromPredicate(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a differentFrom predicate- Parameters:
vocabulary
- the context vocabularyargument1
- the argument bound to the first named instanceargument2
- the argument bound to the second named instance- Returns:
- a differentFrom predicate
-
createBuiltInPredicate
public BuiltInPredicate createBuiltInPredicate(Vocabulary vocabulary, String builtInIri, Argument... arguments) Creates a builtIn predicate- Parameters:
vocabulary
- the context vocabularybuiltInIri
- the given builtIn IRIarguments
- the arguments of the builtin- Returns:
- a builtIn predicate
-
createQuotedLiteral
public QuotedLiteral createQuotedLiteral(Ontology ontology, String value, String typeIri, String langTag) Creates a quoted literal in the given ontology- Parameters:
ontology
- the ontology contextvalue
- the lexical value of the literaltypeIri
- the iri of (scalar) type of the literal (optional)langTag
- the language tag of the literal (optional)- Returns:
- a quoted literal
-
createIntegerLiteral
Creates an integer literal- Parameters:
value
- the integer value of the literal- Returns:
- an integer literal
-
createDecimalLiteral
Creates a decimal literal- Parameters:
value
- the big decimal value of the literal- Returns:
- a decimal literal
-
createDoubleLiteral
Creates a double literal- Parameters:
value
- the double value of the literal- Returns:
- a double literal
-
createBooleanLiteral
Creates an boolean literal- Parameters:
value
- the boolean value of the literal- Returns:
- a boolean literal
-
createLiteral
Creates a literal- Parameters:
value
- the value of the literal- Returns:
- a literal
-