The code was developed and tested for Cameo Systems Modeler v19.0 SP2 and v19.0 SP4.
The Cameo2RDF plugin is available as a zip file as an artifact TODO: insert location
- Unzip cameo2rdfplugin-X.Y.zip
- Copy the cameo2rdfplugin-X.Y folder into your {Cameo root dir}/plugins folder.
- Restart Cameo
The other files which are part of the artifact publication can be ignored.
The zip file contains the plugin code as a jar, as well as a plugin.xml file, and a lib folder with the jar dependencies. Cameo can then load the Cameo2RDF plugin during runtime.
Open any SysML model, select the top-level model element in the containment view at the top left, right-click and select SysML to RDF-> Generate RDF. The generated RDF will appear at {Cameo root dir}/generated_rdf.ttl.
- Set the CAMEO_INSTALL_DIR environment variable to point to the root installation directory of Cameo
- Run gradle build in the root directory.
- The built version of the Cameo plugin folder will be located at /build/pluginzip/cameo2rdfplugin.zip
The Cameo2RDF plugin treats every SysML element as an EMF EObject and performs the transformation to RDF independent of the SysML schema. The implementation code is thus very simple.
The transformation starts with the top-level SysML model element and then automatically traverses through its children and children of children etc. (e.g. SysML packages , SysML blocks, SysML part properties, etc.).
The transformation does not distinguish between user-defined SysML packages and imported "library" SysML packages. Without filter, the transformation would transform not just the SysML model into RDF, but also all imported packages such as related to the QUDV units or the UML metamodel, resulting in a big RDF file. In order to prevent the tranformation of unnecessary packages, the implementation is currently set to ignore the packages listed below, as well as certain types of SysML elements.
Ignored Packages:
- SysML
- Matrix Templates Profile
- UML Standard Profile
- QUDV Library
- QUDV
- PrimitiveValueTypes
- MD Customization for SysML
- ISO-80000
- ISO-80000-Extension
- MD_Customization_for_ViewsViewpoints
- MD_Customization_for_Requirements
- Free_Form_Elements_Profile
- MagicGrid_Profile
- ParametricExecutionProfile
- SimulationProfile
Ignored SysML Elements
- profile_application
- profile
- stereotype
- element_import
- diagram
- extension_end
- extension
Identifiers of SysML elements can contain spaces or special characters. However, the equivalent identifier of a SysML element in RDF is a URL which cannot contain special characters.
Therefore, percent-encoding was used to ensure that all generated URLs in RDF are valid. Percent-encoding, also known as URL encoding, is a method to encode arbitrary data in a Uniform Resource Identifier (URI) using only the limited US-ASCII characters legal within a URI.
Right now, the list of ignored packages and SysML elements is hard-coded in the implementation. Ideally, a user could define this info in a file which would be an input to the transformation.
These aspects rleated to URLs in the generated RDF are right now hard-coded. They could be configurable and defined in an input file for the transformation
- baseURL of all generated RDF resources
- location of generated RDF
- RDF syntax (right now just Turtle)
- Command-line tool
- AWS lambda function
The transformation could be packaged as a standalone OSGI application for automated tests without needing to launch Cameo manually.