Source links
Currently there are a number of source files needed to get a complete view of the AAI schema information:
- .xsd file in correct version: https://gerrit.onap.org/r/gitweb?p=aai/schema-service.git;a=tree;f=aai-schema/src/main/resources/onap/aai_schema;hb=d4f97e683cb971ceb7107beaaca628926156a4f6
- DB edge rules (.json) in correct version: https://gerrit.onap.org/r/gitweb?p=aai/schema-service.git;a=tree;f=aai-schema/src/main/resources/onap/dbedgerules;hb=3501e74711a2e91ce84d0b4cbc989738f96e0891
- Possibly also traversal information (.json): https://gerrit.onap.org/r/gitweb?p=aai/traversal.git;a=tree;f=aai-traversal/src/main/resources/schema/onap/query;hb=600abffda37ce3aba83024162dc7178d90b84c26
Next step is to combine these source files into a single XML schema file, probably using an XSLT script – this step is still TBD
This single XML schema file can then be imported into Eclipse/Papyrus using the Ecore modeling framework.
Auto-generated documentation of the AAI schema is the most complete at the moment (created by an OpenAPI/Swagger-like process).
- Source HTML file: https://lf-onap.atlassian.net/wiki/download/attachments/16351755/aai_swagger_v16.html?api=v2
- Stored here: AAI REST API Documentation - Dublin
- Originals stored in NEXUS:
- https://nexus.onap.org/service/local/repositories/releases/archive/org/onap/aai/schema-service/aai-schema/1.0.6/aai-schema-1.0.6.jar/!/onap/aai_swagger_html/aai_swagger_v16.html
- https://nexus.onap.org/service/local/repositories/releases/archive/org/onap/aai/schema-service/aai-schema/1.5.0/aai-schema-1.5.0.jar/!/onap/aai_swagger_html/aai_swagger_v16.html
Problems encountered when working with the AAI model structure:
- AAI uses RelationshipList as a generic linking class everywhere in the model – needs to be collapsed into the actual links
- AAI uses collection classes (ex. Pnfs as a collection for Pnf) that add no information – need to be filtered out
Ideas regarding how to do the reverse-engineering with a minimum of manual rework of the model (NOTE: most of these are still TODO):
- Convert XSD directly to UML – see Step-by-step to generate Papyrus UML model from XSD file
...
1) Create a new Eclipse project
2) Import the .xsd into the project from file system
2a)
2b)
3) Select the .xsd and create an EMF Generator Model (under "Other")
3a)
3b)
4) Select the model and export to UML
4a)
4b)
5) Select UML model and create new Papyrus model
6) Create a new class diagram and drag-and-drop the wanted elements onto it. Done!
...
- . This method is inspired by these discussion threads:
- Generate UML model from OpenAPI (a.k.a. Swagger) YAML file, see https://github.com/opendata-for-all/wapiml and https://modeling-languages.com/openapi-to-uml/
- Generate UML model from JSON schema documents, see https://github.com/SOM-Research/jsonSchema-to-uml
Copy metadata in the .xsd file to XML tags that can be parsed by Ecore
- Combine the source files into a single XSD (XML schema file) using an XSLT script?
- Generate UML from OXM file, e.g. by model-browser script