Mappings - Currently 78% LIES!
Problem
In several use cases a user want to be able to query for a concept in the JobTech Taxonomy and receive a record or ID corresponding to some external data collection or structure.
Currently the JobTech Taxonomy have some support for this, but not in a generalised way that allows versioned mappings. The workaround for this is to add fields with versioned names. But this makes it hard to describe how the fields are related and each new version requires a new field.
To be able to represent generalised mappings in a datalog database system.
Reasoning
The mapping is separated into a mapping description and a collection of edges that defines the mapping.
Mapping Description
A mapping is represented by a mapping entity
with the required :mapping.mapping/type
attribute set to the keyword :mapping
. Future work may define further keywords that may be used to represent different kind of mappings.
Additional optional attributes for a mapping entity
are:
family
(i.e."EURES"
) Describing that the mapping belongs to a related collection of mappings.name
(i.e."ESCO"
) Describing that the mapping is a specific type of mapping.version
(i.e."1.0.9"
) For mappings that may change over versions.description
(i.e."Some informative text."
) For the API to present to users.url
(i.e."https://example.com"
) A link to further information.testing
(i.e."alpha"
) If the mapping is not yet finalised.bi-directional
(i.e.false
) If the mapping is not trivially reversible.
Other mathematical properties of the mapping could be added. Such as if it is a total mapping of every entity in the JobTech Taxonomy or not, how it behaves together with other mappings and similar.
The only required property of the mapping entity
is that it has an entity ID. The rest are arbitrary and depend on the use case. The mapping should however have a type
attribute that designates it as a mapping
.
This type
may be implemented as a concept-type
if this can be done without affecting the semantics of the concept
entity. It could also be implemented as a new attribute signalling that it is separate from the core JobTech Taxonomy data.
Mapping Edges
Every edge in the mapping is defined by an edge entity
. An edge entity
has a collection of mapping entities
under which it is valid. It also has a source
and a target
attribute that references entities in the database. Where the source
is mapped to target
according to descriptions in the mapping entity
.
An edge entity
can be valid under multiple mapping entities
.
Usage
First create a mapping entity
for the collection that is to be mapped. Then, for each source entity
that needs to be mapped add an edge entity
and a target entity
. An alternative is to update valid existing edges.
To find the desired mapping target for a given concept a query would first find the entity ID of the mapping, then query for edges from the concepts entity id that are valid under that mapping.