II. Connection layer
The connection layer ensures the connectivity for the current ontology elements. The structural connection describes the link with a concept located in the same ontology or in an external one. It contains a link to the location of the ontology and the connectivity details of the referenced concept.
The current architecture ensures the plasticity and stability of the structure by using versioning and property mapping mechanisms.
{
"$type": "connection",
"$version": "1.0",
"$schema": "A01564DBBCB04816A9BFE5FB50723EFD3BBE119E",
"$id": "DA4B9237BACCCDF19C0760CAB7AEC4A8359010B0",
"$author": "Andrei",
"$description": "Define a user profile connections",
"connections": {
"Profile": "A01564DBBCB04816A9BFE5FB50723EFD3BBE119E:872BBC610CB4610EA89879052EFB86CB20D58392:1.0"
},
"locations": {
"A01564DBBCB04816A9BFE5FB50723EFD3BBE119E": "https://gateway.ipfs.io/ipfs/A01564DBBCB04816A9BFE5FB50723EFD3BBE119E"
}
}
A concept’s connection layer can be described with the use of a schema. The connection layer schema should follow the structure described in the above JSON. Identifiers for the ontology and the concept are kept in the header field. All reference properties are persisted into the connection list. A connection represents a pair composed of a property name and a concept link, where the concept link has the following attributes:
- ontology identifier
- concept identifiers
- version
Concept links can point to concepts from the current ontology or concepts in external ontologies. If an external ontology is used, then its location should be defined in the locations list. Property mappings between two different versions are persisted in the mapping list.
{
"$type": "connection",
"$version": "1.1",
"$schema": "A01564DBBCB04816A9BFE5FB50723EFD3BBE119E",
"$id": "DA4B9237BACCCDF19C0760CAB7AEC4A8359010B0",
"$author": "Andrei",
"$description": "Define a user profile connections",
"connections": {
"Profile": "A01564DBBCB04816A9BFE5FB50723EFD3BBE119E:872BBC610CB4610EA89879052EFB86CB20D58392:1.0"
},
"locations": {
"A01564DBBCB04816A9BFE5FB50723EFD3BBE119E": "https://gateway.ipfs.io/ipfs/A01564DBBCB04816A9BFE5FB50723EFD3BBE119E"
},
"mappings": [
{
"lastSeen": {
"1.0 >1.1": "function (source , target){ target.lastSeenDate = date(source.lastSeen); target.lastSeenTime = time(source.lastSeen); }",
"1.1 >1.0": "function (source , target){ target.lastSeen = dateTime(source.lastSeenDate, source.lastSeenTime); }"
}
}
]
}
A mapping between two properties is a pair of forward and backward transformation functions. The above JSON represents a transformation mapping, it contains information regarding property name, source and target version and the mapping functions.
The forward function maps version source-version to target-version, while the backward function represents the inverse mapping. The content of any mapping function is a function definition with the following format:
function ($source, $target) {
$function - body
}
The forward-function $source
represents the concept from the source_version ontology and
$target
is the concept from the target_version while for the backward-function the mapping
is reversed.
The format of the $function-body
is highly correlated with the ontology implementation,
a Turing complete language is recommended for it, so that it may perform any transformation. Also, for better
performance, mapping functions should be as simple as possible.