diff --git a/API.paw b/API.paw index 071cb5ae605066d9cf7866994ea3bb596249d413..70b1fc8df8c4da1002cc2433e7f33371487bbba2 100644 Binary files a/API.paw and b/API.paw differ diff --git a/src/entity/ComponentInformation.ts b/src/entity/ComponentInformation.ts index ec847320450772790ca9ecd8df5baf18df5a5a99..3a5e3c0b4132b8455d0b30a6a1e59a7c61aa6619 100644 --- a/src/entity/ComponentInformation.ts +++ b/src/entity/ComponentInformation.ts @@ -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; diff --git a/src/entity/Measurement.ts b/src/entity/Measurement.ts index 5f227cde78edca02056c29c79893b66ee5e05616..a4576d95a2aaa81bb07cb717e24e5e92722a68f5 100644 --- a/src/entity/Measurement.ts +++ b/src/entity/Measurement.ts @@ -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 }; diff --git a/src/util/ContextDefinitions.ts b/src/util/ContextDefinitions.ts index 61f614d59bc7c755a6ad1eb6b84df1bbb0ec6e6b..1367eb08a0d43daca403313714e1fe5f88cdd652 100644 --- a/src/util/ContextDefinitions.ts +++ b/src/util/ContextDefinitions.ts @@ -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",