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
[comment encoding = UTF-8 /]
[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')]

[import ucmis::m2t::query::modelQuery /]
[import ucmis::m2t::target::rdf::commonRdf /]
[import ucmis::m2t::target::onto::associationOnto /]
[import ucmis::m2t::target::onto::commonOnto /]

[template public classOnto(aClass : Class)]
# class [aClass.name/]
# based on the UML class [aClass.qualifiedName/]
[aClass.iri()/]
  a rdfs:Class, owl:Class, ucmis:Class;
  rdfs:label "[aClass.name/]";
  [rdfs_comment(aClass.ownedComment)/]
  [aClass.superClasses()/]
.

[for ( anAttribute : Property | aClass.e_attributes() ) ]
[anAttribute.attributeOnto()/]
[/for]

[for ( anAssociation : Association | aClass.eInverse(Association) ) ?(anAssociation.source() = aClass) ]
[anAssociation.associationOnto(aClass)/]
[/for]
[/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.