cimug-org / CIMTool

CIMug's CIMTool for the Common Information Model (CIM).
http://cimtool.ucaiug.io/
GNU Lesser General Public License v2.1
40 stars 5 forks source link

CIMTool v 1.11.1: Allowing multiple profiles per class does not rename the ComplexType when class is concrete #77

Closed biverson62 closed 8 months ago

biverson62 commented 10 months ago

When the same class is added multiple times - for different configurations, the classes are defaulted to "classname" and "classname1". These names can be changed in the description tab to reflect the named configurations. (such as IdentifiedObject_mrid and IdentifiedObject_mridName) If these classes are abstract - the ComplexNames are the same as entries in the Description tab - or the defaulted names given when they were added. This is all good. The problem arises when the classes are concrete. Once the classes are changed to concrete - only the Element names are set to the names entered in the Description (or the defaulted names) and the ComplexType names remain the same originating name which now poses a problem because all ComplexTypes must be unique within a profile. If the same class is chosen such as MarketDocument twice - one named BidDocument and the other TradeDocument and they are made to be concrete, the generated XSD has an error because the names are not propagated to the ComplexTypes - instead both ComplexTypes are named MarketDocument and the XSD has an error. This issue must have been recently introduced, as earlier versions of CIMTool carried the changed named types to the Complex type name if the class became a concrete class. Its odd, because when looking into the OWL, everything looks good. Its only in the generated XSD - where the element and complexType are not correct. Let me know if you want an example and I can generate one for you. Thanks!!

tviegut commented 10 months ago

@biverson62 , that would be super helpful to provide an example. Perhaps you can attach to this GitHub issue. As part of the submission would you mind attaching two additional things for your example:

  1. Enable the XML builder (as shown in the below screenshot) and attach the generated *.xml file to this issue
  2. Also include the XSD that is built that has the error.
  3. Import your example into the previous version of CIMTool that you stated is generated correctly and include the two output files as I just described in bullet points 1 & 2 above. (name that accordingly).

What version of CIMTool does it work in? CIMTool 1.10.0? 1.11.0? etc.

image

tviegut commented 8 months ago

@biverson62, after testing I confirmed that the issue was introduced in the CIMTool 1.11.1 release. The fix is simple and will be updated in both the upcoming 1.12.0 release and the new 2.0.0 release line. In the interim however, you can import an updated builder by doing the following:

Launch the Import screen and selected the option shown here:

image

Then download the .XSLT file attached to this post and import it as follows:

image

(reach out to me for the file when you are ready to regenerate your profiles and need it)

biverson62 commented 8 months ago

Todd, where or how do I find the .XSLT file you have attached to the post?