Is your feature request related to a problem? Please describe:
CIMTool does not currently support defining facets for CIM properties that have declared types that are primitives (e.g. String, Float, Integer, etc.). As we have begun collaborating with WG 61850 on the possibility of utilizing CIMTool to generate SCL schemas the need to support facets is required to define profiles that conform to how 61850 SCL XSD schemas are defined.
The W3C standard that defines which facets can be applied to XSD primitive types is the XML Schema Part 2: Datatypes Second Edition. This document specifies the built-in datatypes and their applicable constraints and fundamental facets.
In the case of SCL XSD schemas we have the following examples that illustrates the use of XSD facets within the SCL_IEC.xsd:
<xs:attribute name="nameLength" use="optional" default="32">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:pattern value="32"/>
<xs:pattern value="64"/>
<xs:pattern value="6[5-9]"/>
<xs:pattern value="[7-9]\d"/>
<xs:pattern value="[1-9]\d\d+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
. . .
. . .
<xs:attribute name="serialNumber" use="required">
<xs:simpleType>
<xs:restriction base="xs:normalizedString">
<xs:minLength value="1"/>
<xs:pattern value="[0-9]+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Therefore, this enhancement request is for introduce support for specifying XSD facets on CIM properties defined in a profile.
Describe the solution you'd like:
The following enhancements are needed to support this feature:
- User Interface enhancements are needed to facilitate the specification of facets. Since these facets are applicable across a variety of generated schemas they can be added as new UI fields and/or components on the "Restriction" tab. Important to note is that the any new UI facet fields or components should be made context sensitive in that they should be editable/non-editable based on their applicability to the particular primitive type of the selected property.
- The table below outlines the set of facets to be implemented for this enhancement request:
-
The existing xsd.xsl, xsd-part100-ed2.xsl, json-schema-draft-07.xsl, and json-schema-draft-2020-12.xsl builders must all be updated to generate schema facets as defined in a profile.
-
Finally, the existing puml-xsd-l2r.xsl, puml-xsd-t2b.xsl, puml-json-schema-l2r.xsl, and `puml-json-schema-t2b.xsl' PlantUML builders should be evaluated to determine how to visualize (if feasible) any defined facets.
Describe alternatives you've considered:
N/A
Additional context:
- Additionally, for the JSON schema implementation the following should be considered:

Is your feature request related to a problem? Please describe:
CIMTool does not currently support defining facets for CIM properties that have declared types that are primitives (e.g. String, Float, Integer, etc.). As we have begun collaborating with WG 61850 on the possibility of utilizing CIMTool to generate SCL schemas the need to support facets is required to define profiles that conform to how 61850 SCL XSD schemas are defined.
The W3C standard that defines which facets can be applied to XSD primitive types is the XML Schema Part 2: Datatypes Second Edition. This document specifies the built-in datatypes and their applicable constraints and fundamental facets.
In the case of SCL XSD schemas we have the following examples that illustrates the use of XSD facets within the
SCL_IEC.xsd:Therefore, this enhancement request is for introduce support for specifying XSD facets on CIM properties defined in a profile.
Describe the solution you'd like:
The following enhancements are needed to support this feature:
The existing
xsd.xsl,xsd-part100-ed2.xsl,json-schema-draft-07.xsl, andjson-schema-draft-2020-12.xslbuilders must all be updated to generate schema facets as defined in a profile.Finally, the existing
puml-xsd-l2r.xsl,puml-xsd-t2b.xsl,puml-json-schema-l2r.xsl, and `puml-json-schema-t2b.xsl' PlantUML builders should be evaluated to determine how to visualize (if feasible) any defined facets.Describe alternatives you've considered:
N/A
Additional context: