Class DataType


  • public class DataType
    extends Object
    This class acts as the bridge between the scalar types used in RDF (XSD/RDF/BAMM-specific (i.e. bamm:curie)) and their representations in Java. It implements RDFDatatype in order to register the types directly in the Jena RDF parser. The actual registration is performed by calling setupTypeMapping().
    • Method Detail

      • setupTypeMapping

        public static void setupTypeMapping()
        Idempotent method to register the BAMM type mapping in the Jena RDF parser.
      • getSupportedXsdTypes

        public static List<org.apache.jena.datatypes.RDFDatatype> getSupportedXsdTypes()
        Returns all XSD types supported in Aspect models
        Returns:
        the list of supported XSD types
      • getAllSupportedTypes

        public static List<org.apache.jena.datatypes.RDFDatatype> getAllSupportedTypes()
        Returns the list of all supported DataTypes, which is equivalent to the union of getSupportedXsdTypes() and DataTypes for bamm:curie of all known meta model versions ({@see KnownVersion}).
        Returns:
        the list of all supported types
      • getAllSupportedTypesForMetaModelVersion

        public static List<org.apache.jena.datatypes.RDFDatatype> getAllSupportedTypesForMetaModelVersion​(io.openmanufacturing.sds.aspectmetamodel.KnownVersion metaModelVersion)
        Returns the list of all supported DataTypes of a given meta model version, which is equivalent to the union of getSupportedXsdTypes() and the DataType for bamm:curie corresponding to the meta model version.
        Parameters:
        metaModelVersion - the given meta model version
        Returns:
        the list of all supported types in the meta model version
      • getJavaTypeForMetaModelType

        public static Class<?> getJavaTypeForMetaModelType​(org.apache.jena.rdf.model.Resource type,
                                                           io.openmanufacturing.sds.aspectmetamodel.KnownVersion metaModelVersion)
        Returns the Java class corresponding to a XSD type in a given meta model version.
        Parameters:
        type - the resource of the data type
        metaModelVersion - the given meta model version
        Returns:
        the java class