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 Details

    • modelElementFactory

      protected final ModelElementFactory modelElementFactory
    • targetClass

      protected Class<T extends ModelElement> targetClass
    • sammc

      protected SAMMC sammc
    • unit

      protected UNIT 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

  • Method Details

    • buildBaseAttributes

      protected MetaModelBaseAttributes buildBaseAttributes(org.apache.jena.rdf.model.Resource resource)
    • 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 all SAMM.Property() model elements which are referenced in the given Property List, e.g. SAMM.properties(), and creates Property instances for these model elements.
      Parameters:
      elementWithProperties - the Resource which has the propertyRdfClass list for which the model elements are extracted
      rootProperty - the Property defining the property list
      Returns:
      a List containing the Property instances
    • 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

      protected Type getType(org.apache.jena.rdf.model.Resource characteristicResource)
    • 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 a Value from 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 value
      characteristicResource - 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 set
      type - the type that describes the value
      Returns:
      a value instance
    • buildLanguageString

      protected ScalarValue buildLanguageString(org.apache.jena.rdf.model.Literal literal)
    • buildEntityInstance

      protected EntityInstance buildEntityInstance(org.apache.jena.rdf.model.Resource entityInstance, Entity type)