RDF

The encodings ontology as Turtle and JSON-LD are directly based on the UML model. They are generated with the UCMIS Model-to-Text tool.

Ontology as Turtle

  • Main file ddi-cdi.onto.ttl

  • Fragments per class and data types are available in the field-level documentation of DDI-CDI. See the section ‘encodings’ on the bottom of the example InstanceVariable.

Generator Code for Ontology as Turtle

Acceleo code for generating Turtle on the basis of UML classes.

classOnto.mtl
 1[comment encoding = UTF-8 /]
 2[module classOnto('http://www.eclipse.org/uml2/5.0.0/Types', 'http://www.eclipse.org/uml2/5.0.0/UML', 'http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard')]
 3
 4[import ucmis::m2t::query::modelQuery /]
 5[import ucmis::m2t::target::rdf::commonRdf /]
 6[import ucmis::m2t::target::onto::associationOnto /]
 7[import ucmis::m2t::target::onto::commonOnto /]
 8
 9[template public classOnto(aClass : Class)]
10# class [aClass.name/]
11# based on the UML class [aClass.qualifiedName/]
12[aClass.iri()/]
13  a rdfs:Class, owl:Class, ucmis:Class;
14  rdfs:label "[aClass.name/]";
15  [rdfs_comment(aClass.ownedComment)/]
16  [aClass.superClasses()/]
17.
18
19[for ( anAttribute : Property | aClass.e_attributes() ) ]
20[anAttribute.attributeOnto()/]
21[/for]
22
23[for ( anAssociation : Association | aClass.eInverse(Association) ) ?(anAssociation.source() = aClass) ]
24[anAssociation.associationOnto(aClass)/]
25[/for]
26[/template]
Source files at UCMIS M2T repository.

JSON-LD

  • Main file ddi-cdi.jsonld

  • Fragments per class and data types are available in the field-level documentation of DDI-CDI. See the section ‘encodings’ on the bottom of the example InstanceVariable.