The EU’s JOINUP initiative, more specific the SEMIC workgroup, published a set of rules for turning UML into RDF. These rules boost knowledge engineering because they bridge the gap between UML conceptual models and concepts expressed as triples. This article highlights an AddOn for Enterprise Architect that lets users easily reuse existing ontologies in UML and publish ontologies as RDF.
I’m an ontologist – why bother with UML ?
The Unified Modelling Language is the most widely used to visually capture concepts in all kinds of business. RDF and OWL remain semantically richer than UML class models but UML still rules the roost.
There’s a divide between IT engineers and ontologists. IT engineers and domain experts enjoyed different training and education. The SEMIC ruleset applies for a small subset of UML class modelling and suffices to cover much knowledge engineering.
IJzerweg developed an AddOn for Sparx Enterprise Architect that honours the FAIR principles and bridges the divide between IT engineers, ontologists and domain experts.
Loading ontologies is easy. A set of well-known ones such as foaf and dct are preloaded. Many others can be retrieved from the web by clicking selecting a URI that points to an RDF file.
The AddOn then inserts classes that match the concepts defined in the ontologies. The classes are stored in packages that match a namespace. The packages are named after the prefix, e.g. adms, bibo, etc.
The tool can load one or more ontologies, either in one step or in several stages.
Accessing concepts is best done by finding the URI that points to an RDF file, e.g. turtle. The AddOn retrieves the triples and turns them into classes, attributes and properties. The semantics are copied into the notes and the URI’s are stored in a tagged value.
Below example shows the folder structure that appears after importing the Person ontology from http://www.w3.org/ns/person. This defines the concept Person with attributes birthName and patronymicName.
The tool is clever and creates empty classes that are defined externally. For instance, the concept person refers to a location to indicate place of birth and death. The concept “Location” is defined in Dublin Core Types and inserted as an empty class in the dct folder when the Person ontology is imported.
The user may wish to explicitly import the Dublin Core Type ontology at a later stage. The AddOn detects the presence of the dct folder with the Location class and enriches the Location class with extra information such as a semantic note.
Thus, a user can expand and explore the known universe by importing ontologies sequentially or in parallel without the fear of clobbering anything.
Imported triples link to triples defined in other ontologies. And by this virtue share the same properties and semantics. Data values declare units, e.q. S.I. or imperial so reducing the probability of mishaps in data conversions. Short, we know what we’re talking about, what features we’re observing and how features, are measured, e.g. in metres or candela per square foot.
Below screenshot shows that the Person’s birthName and patronymic name are an rdfs:Literal. Anyone else who uses this definition of a Person is aware of this.
The Officer, defined locally, has an optional attribute “in service since” which is defined as xsd:gYear. The officer has exactly one buddy. The hierarchy relations are expressed by the bidirectional association “is superior of” and “is subordinated to”. The namespace of the Officer concept is defined in a tagged value defined in the package that contains the Officer class.
Publically available ontologies deserve better exposure and reuse. Simply import the ontology into EA and explore hidden gems. Try explore the LOV website for a concept in your domain and download the ontology that defines it. The tool automagically adds folders to the EA browser. Next explore what’s inside by dropping the classes into a diagram. Inspect the attributes, relations and read the imported notes at your leisure. More likely than not, someone else has already defined what you’re looking for.
Why reinvent the wheel if you can climb on the shoulders of giants.
Share stuff
At some stage you’ll want to share RDF. Right click and select “transform selected package”.
Add trust
The transformation process produces a log that shows progress. The log is stored in a file. It’s good practice to inspect the log for warnings and error messages. For instance, the AddOn needs information how to build a URI for each concept. If this is missing, the tool reports an error.
check the log
The log classifies messages as information, warning or error. The AddOn provides context in an attempt to explain and hint for remedies. In below example, the AddOn failed to construct an URI for a connector that links two elements in two namespaces. The tool can’t decide for itself whether the property lives in the referring or referred namespace so it reports an error.
The AddOn is multilingual. Below version speaks Dutch to match my Windows machine.
22-6-2024 15:59:00 Information – Class Officer getransformeerd
22-6-2024 15:59:00 Information – Class MilitaryPoliceOfficer getransformeerd
22-6-2024 15:59:00 Information – Tagged value skos:definition vervangt een bestaand triple http://ijzerweg.nl/ns/police#RegionalUnit , http://www.w3.org/2004/02/skos/core#definition , A formal organisation for keeping societal order in a given region@en
22-6-2024 15:59:00 Error – Er is geen URI vastgesteld voor runsPoliceStation
22-6-2024 15:59:00 Hint – Dit gebeurt meestal als de connector twee klassen uit verschillende namespaces koppelt.
Een associatie wordt op een object property afgebeeld welke een URI toegewezen krijgt,
22-6-2024 15:59:00 Hint – Dus wanneer een connector twee namespaces koppelt, is de namespace van de object property niet eenduidig.
Overweeg om een base-uri tagged waarde toe te wijzen aan het doel van de connector
22-6-2024 15:59:00 Information – Class RegionalUnit getransformeerd
The triple grid
The triple grid lists the produced subject-predicate-object triples. A link to the applied SEMIC site lets the user check which transformation rule was applied. This feature adds trust to the transformation process and helps users understand how UML turns into triples.
When you click a triple, the AddOn opens a diagram and highlights a UML element. The element in focus contains the information, i.e. attribute or relation, that governed the creation of the triple. Thus the user can easily check the match between triples and original model.
In below example, the user clicked the triple Rank_Hoofdinspecteur – rdf:type – skos:concept. The AddOn highlighted the “Rank”-enumeration that indeed displays the rank “Hoofdinspecteur”
The user can click on the link “D.05” which leads to the rule in the guide.
Turtle
Once happy with the produced triples, hit the transform button at the top of the triple grid. This produces a set of turtle files
- core ontology which defines the concepts
- restrictions which define triples used for OWL reasoning
- shapes which define shacl shapes
- merged ontology of all triples.
Please contact bob at ijzerweg dot nl if you’re interested in the Add-On for Sparx Enterprise Architect