Replies: 1 comment
-
This is certainly a challenge! Here's an experiment that I called hqdmAllAsData. The aim was to represent the model HQDM in a format that was consistent with the data that is generated using Magma Core. I have attached the resulting file at the end of this comment. The result is a graph-like format that holds all the computable information* that it is logically possible to have in a given dataset that is isomorphic to Magma Core and HQDM (assuming that the implementation of the application code is a faithful use of HQDM itself and it references the HQDM entity uuids). Why did I want to do this?
The aim of this exercise was to maximise internal consistency with minimal reliance on external definitions. Very little use is made of RDFS as it is a specification external to the dataset that requires interpretation. There are a few (minimal) rules to relate the data to HQDM as documented (originally in the EXPRESS data modelling notation). Only one additional predicate beyond what is in the Magma Core HQDM.java IRI set is needed (has_supertype). The rules are (assuming a IRI prefix of TYPE identity: Each node is based on a hqdm:. This is the unique identifier of that node. These should never be changed. TYPE mapping to HQDM using HQDM type names as docmented. In RDF a HQDM Type is treated as a rdfs:class, with a node being of that type (using a rdf:type declaration**):
Subtype - Supertype Declaration. Two predicates, has_supertype and has_superclass, are used to achieve this. For this dataset they are equivalent to the EXPRESS SUPERTYPE declaration. As HQDM has an
HQDM relationships as documented. All the HQDM relationships are predicates in this datasets and are all named as in the HQDM documentation. The inheritance of relationships down the type hierarchy are given. Binding to the Magma Core (V1.0.0 tag) Java classes. This is done using class_name to declare the Java class that represents each type in Magma Core. This is the only predicate that is implementation-specific and can be safely removed or replaced if an alternative implementation is used. It is possible to test the V1.0.0 tagged version of Magma Core (and, with class path changes to the Finally, this was an experiment so there may be wrinkles with it. It has been used in a trial application and works well to compute the type hierarchy from any Magma Core data object to the root hqdm:thing and to determine the relationships required for HQDM-based data model designs. There may be better ways of doing this but hopefully it shows some potential. * It isn't necessarily enough to generate new information and add it to the 'graph' but it is enough to allow two or more data to be added and parsed (queried, compared, etc) TTL file: |
Beta Was this translation helpful? Give feedback.
-
HQDM has no standard form as data. A copy of the original EXPRESS model exists along with the Java classes presented here and the HQDM book that describes the EXPRESS, but there are some errors in it.
HQDM needs a reference copy in some modelling language that can then be used to derive standard formats in, say, RDF, JSON, XML, JSON-LD, graph databases, relational databases, triple stores, etc. as needed, but also as a single source of truth for bindings to Java classes and other programming languages.
MagmaCore data models need access to a copy of HQDM as RDF triples in a Jena database to support queries that need to be aware of the model structure, such as 'find all objects that are of type
System
or one of its subtypes', and such queries need to work for model extensions describe in #51 .Beta Was this translation helpful? Give feedback.
All reactions