Class Instantiator<T extends ModelElement>
java.lang.Object
org.eclipse.esmf.metamodel.loader.AttributeValueRetriever
org.eclipse.esmf.metamodel.loader.Instantiator<T>
- All Implemented Interfaces:
Function<org.apache.jena.rdf.model.Resource,T>
- Direct Known Subclasses:
AspectInstantiator,CharacteristicInstantiator,CodeInstantiator,CollectionInstantiator,ComplexTypeInstantiator,ConstraintInstantiator,DurationInstantiator,EitherInstantiator,EncodingConstraintInstantiator,EntityInstanceInstantiator,EnumerationInstantiator,EventInstantiator,FixedPointConstraintInstantiator,LanguageConstraintInstantiator,LengthConstraintInstantiator,ListInstantiator,LocaleConstraintInstantiator,MeasurementInstantiator,OperationInstantiator,PropertyInstantiator,QuantifiableInstantiator,RangeConstraintInstantiator,RegularExpressionConstraintInstantiator,SetInstantiator,SingleEntityInstantiator,SortedSetInstantiator,StateInstantiator,StructuredValueInstantiator,TimeSeriesInstantiator,TraitInstantiator
public abstract class Instantiator<T extends ModelElement>
extends AttributeValueRetriever
implements Function<org.apache.jena.rdf.model.Resource,T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.jena.datatypes.RDFDatatypeprotected org.eclipse.esmf.samm.KnownVersionprotected org.apache.jena.rdf.model.Modelprotected final ModelElementFactoryprotected SAMMCprotected UNITFields inherited from class org.eclipse.esmf.metamodel.loader.AttributeValueRetriever
samm -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MetaModelBaseAttributesbuildBaseAttributes(org.apache.jena.rdf.model.Resource resource) protected EntityInstancebuildEntityInstance(org.apache.jena.rdf.model.Resource entityInstance, Entity type) protected ScalarValuebuildLanguageString(org.apache.jena.rdf.model.Literal literal) protected ValuebuildValue(org.apache.jena.rdf.model.RDFNode node, Optional<org.apache.jena.rdf.model.Resource> characteristicResource, Type type) Creates aValuefrom a given constant value in the RDF model.protected Optional<Characteristic>getElementCharacteristic(org.apache.jena.rdf.model.Resource collection) protected Stream<org.apache.jena.rdf.model.RDFNode>getNodesFromList(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Property property) getPropertiesModels(org.apache.jena.rdf.model.Resource elementWithProperties, org.apache.jena.rdf.model.Property rootProperty) Extracts allSAMM.Property()model elements which are referenced in the given Property List, e.g.protected Stream<org.apache.jena.rdf.model.Resource>getResourcesFromList(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Property property) protected TypegetType(org.apache.jena.rdf.model.Resource characteristicResource) protected booleanisTypeOfOrSubtypeOf(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Resource type) protected org.apache.jena.rdf.model.StatementpropertyValueFromTypeTree(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property) Methods inherited from class org.eclipse.esmf.metamodel.loader.AttributeValueRetriever
attributeValue, attributeValues, optionalAttributeValue
-
Field Details
-
modelElementFactory
-
targetClass
-
sammc
-
unit
-
model
protected org.apache.jena.rdf.model.Model model -
metaModelVersion
protected org.eclipse.esmf.samm.KnownVersion metaModelVersion -
curieDataType
protected final org.apache.jena.datatypes.RDFDatatype curieDataType
-
-
Constructor Details
-
Instantiator
-
-
Method Details
-
buildBaseAttributes
-
propertyValueFromTypeTree
protected org.apache.jena.rdf.model.Statement propertyValueFromTypeTree(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property) -
getPropertiesModels
protected List<Property> getPropertiesModels(org.apache.jena.rdf.model.Resource elementWithProperties, org.apache.jena.rdf.model.Property rootProperty) Extracts allSAMM.Property()model elements which are referenced in the given Property List, e.g.SAMM.properties(), and createsPropertyinstances for these model elements. -
getNodesFromList
protected Stream<org.apache.jena.rdf.model.RDFNode> getNodesFromList(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Property property) -
getResourcesFromList
protected Stream<org.apache.jena.rdf.model.Resource> getResourcesFromList(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Property property) -
getType
-
getElementCharacteristic
protected Optional<Characteristic> getElementCharacteristic(org.apache.jena.rdf.model.Resource collection) -
isTypeOfOrSubtypeOf
protected boolean isTypeOfOrSubtypeOf(org.apache.jena.rdf.model.Resource element, org.apache.jena.rdf.model.Resource type) -
buildValue
protected Value buildValue(org.apache.jena.rdf.model.RDFNode node, Optional<org.apache.jena.rdf.model.Resource> characteristicResource, Type type) Creates aValuefrom a given constant value in the RDF model. This can be either a scalar, a collection or an Entity. What is constructed can depend on the type of RDF node, but also on the Characteristic of the Property this value is used for.- Parameters:
node- the RDF node that represents the valuecharacteristicResource- the resources that represents the Characteristic that describes the value. This can be empty for the values of collections that have no samm-c:elementCharacterisic settype- the type that describes the value- Returns:
- a value instance
-
buildLanguageString
-
buildEntityInstance
protected EntityInstance buildEntityInstance(org.apache.jena.rdf.model.Resource entityInstance, Entity type)
-