Package io.opencaesar.oml.util
Class OmlWrite
java.lang.Object
io.opencaesar.oml.util.OmlWrite
The Write API for the model. It complements the OML setter API by additional utilities.
*
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Annotation
addAnnotation
(Ontology ontology, AnnotationProperty property, Literal literalValue, Member referencedValue) Adds a new annotation with either a literal or reference value (but not both) on a given ontologystatic Annotation
addAnnotation
(Ontology ontology, IdentifiedElement element, AnnotationProperty property, Literal literalValue, Member referencedValue) Adds a new annotation with either a literal or reference value (but not both) on a given element in the context of a given ontologystatic AnnotationProperty
addAnnotationProperty
(Vocabulary vocabulary, String name) Creates a new annotation property and adds it to the given vocabularystatic Aspect
addAspect
(Vocabulary vocabulary, String name) Creates a new aspect and adds it to the given vocabularystatic BuiltIn
addBuiltIn
(Vocabulary vocabulary, String name) Creates a builtIn and adds it to the given vocabularystatic ClassifierEquivalenceAxiom
addClassifierEquivalenceAxiom
(Vocabulary vocabulary, Classifier subClassifier, List<Classifier> superClassifiers) Creates a classifier equivalence axiom between the sub classifier and super classifiers and adds it to the given vocabularystatic Concept
addConcept
(Vocabulary vocabulary, String name) Creates a new concept and adds it to the given vocabularystatic ConceptInstance
addConceptInstance
(Description description, String name) Creates a concept instance and adds it to the given descriptionstatic ForwardRelation
addForwardRelation
(RelationEntity entity, String name) Creates a forward relation and adds it to the given relation entitystatic Import
addImport
(Ontology ontology, ImportKind kind, String namespace, String prefix) Creates an import and adds it to the given ontologystatic void
Creates an import to a given ontology and adds it to a context ontologystatic InstanceEnumerationAxiom
addInstanceEnumerationAxiom
(Vocabulary vocabulary, Concept domain, List<ConceptInstance> instances) Creates an instance enumeration axiom and adds it to the given vocabularystatic KeyAxiom
addKeyAxiom
(Vocabulary vocabulary, Entity domain, List<Property> keyProperties) Creates a key axiom and adds it to the given vocabularystatic LiteralEnumerationAxiom
addLiteralEnumerationAxiom
(Vocabulary vocabulary, Scalar domain, Literal... literals) Creates an literal enumeration axiom and adds it to the given vocabularyaddPropertyCardinalityRestrictionAxiom
(Vocabulary vocabulary, Element owner, SemanticProperty property, CardinalityRestrictionKind restrictionKind, int cardinality, Type range) Creates a property cardinality restriction axiom and adds it to the given vocabularystatic PropertyEquivalenceAxiom
addPropertyEquivalenceAxiom
(Vocabulary vocabulary, SpecializableProperty subProperty, Property superProperty) Creates a property equivalence axiom between the sub property and super property and adds it to the given vocabularyaddPropertyRangeRestrictionAxiom
(Vocabulary vocabulary, Element owner, SemanticProperty property, Type range, RangeRestrictionKind restrictionKind) Creates a property range restriction axiom and adds it to the given vocabularystatic PropertySelfRestrictionAxiom
addPropertySelfRestrictionAxiom
(Vocabulary vocabulary, Element owner, Relation relation) Creates a self restriction axiom on a relation and adds it to the given vocabularystatic PropertyValueAssertion
addPropertyValueAssertion
(Ontology ontology, Instance instance, Relation relation, NamedInstance referencedValue) Creates a property value assertion for a relation and adds it to the given ontology.static PropertyValueAssertion
addPropertyValueAssertion
(Ontology ontology, Instance instance, ScalarProperty property, Literal literalValue) Creates a property value assertion for a scalar property and adds it to the given ontology.static PropertyValueAssertion
addPropertyValueAssertion
(Ontology ontology, Instance instance, StructuredProperty property, StructureInstance containedeValue) Creates a property value assertion for a structured property and adds it to the given ontology.addPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Element owner, Relation relation, NamedInstance value) Creates a value restriction axiom on a relation and adds it to the given vocabularyaddPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Element owner, ScalarProperty property, Literal value) Creates a property value restriction axiom on a scalar property and adds it to the given vocabularyaddPropertyValueRestrictionAxiom
(Vocabulary vocabulary, Element owner, StructuredProperty property, StructureInstance value) Creates a property value restriction axiom on a structured property and adds it to the given vocabularystatic RelationEntity
addRelationEntity
(Vocabulary vocabulary, String name, List<Entity> sources, List<Entity> targets, 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 vocabularystatic RelationInstance
addRelationInstance
(Description description, String name, List<NamedInstance> sources, List<NamedInstance> targets) Creates a relation instance and adds it to the given descriptionstatic ReverseRelation
addReverseRelation
(RelationBase base, String name) Creates a reverse relation and adds it to the given relation basestatic Rule
addRule
(Vocabulary vocabulary, String name, Predicate[] antecedent, Predicate[] consequent) Creates a rule and adds it to the given vocabularystatic Scalar
addScalar
(Vocabulary vocabulary, String name) Creates a new scalar and adds it to the given vocabularystatic ScalarEquivalenceAxiom
addScalarEquivalenceAxiom
(Vocabulary vocabulary, Scalar subScalar, Scalar superScalar, 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 vocabularystatic ScalarProperty
addScalarProperty
(Vocabulary vocabulary, String name, List<Classifier> domains, List<Scalar> ranges, boolean functional) Creates a new scalar property and adds it to the given vocabularystatic SpecializationAxiom
addSpecializationAxiom
(Vocabulary vocabulary, Term subTerm, Term superTerm) Creates a specialization axiom between two terms and adds it to the given vocabularystatic Structure
addStructure
(Vocabulary vocabulary, String name) Creates a new structure and adds it to the given vocabularystatic StructuredProperty
addStructuredProperty
(Vocabulary vocabulary, String name, List<Classifier> domains, List<Structure> ranges, boolean functional) Creates a new structured property and adds it to the given vocabularystatic TypeAssertion
addTypeAssertion
(Description description, NamedInstance instance, Entity type) Creates a type assertion and adds it to the given descriptionstatic UnreifiedRelation
addUnreifiedRelation
(Vocabulary vocabulary, String name, List<Entity> sources, List<Entity> targets, 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 vocabularyprotected static <T extends Element>
TCreates an object of the given type using the Oml factorystatic Argument
createArgument
(Vocabulary vocabulary, String variable, Literal literal, NamedInstance instance) Creates an argumentstatic BooleanLiteral
createBooleanLiteral
(boolean value) Creates an boolean literalstatic BuiltInPredicate
createBuiltInPredicate
(Vocabulary vocabulary, BuiltIn builtIn, Argument... arguments) Creates a builtIn predicatestatic DecimalLiteral
createDecimalLiteral
(BigDecimal value) Creates a decimal literalstatic Description
createDescription
(String namespace, String prefix) Creates a new descriptionstatic DescriptionBundle
createDescriptionBundle
(String namespace, String prefix) Creates a new description bundlestatic DifferentFromPredicate
createDifferentFromPredicate
(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a differentFrom predicatestatic DoubleLiteral
createDoubleLiteral
(double value) Creates a double literalstatic IntegerLiteral
createIntegerLiteral
(int value) Creates an integer literalstatic Literal
createLiteral
(Object value) Creates a literal from the given lexical value in the given ontologyprotected static <T extends Ontology>
TcreateOntology
(Class<T> type, String namespace, String prefix) Creates a new ontology of the given sub typestatic PropertyPredicate
createPropertyPredicate
(Vocabulary vocabulary, Property property, Argument argument1, Argument argument2) Creates an relation predicatestatic QuotedLiteral
createQuotedLiteral
(Ontology ontology, String value, Scalar type, String langTag) Creates a quoted literal in the given ontologyprotected static <T extends Member>
TcreateRef
(T member) Creates a ref to the given memberstatic RelationEntityPredicate
createRelationEntityPredicate
(Vocabulary vocabulary, RelationEntity type, Argument argument1, Argument argument, Argument argument2) Creates an relation entity predicatestatic SameAsPredicate
createSameAsPredicate
(Vocabulary vocabulary, Argument argument1, Argument argument2) Creates a sameAs predicatestatic StructureInstance
createStructureInstance
(Ontology ontology, Structure structure) Creates a structure instance and adds it to the given ontologystatic TypePredicate
createTypePredicate
(Vocabulary vocabulary, Type type, Argument argument) Creates a type predicatestatic Vocabulary
createVocabulary
(String namespace, String prefix) Creates a new vocabularystatic VocabularyBundle
createVocabularyBundle
(String namespace, String prefix) Creates a new vocabulary bundleprotected static Member
getOrAddRef
(Ontology ontology, Member member) Gets an existing or creates a new ref to the given member in the context of the given ontologyprotected static void
setContainmentReference
(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given object to be contained by the given subject in the context of the given ontologyprotected static void
setCrossReference
(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given eRef on the given subject to an object in the context of the given ontologyprotected static void
setCrossReferences
(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, List<? extends Element> objects) Sets the given eRef on the given subject to a List of objects in the context of the given ontology
-
Constructor Details
-
OmlWrite
public OmlWrite()
-
-
Method Details
-
setCrossReference
protected static void setCrossReference(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given eRef on the given subject to an object in the context of the given ontology- Parameters:
ontology
- the given ontologysubject
- the given subjecteRef
- the given eReferenceobject
- the given object
-
setCrossReferences
protected static void setCrossReferences(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, List<? extends Element> objects) Sets the given eRef on the given subject to a List of objects in the context of the given ontology- Parameters:
ontology
- the given ontologysubject
- the given subjecteRef
- the given eReferenceobjects
- the given list of objects
-
setContainmentReference
protected static void setContainmentReference(Ontology ontology, Element subject, org.eclipse.emf.ecore.EReference eRef, Element object) Sets the given object to be contained by the given subject in the context of the given ontology- Parameters:
ontology
- the given ontologysubject
- the given subjecteRef
- the containment eRef to use on subject if it belongs to the given ontologyobject
- the given object
-
create
Creates an object of the given type using the Oml factory- Parameters:
type
- the given Java type- Returns:
- an Oml object of the given type
-
getOrAddRef
Gets an existing or creates a new ref to the given member in the context of the given ontology- Parameters:
ontology
- the context ontologymember
- the given member- Returns:
- a ref to the given member in the context of the given ontology
-
addAnnotation
public static Annotation addAnnotation(Ontology ontology, AnnotationProperty property, Literal literalValue, Member referencedValue) Adds a new annotation with either a literal or reference value (but not both) on a given ontology- Parameters:
ontology
- the ontology to annotateproperty
- the given annotation propertyliteralValue
- the annotation literal valuereferencedValue
- the annotation reference value- Returns:
- a new annotation on the given ontology
-
addAnnotation
public static Annotation addAnnotation(Ontology ontology, IdentifiedElement element, AnnotationProperty property, Literal literalValue, Member referencedValue) Adds a new annotation with either a literal or reference value (but not both) on a given element in the context of a given ontology- Parameters:
ontology
- the context ontology that will have the annotation axiomelement
- the annotated element to put the annotation onproperty
- the given annotation propertyliteralValue
- the annotation literal valuereferencedValue
- the annotation reference value- Returns:
- a new annotation on the given member in the context of the given ontology
-
createOntology
protected static <T extends Ontology> T createOntology(Class<T> type, String namespace, String prefix) Creates a new ontology of the given sub type- Parameters:
type
- the sub type of ontology to createnamespace
- the namespace of the new ontologyprefix
- the prefix of the new ontology- Returns:
- a newly created ontology added to the contents of a resource with the given URI
-
createVocabulary
Creates a new vocabulary- Parameters:
namespace
- 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
Creates a new vocabulary bundle- Parameters:
namespace
- 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
Creates a new description- Parameters:
namespace
- 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
Creates a new description bundle- Parameters:
namespace
- 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 static RelationEntity addRelationEntity(Vocabulary vocabulary, String name, List<Entity> sources, List<Entity> targets, 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 conceptsources
- the given list of source entitiestargets
- the given list of 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 static ScalarProperty addScalarProperty(Vocabulary vocabulary, String name, List<Classifier> domains, List<Scalar> ranges, 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 propertydomains
- the given list of domain classifiersranges
- the given list of range scalarsfunctional
- whether the scalar property is functional- Returns:
- a new scalar property that is added to the given vocabulary
-
addStructuredProperty
public static StructuredProperty addStructuredProperty(Vocabulary vocabulary, String name, List<Classifier> domains, List<Structure> ranges, 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 propertydomains
- the given list of domain classifiersranges
- the given list of target structuresfunctional
- whether the structured property is functional- Returns:
- a new structured property that is added to the given vocabulary
-
addScalar
Creates a new scalar and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyname
- the name of the new 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 static UnreifiedRelation addUnreifiedRelation(Vocabulary vocabulary, String name, List<Entity> sources, List<Entity> targets, 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 conceptsources
- the given list of source entitiestargets
- the given list of 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 unreified relation that is added to the given vocabulary
-
addRule
public static 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 ontologystructure
- the given 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 static RelationInstance addRelationInstance(Description description, String name, List<NamedInstance> sources, List<NamedInstance> targets) Creates a relation instance and adds it to the given description- Parameters:
description
- the context descriptionname
- the name of the new relation instancesources
- a given list of source instancestargets
- a given list of target instances- Returns:
- a relation instance that is added to the given description
-
createRef
Creates a ref to the given member- Parameters:
member
- the given member- Returns:
- a ref for the given member
-
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
-
addImport
Creates an import to a given ontology and adds it to a context ontology- Parameters:
ontology
- The importing ontologyimportedOntology
- The imported ontology
-
addSpecializationAxiom
public static SpecializationAxiom addSpecializationAxiom(Vocabulary vocabulary, Term subTerm, Term superTerm) Creates a specialization axiom between two terms and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubTerm
- the given sub termsuperTerm
- the given super term- Returns:
- a specialization axiom that is added to the vocabulary
-
addClassifierEquivalenceAxiom
public static ClassifierEquivalenceAxiom addClassifierEquivalenceAxiom(Vocabulary vocabulary, Classifier subClassifier, List<Classifier> superClassifiers) Creates a classifier equivalence axiom between the sub classifier and super classifiers and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubClassifier
- the given sub classifiersuperClassifiers
- the given super classifiers- Returns:
- a classifier equivalence axiom that is added to the vocabulary
-
addScalarEquivalenceAxiom
public static ScalarEquivalenceAxiom addScalarEquivalenceAxiom(Vocabulary vocabulary, Scalar subScalar, Scalar superScalar, 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 vocabularysubScalar
- the given sub scalarsuperScalar
- the given 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 static PropertyEquivalenceAxiom addPropertyEquivalenceAxiom(Vocabulary vocabulary, SpecializableProperty subProperty, Property superProperty) Creates a property equivalence axiom between the sub property and super property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularysubProperty
- the given sub propertysuperProperty
- the given super property- Returns:
- a property equivalence axiom that is added to the vocabulary
-
addPropertyRangeRestrictionAxiom
public static PropertyRangeRestrictionAxiom addPropertyRangeRestrictionAxiom(Vocabulary vocabulary, Element owner, SemanticProperty property, Type range, RangeRestrictionKind restrictionKind) Creates a property range restriction axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the given restricting owner (classifier or classifier equivalence axiom)property
- the given restricted propertyrange
- given restricted rangerestrictionKind
- the kind of the restriction- Returns:
- a property range restriction axiom that is added to the given vocabulary
-
addPropertyCardinalityRestrictionAxiom
public static PropertyCardinalityRestrictionAxiom addPropertyCardinalityRestrictionAxiom(Vocabulary vocabulary, Element owner, SemanticProperty property, CardinalityRestrictionKind restrictionKind, int cardinality, Type range) Creates a property cardinality restriction axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the given restricting owner (classifier or classifier equivalence axiom)property
- the given restricted propertycardinality
- the restricted cardinalityrange
- given restricted rangerestrictionKind
- the kind of the restriction- Returns:
- a property cardinality restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public static PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Element owner, ScalarProperty property, Literal value) Creates a property value restriction axiom on a scalar property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the given restricting owner (classifier or classifier equivalence axiom)property
- the given scalar propertyvalue
- the restricted literal value- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public static PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Element owner, StructuredProperty property, StructureInstance value) Creates a property value restriction axiom on a structured property and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularyowner
- the given restricting owner (classifier or classifier equivalence axiom)property
- the given structured propertyvalue
- the restricted structure instance value- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertyValueRestrictionAxiom
public static PropertyValueRestrictionAxiom addPropertyValueRestrictionAxiom(Vocabulary vocabulary, Element owner, Relation relation, NamedInstance value) Creates a value 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)relation
- the given relationvalue
- the restricted named instance value- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addPropertySelfRestrictionAxiom
public static PropertySelfRestrictionAxiom addPropertySelfRestrictionAxiom(Vocabulary vocabulary, Element owner, Relation relation) 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)relation
- the given relation- Returns:
- a property value restriction axiom that is added to the given vocabulary
-
addKeyAxiom
public static KeyAxiom addKeyAxiom(Vocabulary vocabulary, Entity domain, List<Property> keyProperties) Creates a key axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomain
- the given keyed (entity) domainkeyProperties
- the list of properties that are part of the key- Returns:
- a key axiom that is added to the given vocabulary
-
addInstanceEnumerationAxiom
public static InstanceEnumerationAxiom addInstanceEnumerationAxiom(Vocabulary vocabulary, Concept domain, List<ConceptInstance> instances) Creates an instance enumeration axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomain
- the given (concept) domaininstances
- the list of concept instances- Returns:
- an instance enumeration axiom that is added to the given vocabulary
-
addLiteralEnumerationAxiom
public static LiteralEnumerationAxiom addLiteralEnumerationAxiom(Vocabulary vocabulary, Scalar domain, Literal... literals) Creates an literal enumeration axiom and adds it to the given vocabulary- Parameters:
vocabulary
- the context vocabularydomain
- the given (scalar) domainliterals
- the list of enumerated literals- Returns:
- a literal enumeration axiom that is added to the given vocabulary
-
addTypeAssertion
public static TypeAssertion addTypeAssertion(Description description, NamedInstance instance, Entity type) Creates a type assertion and adds it to the given description- Parameters:
description
- the context descriptioninstance
- the given named instancetype
- the given type- Returns:
- a type assertion that is added to the given description
-
addPropertyValueAssertion
public static PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Instance instance, ScalarProperty property, Literal literalValue) Creates a property value assertion for a scalar property and adds it to the given ontology.- Parameters:
ontology
- the context ontologyinstance
- the given instanceproperty
- the given scalar propertyliteralValue
- the asserted (literal) value of the property- Returns:
- a property value assertion that is added to the given ontology
-
addPropertyValueAssertion
public static PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Instance instance, StructuredProperty property, StructureInstance containedeValue) Creates a property value assertion for a structured property and adds it to the given ontology.- Parameters:
ontology
- the context ontologyinstance
- the given instanceproperty
- the given structured propertycontainedeValue
- the asserted contained value of the property- Returns:
- a property value assertion that is added to the given ontology
-
addPropertyValueAssertion
public static PropertyValueAssertion addPropertyValueAssertion(Ontology ontology, Instance instance, Relation relation, NamedInstance referencedValue) Creates a property value assertion for a relation and adds it to the given ontology.- Parameters:
ontology
- the context ontologyinstance
- the given instancerelation
- the given relationreferencedValue
- the asserted referenced value of the property- Returns:
- a property value assertion that is added to the given ontology
-
createArgument
public static Argument createArgument(Vocabulary vocabulary, String variable, Literal literal, NamedInstance instance) Creates an argument- Parameters:
vocabulary
- the context vocabularyvariable
- a given variable nameliteral
- a given literalinstance
- a given named instance- Returns:
- an argument
-
createTypePredicate
public static TypePredicate createTypePredicate(Vocabulary vocabulary, Type type, Argument argument) Creates a type predicate- Parameters:
vocabulary
- the context vocabularytype
- the given typeargument
- the argument bound to a value of the type- Returns:
- a type predicate
-
createRelationEntityPredicate
public static RelationEntityPredicate createRelationEntityPredicate(Vocabulary vocabulary, RelationEntity type, Argument argument1, Argument argument, Argument argument2) Creates an relation entity predicate- Parameters:
vocabulary
- the context vocabularytype
- the type of a relation instanceargument1
- 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 static PropertyPredicate createPropertyPredicate(Vocabulary vocabulary, Property property, Argument argument1, Argument argument2) Creates an relation predicate- Parameters:
vocabulary
- the context vocabularyproperty
- the given 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 static 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 static 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 static BuiltInPredicate createBuiltInPredicate(Vocabulary vocabulary, BuiltIn builtIn, Argument... arguments) Creates a builtIn predicate- Parameters:
vocabulary
- the context vocabularybuiltIn
- the given builtInarguments
- the arguments of the builtin- Returns:
- a builtIn predicate
-
createLiteral
Creates a literal from the given lexical value in the given ontology- Parameters:
value
- the lexical value of the literal- Returns:
- a literal with the given value
-
createQuotedLiteral
public static QuotedLiteral createQuotedLiteral(Ontology ontology, String value, Scalar type, String langTag) Creates a quoted literal in the given ontology- Parameters:
ontology
- the ontology contextvalue
- the lexical value of the literaltype
- the given (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
-