Skip to content
Snippets Groups Projects
Commit 15b805a9 authored by Jonas Schlabertz's avatar Jonas Schlabertz
Browse files

PROV model integration.

parent 8b41bff8
Branches
No related tags found
No related merge requests found
Pipeline #159765 passed
No preview for this file type
......@@ -169,7 +169,7 @@ export default class ComponentInformation {
toJSONLD(): Record<string, unknown> {
const document: Record<string, unknown> = {
"@context": ContextDefinitions.information(this.type.context, this.previousVersion, this.nextVersion),
"@type": "ComponentInformation",
"@type": "prov:Entity",
"identifier": { "@id": `${config.baseURL}/information/${this.id.toString()}` },
"dateCreated": this.dateCreated.toISOString(),
"name": this.name,
......@@ -185,11 +185,11 @@ export default class ComponentInformation {
};
if(this.nextVersion) {
document.nextVersion = { "@id": `${config.baseURL}/information/${this.nextVersion.id.toString()}` };
document["prov:hadRevision"] = { "@id": `${config.baseURL}/information/${this.nextVersion.id.toString()}` };
}
if(this.previousVersion) {
document.previousVersion = { "@id": `${config.baseURL}/information/${this.previousVersion.id.toString()}` };
document["prov:wasRevisionOf"] = { "@id": `${config.baseURL}/information/${this.previousVersion.id.toString()}` };
}
return document;
......
......@@ -119,9 +119,11 @@ export default class Measurement {
toJSONLD(): Record<string, unknown> {
const document: Record<string, unknown> = {
"@context": ContextDefinitions.measurement(this.valueType.context, this.metadataType?.context),
"@type": "prov:Entity",
"identifier": { "@id": `${config.baseURL}/measurement/${this.id.toString()}` },
"dateCreated": this.dateCreated.toISOString(),
"license": { "@id": this.license },
"prov:hadPrimarySource": { "@id": `${config.baseURL}/information/${this.componentInformation.id.toString()}` },
"value": this.value
};
......
......@@ -22,7 +22,8 @@ const information = function(metadataContext: unknown, previousVersion: Componen
"comment": "https://schema.org/comment",
"informationLicense": "https://www.w3.org/1999/xhtml/vocab#license",
"measurementLicense": "https://www.w3.org/1999/xhtml/vocab#license",
"topic": "https://schema.org/text"
"topic": "https://schema.org/text",
"prov" : "http://www.w3.org/ns/prov#"
};
if(previousVersion) {
......@@ -38,6 +39,7 @@ const information = function(metadataContext: unknown, previousVersion: Componen
const measurement = function(valueContext: unknown, metadataContext: unknown | undefined): Record<string, unknown> {
const result: Record<string, unknown> = {
"prov" : "http://www.w3.org/ns/prov#",
"id": { "@id": "https://schema.org/url", "@type": "@id"},
"dateCreated": "https://schema.org/dateCreated",
"license": "https://www.w3.org/1999/xhtml/vocab#license",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment