diff --git a/packages/oslo-converter-stakeholders/package.json b/packages/oslo-converter-stakeholders/package.json index 7a87370..1064e31 100644 --- a/packages/oslo-converter-stakeholders/package.json +++ b/packages/oslo-converter-stakeholders/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/stakeholders-converter", - "version": "0.0.14-alpha.0", + "version": "0.0.15-alpha.0", "description": "Converts an OSLO stakeholders csv file to a different format", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-converter-stakeholders-oslo#readme", @@ -29,7 +29,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "csv-parse": "^5.3.6", "inversify": "^6.0.1", "reflect-metadata": "^0.1.13", diff --git a/packages/oslo-converter-uml-ea/lib/converter-handlers/AttributeConverterHandler.ts b/packages/oslo-converter-uml-ea/lib/converter-handlers/AttributeConverterHandler.ts index b221484..54dc742 100644 --- a/packages/oslo-converter-uml-ea/lib/converter-handlers/AttributeConverterHandler.ts +++ b/packages/oslo-converter-uml-ea/lib/converter-handlers/AttributeConverterHandler.ts @@ -26,9 +26,9 @@ export class AttributeConverterHandler extends ConverterHandler { public readonly config!: EaUmlConverterConfiguration; public async filterIgnoredObjects( - model: DataRegistry, + model: DataRegistry ): Promise { - model.attributes = model.attributes.filter(x => !ignore(x)); + model.attributes = model.attributes.filter((x) => !ignore(x)); return model; } @@ -36,21 +36,22 @@ export class AttributeConverterHandler extends ConverterHandler { public async convert( model: DataRegistry, uriRegistry: UriRegistry, - store: QuadStore, + store: QuadStore ): Promise { // Only attributes of elements that are on the target diagram will be passed to the output handler // and attributes that have a domain that is not an enumeration const enumerationClasses: EaElement[] = model.elements.filter( - x => x.type === ElementType.Enumeration, + (x) => x.type === ElementType.Enumeration ); model.attributes .filter( - x => + (x) => model.targetDiagram.elementIds.includes(x.classId) && - !enumerationClasses.some(y => y.id === x.classId), + !enumerationClasses.some((y) => y.id === x.classId) ) - .forEach(object => - store.addQuads(this.createQuads(object, uriRegistry, model))); + .forEach((object) => + store.addQuads(this.createQuads(object, uriRegistry, model)) + ); return store; } @@ -61,18 +62,18 @@ export class AttributeConverterHandler extends ConverterHandler { public async assignUris( model: DataRegistry, - uriRegistry: UriRegistry, + uriRegistry: UriRegistry ): Promise { uriRegistry.attributeIdUriMap = new Map(); - model.attributes.forEach(attribute => { + model.attributes.forEach((attribute) => { const attributeClass: EaElement | undefined = model.elements.find( - x => x.id === attribute.classId, + (x) => x.id === attribute.classId ); if (!attributeClass) { throw new Error( - `[AttributeConverterHandler]: Unable to find domain object for attribute (${attribute.path}).`, + `[AttributeConverterHandler]: Unable to find domain object for attribute (${attribute.path}).` ); } @@ -81,7 +82,11 @@ export class AttributeConverterHandler extends ConverterHandler { return; } - const externalUri: string = getTagValue(attribute, TagNames.ExternalUri, null); + const externalUri: string = getTagValue( + attribute, + TagNames.ExternalUri, + null + ); if (externalUri) { uriRegistry.attributeIdUriMap.set(attribute.id, new URL(externalUri)); return; @@ -91,7 +96,7 @@ export class AttributeConverterHandler extends ConverterHandler { const packageTagValue: string | null = getTagValue( attribute, TagNames.DefiningPackage, - null, + null ); if (packageTagValue) { @@ -100,33 +105,33 @@ export class AttributeConverterHandler extends ConverterHandler { if (!packageObjects) { throw new Error( - `[AttributeConverterHandler]: Package tag was defined (${packageTagValue}), but unable to find a related package object for attribute (${attribute.path}).`, + `[AttributeConverterHandler]: Package tag was defined (${packageTagValue}), but unable to find a related package object for attribute (${attribute.path}).` ); } if (packageObjects.length > 1) { this.logger.warn( - `[AttributeConverterHandler]: Multiple packages discovered through name tag "${packageTagValue}" for attribute (${attribute.path}).`, + `[AttributeConverterHandler]: Multiple packages discovered through name tag "${packageTagValue}" for attribute (${attribute.path}).` ); } const packageURI: URL | undefined = uriRegistry.packageIdUriMap.get( - packageObjects[0].packageId, + packageObjects[0].packageId ); if (!packageURI) { throw new Error( - `[AttributeConverterHandler]: Unable to find the URI of package (${packageObjects[0].parent}), but is needed as base URI.`, + `[AttributeConverterHandler]: Unable to find the URI of package (${packageObjects[0].parent}), but is needed as base URI.` ); } attributeBaseURI = packageURI.toString(); } else { const packageURI: URL | undefined = uriRegistry.packageIdUriMap.get( - attributeClass.packageId, + attributeClass.packageId ); if (!packageURI) { throw new Error( - `[AttributeConverterHandler]: Unable to determine the package of attribute (${attribute.path}).`, + `[AttributeConverterHandler]: Unable to determine the package of attribute (${attribute.path}).` ); } @@ -136,11 +141,13 @@ export class AttributeConverterHandler extends ConverterHandler { let localName: string = getTagValue( attribute, TagNames.LocalName, - attribute.name, + attribute.name ); if (!localName) { - throw new Error(`[AttributeConverterHandler]: Unable to determine local name for attribute (${attribute.path}). If you used a "name" tag, did you set it correctly?`) + throw new Error( + `[AttributeConverterHandler]: Unable to determine local name for attribute (${attribute.path}). If you used a "name" tag, did you set it correctly?` + ); } // Names on the diagram are not prefixed, so if this value contains @@ -160,40 +167,44 @@ export class AttributeConverterHandler extends ConverterHandler { public createQuads( object: EaAttribute, uriRegistry: UriRegistry, - model: DataRegistry, + model: DataRegistry ): RDF.Quad[] { const quads: RDF.Quad[] = []; const attributeInternalId: RDF.NamedNode = this.df.namedNode( - `${this.baseUrnScheme}:${object.osloGuid}`, + `${this.baseUrnScheme}:${object.osloGuid}` + ); + const attributeUri: URL | undefined = uriRegistry.attributeIdUriMap.get( + object.id ); - const attributeUri: URL | undefined = uriRegistry.attributeIdUriMap.get(object.id); if (!attributeUri) { throw new Error( - `[AttributeConverterHandler]: Unable to find URI for attribute (${object.path}).`, + `[AttributeConverterHandler]: Unable to find URI for attribute (${object.path}).` ); } - const attributeUriNamedNode: RDF.NamedNode = this.df.namedNode(attributeUri.toString()); + const attributeUriNamedNode: RDF.NamedNode = this.df.namedNode( + attributeUri.toString() + ); quads.push( this.df.quad( attributeInternalId, ns.oslo('assignedURI'), - attributeUriNamedNode, - ), + attributeUriNamedNode + ) ); - // Adding definitions, labels and usage notes + // Adding definitions, labels, usage notes and status this.addEntityInformation(object, attributeInternalId, quads); const packageBaseUri: URL | undefined = uriRegistry.packageIdUriMap.get( - model.targetDiagram.packageId, + model.targetDiagram.packageId ); if (!packageBaseUri) { throw new Error( - `[AttributeCOnverterHandler]: Unable to find the URI for the package in which the target diagram (${model.targetDiagram.name}) was placed.`, + `[AttributeCOnverterHandler]: Unable to find the URI for the package in which the target diagram (${model.targetDiagram.name}) was placed.` ); } @@ -203,23 +214,25 @@ export class AttributeConverterHandler extends ConverterHandler { packageBaseUri.toString(), uriRegistry.attributeIdUriMap, this.df.defaultGraph(), - quads, + quads ); // Determining the domain - const domainClass: EaElement | undefined = model.elements.find(x => x.id === object.classId); + const domainClass: EaElement | undefined = model.elements.find( + (x) => x.id === object.classId + ); if (!domainClass) { throw new Error( - `[AttributeConverterHandler]: Unable to find the domain of attribute (${object.path}).`, + `[AttributeConverterHandler]: Unable to find the domain of attribute (${object.path}).` ); } const domainInternalId: RDF.NamedNode = this.df.namedNode( - `${this.baseUrnScheme}:${domainClass.osloGuid}`, + `${this.baseUrnScheme}:${domainClass.osloGuid}` ); quads.push( - this.df.quad(attributeInternalId, ns.rdfs('domain'), domainInternalId), + this.df.quad(attributeInternalId, ns.rdfs('domain'), domainInternalId) ); // Determining the range @@ -227,26 +240,35 @@ export class AttributeConverterHandler extends ConverterHandler { let attributeType: PropertyType; if (rangeURI) { - const rangeIsLiteral: string = getTagValue(object, TagNames.IsLiteral, 'false'); + const rangeIsLiteral: string = getTagValue( + object, + TagNames.IsLiteral, + 'false' + ); attributeType = - rangeIsLiteral === 'true' ? - PropertyType.DataTypeProperty : - PropertyType.ObjectProperty; + rangeIsLiteral === 'true' + ? PropertyType.DataTypeProperty + : PropertyType.ObjectProperty; } else { const rangeLabel: string = object.type; attributeType = PropertyType.Property; - if (object.rangeClassId && model.elements.some(x => x.id === object.rangeClassId)) { - const rangeElement: EaElement = model.elements.find(x => x.id === object.rangeClassId)! + if ( + object.rangeClassId && + model.elements.some((x) => x.id === object.rangeClassId) + ) { + const rangeElement: EaElement = model.elements.find( + (x) => x.id === object.rangeClassId + )!; const rangeIsLiteral: string = getTagValue( rangeElement, TagNames.IsLiteral, - 'false', + 'false' ); attributeType = - rangeIsLiteral === 'true' ? - PropertyType.DataTypeProperty : - PropertyType.ObjectProperty; + rangeIsLiteral === 'true' + ? PropertyType.DataTypeProperty + : PropertyType.ObjectProperty; rangeURI = `${this.baseUrnScheme}:${rangeElement.osloGuid}`; if (!model.targetDiagram.elementIds.includes(rangeElement.id)) { @@ -255,78 +277,85 @@ export class AttributeConverterHandler extends ConverterHandler { this.df.namedNode(rangeURI), uriRegistry, model, - rangeElement, - ), + rangeElement + ) ); } } else if (DataTypes.has(rangeLabel)) { attributeType = PropertyType.DataTypeProperty; const rangeAssignedURI: string = DataTypes.get(rangeLabel)!; rangeURI = `${this.baseUrnScheme}:${datatypeIdentifierToHash( - rangeAssignedURI, + rangeAssignedURI )}`; quads.push( ...this.getDatatypeQuads( this.df.namedNode(rangeURI), this.df.namedNode(rangeAssignedURI), - rangeLabel, - ), + rangeLabel + ) ); } } if (!rangeURI) { throw new Error( - `[AttributeConverterHandler]: Unable to get the URI for the range of attribute (${object.path}).`, + `[AttributeConverterHandler]: Unable to get the URI for the range of attribute (${object.path}).` ); } - quads.push( this.df.quad( attributeInternalId, ns.rdfs('range'), - this.df.namedNode(rangeURI), + this.df.namedNode(rangeURI) ), this.df.quad( attributeInternalId, ns.rdf('type'), - this.df.namedNode(attributeType), + this.df.namedNode(attributeType) ), this.df.quad( attributeInternalId, ns.shacl('minCount'), - this.df.literal(object.lowerBound), + this.df.literal(object.lowerBound) ), this.df.quad( attributeInternalId, ns.shacl('maxCount'), - this.df.literal(object.upperBound), - ), + this.df.literal(object.upperBound) + ) ); // Add parent information - const parentURI: string | null = getTagValue(object, TagNames.ParentUri, null); + const parentURI: string | null = getTagValue( + object, + TagNames.ParentUri, + null + ); if (parentURI) { quads.push( this.df.quad( attributeInternalId, ns.rdfs('subPropertyOf'), - this.df.namedNode(parentURI), - ), + this.df.namedNode(parentURI) + ) ); } // Add codelist information - const codelistURI: string | null = getTagValue(object, TagNames.ApCodelist, null); + const codelistURI: string | null = getTagValue( + object, + TagNames.ApCodelist, + null + ); if (codelistURI) { quads.push( this.df.quad( attributeInternalId, ns.oslo('codelist'), - this.df.namedNode(codelistURI), - ), + this.df.namedNode(codelistURI) + ) ); } @@ -336,7 +365,7 @@ export class AttributeConverterHandler extends ConverterHandler { private getDatatypeQuads( rangeInternalId: RDF.NamedNode, rangeAssignedURI: RDF.NamedNode, - rangeLabel: string, + rangeLabel: string ): RDF.Quad[] { const quads: RDF.Quad[] = []; @@ -346,8 +375,8 @@ export class AttributeConverterHandler extends ConverterHandler { this.df.quad( rangeInternalId, ns.oslo('diagramLabel'), - this.df.literal(rangeLabel), - ), + this.df.literal(rangeLabel) + ) ); return quads; @@ -357,35 +386,45 @@ export class AttributeConverterHandler extends ConverterHandler { rangeInternalId: RDF.NamedNode, uriRegistry: UriRegistry, dataRegistry: DataRegistry, - rangeElement: EaElement, + rangeElement: EaElement ): RDF.Quad[] { const quads: RDF.Quad[] = []; - const referencedEntitiesGraph: RDF.NamedNode = this.df.namedNode('referencedEntities'); + const referencedEntitiesGraph: RDF.NamedNode = + this.df.namedNode('referencedEntities'); // TODO: switch to this.addEntityInformation? this.addDefinitions( rangeElement, rangeInternalId, referencedEntitiesGraph, - quads, + quads ); this.addLabels( rangeElement, rangeInternalId, referencedEntitiesGraph, - quads, + quads ); this.addUsageNotes( rangeElement, rangeInternalId, referencedEntitiesGraph, - quads, + quads ); - const assignedUri: URL | undefined = uriRegistry.elementIdUriMap.get(rangeElement.id); + this.addStatus( + rangeElement, + rangeInternalId, + referencedEntitiesGraph, + quads + ); + + const assignedUri: URL | undefined = uriRegistry.elementIdUriMap.get( + rangeElement.id + ); if (!assignedUri) { throw new Error( - `[AttributeConverterHandler]: Unable to find the assigned URI for the range (${rangeElement.path}) of attribute.`, + `[AttributeConverterHandler]: Unable to find the assigned URI for the range (${rangeElement.path}) of attribute.` ); } @@ -394,14 +433,16 @@ export class AttributeConverterHandler extends ConverterHandler { rangeInternalId, ns.oslo('assignedURI'), this.df.namedNode(assignedUri.toString()), - referencedEntitiesGraph, - ), + referencedEntitiesGraph + ) ); - const packageBaseUri = uriRegistry.packageIdUriMap.get(dataRegistry.targetDiagram.packageId); + const packageBaseUri = uriRegistry.packageIdUriMap.get( + dataRegistry.targetDiagram.packageId + ); if (!packageBaseUri) { throw new Error( - `[AttributeConverterHandler]: Unable to find the URI of package where target diagram (${dataRegistry.targetDiagram.path}) is placed.`, + `[AttributeConverterHandler]: Unable to find the URI of package where target diagram (${dataRegistry.targetDiagram.path}) is placed.` ); } @@ -411,18 +452,22 @@ export class AttributeConverterHandler extends ConverterHandler { packageBaseUri.toString(), uriRegistry.elementIdUriMap, referencedEntitiesGraph, - quads, - ) + quads + ); - const skosCodelist: string | null = getTagValue(rangeElement, TagNames.ApCodelist, null); + const skosCodelist: string | null = getTagValue( + rangeElement, + TagNames.ApCodelist, + null + ); if (skosCodelist) { quads.push( this.df.quad( rangeInternalId, ns.oslo('codelist'), this.df.namedNode(skosCodelist), - referencedEntitiesGraph, - ), + referencedEntitiesGraph + ) ); } diff --git a/packages/oslo-converter-uml-ea/lib/converter-handlers/ElementConverterHandler.ts b/packages/oslo-converter-uml-ea/lib/converter-handlers/ElementConverterHandler.ts index 4d63812..3bff72d 100644 --- a/packages/oslo-converter-uml-ea/lib/converter-handlers/ElementConverterHandler.ts +++ b/packages/oslo-converter-uml-ea/lib/converter-handlers/ElementConverterHandler.ts @@ -1,7 +1,13 @@ import { URL } from 'url'; import type { QuadStore } from '@oslo-flanders/core'; import { ns } from '@oslo-flanders/core'; -import type { DataRegistry, EaConnector, EaElement, EaPackage, EaTag } from '@oslo-flanders/ea-uml-extractor'; +import type { + DataRegistry, + EaConnector, + EaElement, + EaPackage, + EaTag, +} from '@oslo-flanders/ea-uml-extractor'; import { ConnectorType, ElementType } from '@oslo-flanders/ea-uml-extractor'; import type * as RDF from '@rdfjs/types'; import { injectable } from 'inversify'; @@ -13,9 +19,9 @@ import { getTagValue, ignore, toPascalCase } from '../utils/utils'; @injectable() export class ElementConverterHandler extends ConverterHandler { public async filterIgnoredObjects( - model: DataRegistry, + model: DataRegistry ): Promise { - model.elements = model.elements.filter(x => !ignore(x)); + model.elements = model.elements.filter((x) => !ignore(x)); return model; } @@ -23,15 +29,16 @@ export class ElementConverterHandler extends ConverterHandler { public async convert( model: DataRegistry, uriRegistry: UriRegistry, - store: QuadStore, + store: QuadStore ): Promise { // All elements will be processed and receive a URI, but only elements on the target diagram // will be passed to the OutputHandler. This flow is necessary because element types could be // in other packages and their URIs are needed to refer to in the output file. model.elements - .filter(x => model.targetDiagram.elementIds.includes(x.id)) - .forEach(object => - store.addQuads(this.createQuads(object, uriRegistry, model))); + .filter((x) => model.targetDiagram.elementIds.includes(x.id)) + .forEach((object) => + store.addQuads(this.createQuads(object, uriRegistry, model)) + ); return store; } @@ -42,18 +49,22 @@ export class ElementConverterHandler extends ConverterHandler { public async assignUris( model: DataRegistry, - uriRegistry: UriRegistry, + uriRegistry: UriRegistry ): Promise { uriRegistry.elementIdUriMap = new Map(); uriRegistry.elementNameToElementMap = new Map(); - model.elements.forEach(element => { - const externalUri: string | null = getTagValue(element, TagNames.ExternalUri, null); + model.elements.forEach((element) => { + const externalUri: string | null = getTagValue( + element, + TagNames.ExternalUri, + null + ); if (externalUri) { uriRegistry.elementIdUriMap.set(element.id, new URL(externalUri)); uriRegistry.elementNameToElementMap.set(element.name, [ - ...uriRegistry.elementNameToElementMap.get(element.name) || [], + ...(uriRegistry.elementNameToElementMap.get(element.name) || []), element, ]); @@ -64,7 +75,7 @@ export class ElementConverterHandler extends ConverterHandler { const packageTagValue: string | null = getTagValue( element, TagNames.DefiningPackage, - null, + null ); if (packageTagValue) { @@ -73,36 +84,36 @@ export class ElementConverterHandler extends ConverterHandler { if (referencedPackages && referencedPackages.length > 1) { this.logger.warn( - `[ElementConverterHandler]: Multiple packages discovered through name tag "${packageTagValue}".`, + `[ElementConverterHandler]: Multiple packages discovered through name tag "${packageTagValue}".` ); } if (!referencedPackages) { throw new Error( - `[ElementConverterHandler]: Package tag was defined for element ${element.path}, but unable to find the object for package ${packageTagValue}.`, + `[ElementConverterHandler]: Package tag was defined for element ${element.path}, but unable to find the object for package ${packageTagValue}.` ); } elementBaseUri = uriRegistry.packageIdUriMap.get( - referencedPackages[0].packageId, + referencedPackages[0].packageId )!; } else if (uriRegistry.packageIdUriMap.has(element.packageId)) { elementBaseUri = uriRegistry.packageIdUriMap.get(element.packageId)!; } else { this.logger.warn( - `[ElementConverterHandler]: Unable to find base URI for element (${element.path}).`, + `[ElementConverterHandler]: Unable to find base URI for element (${element.path}).` ); elementBaseUri = new URL(uriRegistry.fallbackBaseUri); } const localName: string = toPascalCase( - getTagValue(element, TagNames.LocalName, null) ?? element.name, + getTagValue(element, TagNames.LocalName, null) ?? element.name ); const elementUri = new URL(`${elementBaseUri}${localName}`); uriRegistry.elementIdUriMap.set(element.id, elementUri); uriRegistry.elementNameToElementMap.set(element.name, [ - ...uriRegistry.elementNameToElementMap.get(element.name) || [], + ...(uriRegistry.elementNameToElementMap.get(element.name) || []), element, ]); }); @@ -113,45 +124,50 @@ export class ElementConverterHandler extends ConverterHandler { public createQuads( object: EaElement, uriRegistry: UriRegistry, - model: DataRegistry, + model: DataRegistry ): RDF.Quad[] { const quads: RDF.Quad[] = []; const objectInternalId: RDF.NamedNode = this.df.namedNode( - `${this.baseUrnScheme}:${object.osloGuid}`, + `${this.baseUrnScheme}:${object.osloGuid}` + ); + const objectUri: URL | undefined = uriRegistry.elementIdUriMap.get( + object.id ); - const objectUri: URL | undefined = uriRegistry.elementIdUriMap.get(object.id); if (!objectUri) { throw new Error( - `[ElementConverterHandler]: Unable to find URI for element (${object.path}).`, + `[ElementConverterHandler]: Unable to find URI for element (${object.path}).` ); } - const objectUriNamedNode: RDF.NamedNode = this.df.namedNode(objectUri.toString()); + const objectUriNamedNode: RDF.NamedNode = this.df.namedNode( + objectUri.toString() + ); quads.push( - this.df.quad(objectInternalId, ns.oslo('assignedURI'), objectUriNamedNode), + this.df.quad(objectInternalId, ns.oslo('assignedURI'), objectUriNamedNode) ); this.addDefinitions( object, objectInternalId, this.df.defaultGraph(), - quads, + quads ); this.addLabels(object, objectInternalId, this.df.defaultGraph(), quads); this.addUsageNotes(object, objectInternalId, this.df.defaultGraph(), quads); + this.addStatus(object, objectInternalId, this.df.defaultGraph(), quads); // To be able to determine the scope of the element, // we need to compare it to the base URI of the package // which holds the target diagram. const packageBaseUri: URL | undefined = uriRegistry.packageIdUriMap.get( - model.targetDiagram.packageId, + model.targetDiagram.packageId ); if (!packageBaseUri) { throw new Error( - `[ElementConverterHandler]: Unnable to find URI for the package in which the target diagram (${model.targetDiagram.name}) was placed.`, + `[ElementConverterHandler]: Unnable to find URI for the package in which the target diagram (${model.targetDiagram.name}) was placed.` ); } @@ -161,7 +177,7 @@ export class ElementConverterHandler extends ConverterHandler { packageBaseUri.toString(), uriRegistry.elementIdUriMap, this.df.defaultGraph(), - quads, + quads ); quads.push( @@ -169,8 +185,8 @@ export class ElementConverterHandler extends ConverterHandler { object, objectInternalId, uriRegistry, - model, - ), + model + ) ); quads.push(...this.getCodelistQuads(object, objectInternalId)); @@ -179,19 +195,19 @@ export class ElementConverterHandler extends ConverterHandler { case ElementType.Enumeration: case ElementType.Class: quads.push( - this.df.quad(objectInternalId, ns.rdf('type'), ns.owl('Class')), + this.df.quad(objectInternalId, ns.rdf('type'), ns.owl('Class')) ); break; case ElementType.DataType: quads.push( - this.df.quad(objectInternalId, ns.rdf('type'), ns.rdfs('Datatype')), + this.df.quad(objectInternalId, ns.rdf('type'), ns.rdfs('Datatype')) ); break; default: throw new Error( - `[ElementConverterHandler]: Object type (${object.type}) is not supported.`, + `[ElementConverterHandler]: Object type (${object.type}) is not supported.` ); } @@ -202,23 +218,23 @@ export class ElementConverterHandler extends ConverterHandler { object: EaElement, objectInternalId: RDF.NamedNode, uriRegistry: UriRegistry, - model: DataRegistry, + model: DataRegistry ): RDF.Quad[] { const quads: RDF.Quad[] = []; // We search for a parent URI via the "parent" tag on the element // TODO: use function getTagValue to get parentURI tags const parentURITags: EaTag[] = object.tags.filter( - x => x.tagName === TagNames.ParentUri, + (x) => x.tagName === TagNames.ParentUri ); if (parentURITags.length > 0) { - parentURITags.forEach(x => { + parentURITags.forEach((x) => { quads.push( this.df.quad( objectInternalId, ns.rdfs('subClassOf'), - this.df.namedNode(x.tagValue), - ), + this.df.namedNode(x.tagValue) + ) ); }); } @@ -226,28 +242,28 @@ export class ElementConverterHandler extends ConverterHandler { // We also search for parent relationships via connectors // Connectors array is used here, because NormalizedConnectors array doesn't have this type const parentClassConnectors: EaConnector[] = model.connectors.filter( - x => + (x) => x.type === ConnectorType.Generalization && - x.sourceObjectId === object.id, + x.sourceObjectId === object.id ); - parentClassConnectors.forEach(parentClassConnector => { + parentClassConnectors.forEach((parentClassConnector) => { const parentClassObject: EaElement | undefined = model.elements.find( - x => x.id === parentClassConnector.destinationObjectId, + (x) => x.id === parentClassConnector.destinationObjectId ); if (!parentClassObject) { throw new Error( - `[ElementConverterHandler]: Unable to find parent object for class (${object.path}).`, + `[ElementConverterHandler]: Unable to find parent object for class (${object.path}).` ); } const parentInternalId: RDF.NamedNode = this.df.namedNode( - `${this.baseUrnScheme}:${parentClassObject.osloGuid}`, + `${this.baseUrnScheme}:${parentClassObject.osloGuid}` ); quads.push( - this.df.quad(objectInternalId, ns.rdfs('subClassOf'), parentInternalId), + this.df.quad(objectInternalId, ns.rdfs('subClassOf'), parentInternalId) ); // In case the parent object is not visible on the target diagram @@ -256,42 +272,44 @@ export class ElementConverterHandler extends ConverterHandler { if ( !model.targetDiagram.connectorsIds.includes(parentClassConnector.id) ) { - const parentAssignedUri: URL | undefined = uriRegistry.elementIdUriMap.get( - parentClassObject.id, - ); + const parentAssignedUri: URL | undefined = + uriRegistry.elementIdUriMap.get(parentClassObject.id); if (!parentAssignedUri) { throw new Error( - `[ElementConverterHandler]: Unable to find the assigned URI for parent of class (${object.path}).`, + `[ElementConverterHandler]: Unable to find the assigned URI for parent of class (${object.path}).` ); } - const referencedEntitiesGraph: RDF.NamedNode = this.df.namedNode('referencedEntities'); + const referencedEntitiesGraph: RDF.NamedNode = + this.df.namedNode('referencedEntities'); this.addDefinitions( parentClassObject, parentInternalId, referencedEntitiesGraph, - quads, + quads ); this.addLabels( parentClassObject, parentInternalId, referencedEntitiesGraph, - quads, + quads ); this.addUsageNotes( parentClassObject, parentInternalId, referencedEntitiesGraph, - quads, + quads ); - const packageBaseUri = uriRegistry.packageIdUriMap.get(model.targetDiagram.packageId); + const packageBaseUri = uriRegistry.packageIdUriMap.get( + model.targetDiagram.packageId + ); if (!packageBaseUri) { throw new Error( - `[AttributeConverterHandler]: Unable to find the URI of package where target diagram (${model.targetDiagram.path}) is placed.`, + `[AttributeConverterHandler]: Unable to find the URI of package where target diagram (${model.targetDiagram.path}) is placed.` ); } this.addScope( @@ -300,22 +318,22 @@ export class ElementConverterHandler extends ConverterHandler { packageBaseUri.toString(), uriRegistry.elementIdUriMap, referencedEntitiesGraph, - quads, - ) + quads + ); quads.push( this.df.quad( parentInternalId, ns.rdf('type'), ns.owl('Class'), - referencedEntitiesGraph, + referencedEntitiesGraph ), this.df.quad( parentInternalId, ns.oslo('assignedURI'), this.df.namedNode(parentAssignedUri.toString()), - referencedEntitiesGraph, - ), + referencedEntitiesGraph + ) ); } }); @@ -325,20 +343,24 @@ export class ElementConverterHandler extends ConverterHandler { private getCodelistQuads( object: EaElement, - objectInternalId: RDF.NamedNode, + objectInternalId: RDF.NamedNode ): RDF.Quad[] { const quads: RDF.Quad[] = []; // Get codelist information via "ap-codelist" tag - const codelistUri: string | null = getTagValue(object, TagNames.ApCodelist, null); + const codelistUri: string | null = getTagValue( + object, + TagNames.ApCodelist, + null + ); if (codelistUri) { quads.push( this.df.quad( objectInternalId, ns.oslo('codelist'), - this.df.namedNode(codelistUri), - ), + this.df.namedNode(codelistUri) + ) ); } diff --git a/packages/oslo-converter-uml-ea/lib/enums/Status.ts b/packages/oslo-converter-uml-ea/lib/enums/Status.ts new file mode 100644 index 0000000..e55e0ee --- /dev/null +++ b/packages/oslo-converter-uml-ea/lib/enums/Status.ts @@ -0,0 +1,5 @@ +export enum Status { + KandidaatStandaard = 'https://data.vlaanderen.be/id/concept/StandaardStatus/KandidaatStandaard', + OntwerpStandaard = 'https://data.vlaanderen.be/id/concept/StandaardStatus/OntwerpStandaard', + ErkendeStandaard = 'https://data.vlaanderen.be/id/concept/StandaardStatus/ErkendeStandaard', +} diff --git a/packages/oslo-converter-uml-ea/lib/enums/TagNames.ts b/packages/oslo-converter-uml-ea/lib/enums/TagNames.ts index bb7efba..7695b0e 100644 --- a/packages/oslo-converter-uml-ea/lib/enums/TagNames.ts +++ b/packages/oslo-converter-uml-ea/lib/enums/TagNames.ts @@ -26,5 +26,6 @@ export enum TagNames { PackageBaseUriAbbreviation = 'baseURIabbrev', ParentUri = 'parentURI', Range = 'range', - UsageNote = 'usageNote' + UsageNote = 'usageNote', + Status = 'status', } diff --git a/packages/oslo-converter-uml-ea/lib/interfaces/ConverterHandler.ts b/packages/oslo-converter-uml-ea/lib/interfaces/ConverterHandler.ts index ac83143..a187696 100644 --- a/packages/oslo-converter-uml-ea/lib/interfaces/ConverterHandler.ts +++ b/packages/oslo-converter-uml-ea/lib/interfaces/ConverterHandler.ts @@ -13,6 +13,7 @@ import { EaUmlConverterConfiguration } from '../config/EaUmlConverterConfigurati import { EaUmlConverterServiceIdentifier } from '../config/EaUmlConverterServiceIdentifier'; import { TagNames } from '../enums/TagNames'; import type { UriRegistry } from '../UriRegistry'; +import { Status } from '../enums/Status'; @injectable() export abstract class ConverterHandler { @@ -75,35 +76,42 @@ export abstract class ConverterHandler { object: T, objectInternalId: RDF.NamedNode, quads: RDF.Quad[], - graph: RDF.Quad_Graph = this.df.defaultGraph(), + graph: RDF.Quad_Graph = this.df.defaultGraph() ): void { this.addDefinitions(object, objectInternalId, graph, quads); this.addLabels(object, objectInternalId, graph, quads); this.addUsageNotes(object, objectInternalId, graph, quads); + this.addStatus(object, objectInternalId, graph, quads); } public addDefinitions( object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, - quads: RDF.Quad[], + quads: RDF.Quad[] ): void { - const apDefinitions: RDF.Literal[] = this.getTagValue(object, TagNames.ApDefinition); + const apDefinitions: RDF.Literal[] = this.getTagValue( + object, + TagNames.ApDefinition + ); this.addValuesToQuads( apDefinitions, objectInternalId, ns.oslo('apDefinition'), graph, - quads, + quads ); - const vocDefinitions: RDF.Literal[] = this.getTagValue(object, TagNames.Definition); + const vocDefinitions: RDF.Literal[] = this.getTagValue( + object, + TagNames.Definition + ); this.addValuesToQuads( vocDefinitions, objectInternalId, ns.oslo('vocDefinition'), graph, - quads, + quads ); } @@ -111,7 +119,7 @@ export abstract class ConverterHandler { object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, - quads: RDF.Quad[], + quads: RDF.Quad[] ): void { const apLabels: RDF.Literal[] = this.getTagValue(object, TagNames.ApLabel); this.addValuesToQuads( @@ -119,7 +127,7 @@ export abstract class ConverterHandler { objectInternalId, ns.oslo('apLabel'), graph, - quads, + quads ); const vocLabels: RDF.Literal[] = this.getTagValue(object, TagNames.Label); @@ -128,7 +136,7 @@ export abstract class ConverterHandler { objectInternalId, ns.oslo('vocLabel'), graph, - quads, + quads ); // The name of the object as it appears on the diagram is also provided @@ -137,7 +145,7 @@ export abstract class ConverterHandler { objectInternalId, ns.oslo('diagramLabel'), graph, - quads, + quads ); } @@ -145,27 +153,64 @@ export abstract class ConverterHandler { object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, - quads: RDF.Quad[], + quads: RDF.Quad[] ): void { - const apUsageNotes: RDF.Literal[] = this.getTagValue(object, TagNames.ApUsageNote); + const apUsageNotes: RDF.Literal[] = this.getTagValue( + object, + TagNames.ApUsageNote + ); this.addValuesToQuads( apUsageNotes, objectInternalId, ns.oslo('apUsageNote'), graph, - quads, + quads ); - const vocUsageNotes: RDF.Literal[] = this.getTagValue(object, TagNames.UsageNote); + const vocUsageNotes: RDF.Literal[] = this.getTagValue( + object, + TagNames.UsageNote + ); this.addValuesToQuads( vocUsageNotes, objectInternalId, ns.oslo('vocUsageNote'), graph, - quads, + quads ); } + public addStatus( + object: T, + objectInternalId: RDF.NamedNode, + graph: RDF.Quad_Graph, + quads: RDF.Quad[] + ): void { + const status: RDF.Literal[] = this.getTagValue(object, TagNames.Status); + + // don't process if there is no status defined + if (!status.length) return; + + // only add the status if it is a valid status and not empty + if ( + status.length && + Object.values(Status).includes(status[0]?.value) + ) { + quads.push( + this.df.quad( + objectInternalId, + ns.oslo('status'), + this.df.namedNode(status[0].value), + graph + ) + ); + } else { + this.logger.warn( + `[ConverterHandler]: Incorrect status found for ${object.path}. The status will be ignored.` + ); + } + } + /** * Determines the scope of the assigned URI of an entity * @param object - The entity to determine the scope for @@ -180,7 +225,7 @@ export abstract class ConverterHandler { packageBaseUri: string, idUriMap: Map, graph: RDF.Quad_Graph, - quads: RDF.Quad[], + quads: RDF.Quad[] ): void { const uri: URL | undefined = idUriMap.get(object.id); @@ -188,7 +233,7 @@ export abstract class ConverterHandler { if (!uri) { this.logger.warn( - `[ConverterHandler]: Unable to find the URI for object with path ${object.path}. Setting scope to "Undefined".`, + `[ConverterHandler]: Unable to find the URI for object with path ${object.path}. Setting scope to "Undefined".` ); scope = Scope.Undefined; return; @@ -203,7 +248,12 @@ export abstract class ConverterHandler { } quads.push( - this.df.quad(objectInternalId, ns.oslo('scope'), this.df.namedNode(scope), graph), + this.df.quad( + objectInternalId, + ns.oslo('scope'), + this.df.namedNode(scope), + graph + ) ); } @@ -230,9 +280,9 @@ export abstract class ConverterHandler { objectInternalId: RDF.NamedNode, predicate: RDF.NamedNode, graph: RDF.Quad_Graph, - quads: RDF.Quad[], + quads: RDF.Quad[] ): void { - values.forEach(value => { + values.forEach((value) => { quads.push(this.df.quad(objectInternalId, predicate, value, graph)); }); } @@ -243,7 +293,9 @@ export abstract class ConverterHandler { * @param name — The name of the tag */ private getLanguageDependentTag(object: T, name: TagNames): RDF.Literal[] { - const tags: EaTag[] = object.tags.filter((x: EaTag) => x.tagName.startsWith(name)); + const tags: EaTag[] = object.tags.filter((x: EaTag) => + x.tagName.startsWith(name) + ); const literals: RDF.Literal[] = []; const languageToTagValueMap = new Map(); @@ -255,14 +307,14 @@ export abstract class ConverterHandler { const tagValue: string = tag.tagValue; if (!tagValue) { this.logger.warn( - `[ConverterHandler]: Entity with path ${object.path} has an empty value for tag ${tag.tagName}.`, + `[ConverterHandler]: Entity with path ${object.path} has an empty value for tag ${tag.tagName}.` ); return; } if (languageToTagValueMap.has(languageCode)) { this.logger.warn( - `[ConverterHandler]: Entity with path ${object.path} has already a value for ${tag.tagName} in language ${languageCode}, but will be overwritten.`, + `[ConverterHandler]: Entity with path ${object.path} has already a value for ${tag.tagName} in language ${languageCode}, but will be overwritten.` ); } diff --git a/packages/oslo-converter-uml-ea/lib/output-handlers/JsonLdOutputHandler.ts b/packages/oslo-converter-uml-ea/lib/output-handlers/JsonLdOutputHandler.ts index 3d52291..fe355f0 100644 --- a/packages/oslo-converter-uml-ea/lib/output-handlers/JsonLdOutputHandler.ts +++ b/packages/oslo-converter-uml-ea/lib/output-handlers/JsonLdOutputHandler.ts @@ -33,7 +33,7 @@ export class JsonLdOutputHandler implements IOutputHandler { const versionIdQuad: RDF.Quad | undefined = store.findQuad( null, ns.prov('generatedAtTime'), - null, + null ); if (!versionIdQuad) { @@ -45,26 +45,31 @@ export class JsonLdOutputHandler implements IOutputHandler { } private async getPackages(store: QuadStore): Promise { - const packageIds: RDF.Term[] = store.findSubjects(ns.rdf('type'), ns.oslo('Package')); - return packageIds.map(id => { + const packageIds: RDF.Term[] = store.findSubjects( + ns.rdf('type'), + ns.oslo('Package') + ); + return packageIds.map((id) => { const packageQuads: RDF.Quad[] = store.findQuads(id, null, null); - const baseURIValue: RDF.Quad | undefined = packageQuads.find(x => - x.predicate.equals(ns.oslo('baseURI'))); + const baseURIValue: RDF.Quad | undefined = packageQuads.find((x) => + x.predicate.equals(ns.oslo('baseURI')) + ); if (!baseURIValue) { throw new Error( - `Unable to find base URI for package with internal id ${id.value}`, + `Unable to find base URI for package with internal id ${id.value}` ); } - const assignedURI: RDF.Quad | undefined = packageQuads.find(x => - x.predicate.equals(ns.oslo('assignedURI'))); + const assignedURI: RDF.Quad | undefined = packageQuads.find((x) => + x.predicate.equals(ns.oslo('assignedURI')) + ); return { '@id': id.value, '@type': 'Package', - ...assignedURI && { + ...(assignedURI && { assignedURI: assignedURI.object.value, - }, + }), baseURI: baseURIValue.object.value, }; }); @@ -73,7 +78,11 @@ export class JsonLdOutputHandler implements IOutputHandler { private async getClasses(store: QuadStore): Promise { const df = new DataFactory(); // Process only classes in the default graph, so not the referenced classes - const classIds: RDF.Term[] = store.findSubjects(ns.rdf('type'), ns.owl('Class'), df.defaultGraph()); + const classIds: RDF.Term[] = store.findSubjects( + ns.rdf('type'), + ns.owl('Class'), + df.defaultGraph() + ); return classIds.reduce((jsonLdClasses, subject) => { const assignedURI = store.getAssignedUri(subject); @@ -87,24 +96,27 @@ export class JsonLdOutputHandler implements IOutputHandler { const scopeQuad: RDF.NamedNode | undefined = store.getScope(subject); const parentQuads: RDF.NamedNode[] = store.getParentsOfClass(subject); const codelist: RDF.NamedNode | undefined = store.getCodelist(subject); + const statuses: RDF.NamedNode | undefined = store.getStatus(subject); + const usageNoteQuads: RDF.Quad[] = store.getUsageNotes(subject); jsonLdClasses.push({ '@id': subject.value, '@type': 'Class', - ...assignedURI && { + ...(assignedURI && { assignedURI: assignedURI.value, - }, + }), ...this.mapLabels(labelQuads), ...this.mapDefinitions(definitionQuads), ...this.mapUsageNotes(usageNoteQuads), scope: scopeQuad?.value, - ...parentQuads.length > 0 && { - parent: parentQuads.map(x => ({ '@id': x.value })), - }, - ...codelist && { + ...(parentQuads.length > 0 && { + parent: parentQuads.map((x) => ({ '@id': x.value })), + }), + ...(codelist && { codelist: codelist.value, - }, + }), + ...this.mapStatuses(statuses), }); return jsonLdClasses; @@ -114,25 +126,29 @@ export class JsonLdOutputHandler implements IOutputHandler { private async getAttributes(store: QuadStore): Promise { const dataTypeAttributeIds: RDF.Term[] = store.findSubjects( ns.rdf('type'), - ns.owl('DatatypeProperty'), + ns.owl('DatatypeProperty') ); const objectPropertyAttributeIds: RDF.Term[] = store.findSubjects( ns.rdf('type'), - ns.owl('ObjectProperty'), + ns.owl('ObjectProperty') ); const propertyAttributeIds: RDF.Term[] = store.findSubjects( ns.rdf('type'), - ns.rdf('Property'), + ns.rdf('Property') ); return [ ...dataTypeAttributeIds, ...objectPropertyAttributeIds, ...propertyAttributeIds, - ].map(subject => { - const assignedURI: RDF.NamedNode | undefined = store.getAssignedUri(subject); + ].map((subject) => { + const assignedURI: RDF.NamedNode | undefined = + store.getAssignedUri(subject); const definitionQuads: RDF.Quad[] = store.getDefinitions(subject); - const attributeTypeQuad: RDF.Term | undefined = store.findObject(subject, ns.rdf('type')); + const attributeTypeQuad: RDF.Term | undefined = store.findObject( + subject, + ns.rdf('type') + ); const labelQuads: RDF.Quad[] = store.getLabels(subject); const usageNoteQuads: RDF.Quad[] = store.getUsageNotes(subject); @@ -141,179 +157,219 @@ export class JsonLdOutputHandler implements IOutputHandler { const rangeQuad: RDF.NamedNode | undefined = store.getRange(subject); const scopeQuad: RDF.NamedNode | undefined = store.getScope(subject); - const parentQuad: RDF.NamedNode | undefined = store.getParentOfProperty(subject); - const minCardinalityQuad: RDF.Literal | undefined = store.getMinCardinality(subject); - const maxCardinalityQuad: RDF.Literal | undefined = store.getMaxCardinality(subject); + const parentQuad: RDF.NamedNode | undefined = + store.getParentOfProperty(subject); + const minCardinalityQuad: RDF.Literal | undefined = + store.getMinCardinality(subject); + const maxCardinalityQuad: RDF.Literal | undefined = + store.getMaxCardinality(subject); const codelist: RDF.NamedNode | undefined = store.getCodelist(subject); + const statuses: RDF.NamedNode | undefined = store.getStatus(subject); return { '@id': subject.value, '@type': attributeTypeQuad?.value, - ...assignedURI && { + ...(assignedURI && { assignedURI: assignedURI.value, - }, + }), ...this.mapLabels(labelQuads), ...this.mapDefinitions(definitionQuads), ...this.mapUsageNotes(usageNoteQuads), - ...domainQuad && { + ...(domainQuad && { domain: { '@id': domainQuad.value, }, - }, - ...rangeQuad && { + }), + ...(rangeQuad && { range: { '@id': rangeQuad.value, }, - }, - ...parentQuad && { + }), + ...(parentQuad && { parent: { '@id': parentQuad.value, }, - }, + }), minCount: minCardinalityQuad?.value, maxCount: maxCardinalityQuad?.value, scope: scopeQuad?.value, - ...codelist && { + ...(codelist && { codelist: codelist.value, - }, + }), + ...this.mapStatuses(statuses), }; }); } private async getDatatypes(store: QuadStore): Promise { - const datatypeIds: RDF.Term[] = store.findSubjects(ns.rdf('type'), ns.rdfs('Datatype')); - return datatypeIds.map(subject => { - const assignedURI: RDF.NamedNode | undefined = store.getAssignedUri(subject); + const datatypeIds: RDF.Term[] = store.findSubjects( + ns.rdf('type'), + ns.rdfs('Datatype') + ); + return datatypeIds.map((subject) => { + const assignedURI: RDF.NamedNode | undefined = + store.getAssignedUri(subject); const definitionQuads: RDF.Quad[] = store.getDefinitions(subject); const labelQuads: RDF.Quad[] = store.getLabels(subject); const usageNoteQuads: RDF.Quad[] = store.getUsageNotes(subject); const scopeQuad: RDF.NamedNode | undefined = store.getScope(subject); + const statuses: RDF.NamedNode | undefined = store.getStatus(subject); return { '@id': subject.value, '@type': 'Datatype', - ...assignedURI && { + ...(assignedURI && { assignedURI: assignedURI.value, - }, + }), ...this.mapLabels(labelQuads), ...this.mapDefinitions(definitionQuads), ...this.mapUsageNotes(usageNoteQuads), - ...scopeQuad && { + ...(scopeQuad && { scope: scopeQuad.value, - }, + }), + ...this.mapStatuses(statuses), }; }); } private async getReferencedEntities(store: QuadStore): Promise { const df = new DataFactory(); - const referencedEntitiesGraph: RDF.NamedNode = df.namedNode('referencedEntities'); + const referencedEntitiesGraph: RDF.NamedNode = + df.namedNode('referencedEntities'); const quads: RDF.Quad[] = store.findQuads( null, null, null, - referencedEntitiesGraph, + referencedEntitiesGraph ); - const subjects = new Set(quads.map(x => x.subject)); + const subjects = new Set(quads.map((x) => x.subject)); const result: any[] = []; - subjects.forEach(subject => { + subjects.forEach((subject) => { const assignedURI: RDF.NamedNode | undefined = store.getAssignedUri( subject, - referencedEntitiesGraph, + referencedEntitiesGraph ); const subjectType: RDF.Term | undefined = store.findObject( subject, ns.rdf('type'), - referencedEntitiesGraph, + referencedEntitiesGraph ); const definitions: RDF.Quad[] = store.getDefinitions( subject, - referencedEntitiesGraph, + referencedEntitiesGraph + ); + const labels: RDF.Quad[] = store.getLabels( + subject, + referencedEntitiesGraph + ); + const usageNotes: RDF.Quad[] = store.getUsageNotes( + subject, + referencedEntitiesGraph + ); + const scope: RDF.NamedNode | undefined = store.getScope( + subject, + referencedEntitiesGraph + ); + + const statuses: RDF.NamedNode | undefined = store.getStatus( + subject, + referencedEntitiesGraph ); - const labels: RDF.Quad[] = store.getLabels(subject, referencedEntitiesGraph); - const usageNotes: RDF.Quad[] = store.getUsageNotes(subject, referencedEntitiesGraph); - const scope: RDF.NamedNode | undefined = store.getScope(subject, referencedEntitiesGraph); result.push({ '@id': subject.value, - ...subjectType && { + ...(subjectType && { '@type': subjectType.value, - }, - ...assignedURI && { + }), + ...(assignedURI && { assignedURI: assignedURI.value, - }, + }), ...this.mapLabels(labels), ...this.mapDefinitions(definitions), ...this.mapUsageNotes(usageNotes), - ...scope && { + ...this.mapStatuses(statuses), + ...(scope && { scope: scope.value, - }, + }), }); }); return result; } private mapLabels(labels: RDF.Quad[]): any { - const vocLabels: RDF.Quad[] = labels.filter(x => - x.predicate.equals(ns.oslo('vocLabel'))); - const apLabels: RDF.Quad[] = labels.filter(x => - x.predicate.equals(ns.oslo('apLabel'))); - const diagramLabels: RDF.Quad[] = labels.filter(x => - x.predicate.equals(ns.oslo('diagramLabel'))); + const vocLabels: RDF.Quad[] = labels.filter((x) => + x.predicate.equals(ns.oslo('vocLabel')) + ); + const apLabels: RDF.Quad[] = labels.filter((x) => + x.predicate.equals(ns.oslo('apLabel')) + ); + const diagramLabels: RDF.Quad[] = labels.filter((x) => + x.predicate.equals(ns.oslo('diagramLabel')) + ); return { - ...vocLabels.length > 0 && { - vocLabel: vocLabels.map(x => this.mapToLiteral(x)), - }, - ...apLabels.length > 0 && { - apLabel: apLabels.map(x => this.mapToLiteral(x)), - }, - ...diagramLabels.length > 0 && { - diagramLabel: diagramLabels.map(x => this.mapToLiteral(x, false)), - }, + ...(vocLabels.length > 0 && { + vocLabel: vocLabels.map((x) => this.mapToLiteral(x)), + }), + ...(apLabels.length > 0 && { + apLabel: apLabels.map((x) => this.mapToLiteral(x)), + }), + ...(diagramLabels.length > 0 && { + diagramLabel: diagramLabels.map((x) => this.mapToLiteral(x, false)), + }), }; } private mapDefinitions(definitions: RDF.Quad[]): any { - const vocDefinitions: RDF.Quad[] = definitions.filter(x => - x.predicate.equals(ns.oslo('vocDefinition'))); - const apDefinitions: RDF.Quad[] = definitions.filter(x => - x.predicate.equals(ns.oslo('apDefinition'))); + const vocDefinitions: RDF.Quad[] = definitions.filter((x) => + x.predicate.equals(ns.oslo('vocDefinition')) + ); + const apDefinitions: RDF.Quad[] = definitions.filter((x) => + x.predicate.equals(ns.oslo('apDefinition')) + ); return { - ...vocDefinitions.length > 0 && { - vocDefinition: vocDefinitions.map(x => this.mapToLiteral(x)), - }, - ...apDefinitions.length > 0 && { - apDefinition: apDefinitions.map(x => this.mapToLiteral(x)), - }, + ...(vocDefinitions.length > 0 && { + vocDefinition: vocDefinitions.map((x) => this.mapToLiteral(x)), + }), + ...(apDefinitions.length > 0 && { + apDefinition: apDefinitions.map((x) => this.mapToLiteral(x)), + }), }; } private mapUsageNotes(usageNotes: RDF.Quad[]): any { - const vocUsageNotes: RDF.Quad[] = usageNotes.filter(x => - x.predicate.equals(ns.oslo('vocUsageNote'))); - const apUsageNotes: RDF.Quad[] = usageNotes.filter(x => - x.predicate.equals(ns.oslo('apUsageNote'))); + const vocUsageNotes: RDF.Quad[] = usageNotes.filter((x) => + x.predicate.equals(ns.oslo('vocUsageNote')) + ); + const apUsageNotes: RDF.Quad[] = usageNotes.filter((x) => + x.predicate.equals(ns.oslo('apUsageNote')) + ); + + return { + ...(vocUsageNotes.length > 0 && { + vocUsageNote: vocUsageNotes.map((x) => this.mapToLiteral(x)), + }), + ...(apUsageNotes.length > 0 && { + apUsageNote: apUsageNotes.map((x) => this.mapToLiteral(x)), + }), + }; + } + private mapStatuses(statuses: RDF.NamedNode | undefined): any { return { - ...vocUsageNotes.length > 0 && { - vocUsageNote: vocUsageNotes.map(x => this.mapToLiteral(x)), - }, - ...apUsageNotes.length > 0 && { - apUsageNote: apUsageNotes.map(x => this.mapToLiteral(x)), - }, + status: statuses?.value, }; } private mapToLiteral(quad: RDF.Quad, addLanguage = true): any { return { - ...addLanguage && { + ...(addLanguage && { '@language': (quad.object).language, - }, + }), '@value': quad.object.value, }; } diff --git a/packages/oslo-converter-uml-ea/lib/utils/osloContext.ts b/packages/oslo-converter-uml-ea/lib/utils/osloContext.ts index dc52be2..c92c0e0 100644 --- a/packages/oslo-converter-uml-ea/lib/utils/osloContext.ts +++ b/packages/oslo-converter-uml-ea/lib/utils/osloContext.ts @@ -106,5 +106,9 @@ export function getOsloContext(): any { '@id': 'oslo:codelist', '@type': '@id', }, + status: { + '@id': 'oslo:status', + '@type': '@id', + }, }; } diff --git a/packages/oslo-converter-uml-ea/package.json b/packages/oslo-converter-uml-ea/package.json index a40b939..054936b 100644 --- a/packages/oslo-converter-uml-ea/package.json +++ b/packages/oslo-converter-uml-ea/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/ea-converter", - "version": "0.0.24-alpha.0", + "version": "0.0.25-alpha.0", "description": "Transform an Enterprise Architect UML diagram to RDF", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-converter-uml-ea#readme", @@ -41,7 +41,7 @@ "jest-runner-groups": "^2.2.0" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "@oslo-flanders/ea-uml-extractor": "^0.0.22-alpha.0", "@oslo-flanders/output-handlers": "^0.0.4-alpha.0", "inversify": "^6.0.1", diff --git a/packages/oslo-core/lib/store/QuadStore.ts b/packages/oslo-core/lib/store/QuadStore.ts index 3ccb0cc..655b4a8 100644 --- a/packages/oslo-core/lib/store/QuadStore.ts +++ b/packages/oslo-core/lib/store/QuadStore.ts @@ -38,7 +38,7 @@ export class QuadStore { subject: RDF.Term | null, predicate: RDF.Term | null, object: RDF.Term | null, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Quad[] { return this.store.getQuads(subject, predicate, object, graph); } @@ -47,7 +47,7 @@ export class QuadStore { subject: RDF.Term | null, predicate: RDF.Term | null, object: RDF.Term | null, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Quad | undefined { return this.findQuads(subject, predicate, object, graph).shift(); } @@ -55,7 +55,7 @@ export class QuadStore { public findSubjects( predicate: RDF.Term, object: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Term[] { return this.store.getSubjects(predicate, object, graph); } @@ -63,7 +63,7 @@ export class QuadStore { public findSubject( predicate: RDF.Term, object: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Term | undefined { return this.findSubjects(predicate, object, graph).shift(); } @@ -71,7 +71,7 @@ export class QuadStore { public findObjects( subject: RDF.Term, predicate: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Term[] { return this.store.getObjects(subject, predicate, graph); } @@ -79,7 +79,7 @@ export class QuadStore { public findObject( subject: RDF.Term, predicate: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Term | undefined { return this.findObjects(subject, predicate, graph).shift(); } @@ -109,7 +109,9 @@ export class QuadStore { * @returns an array of RDF.NamedNodes */ public getDatatypes(graph: RDF.Term | null = null): RDF.NamedNode[] { - return (this.store.getSubjects(ns.rdf('type'), ns.rdfs('Datatype'), graph)); + return ( + this.store.getSubjects(ns.rdf('type'), ns.rdfs('Datatype'), graph) + ); } /** @@ -117,7 +119,7 @@ export class QuadStore { * @returns an array of RDF.NamedNodes */ public getDatatypePropertyIds( - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode[] { return ( this.store.getSubjects(ns.rdf('type'), ns.owl('DatatypeProperty'), graph) @@ -142,7 +144,7 @@ export class QuadStore { */ public getAssignedUri( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.oslo('assignedURI'), graph).shift() @@ -157,25 +159,25 @@ export class QuadStore { */ public getLabels( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Quad[] { const vocLabel: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('vocLabel'), null, - graph, + graph ); const apLabel: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('apLabel'), null, - graph, + graph ); const diagramLabel: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('diagramLabel'), null, - graph, + graph ); return vocLabel.concat(apLabel).concat(diagramLabel); } @@ -190,12 +192,15 @@ export class QuadStore { public getVocLabel( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getLabels(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('vocLabel')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getLabels(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('vocLabel')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -208,12 +213,15 @@ export class QuadStore { public getApLabel( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getLabels(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('apLabel')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getLabels(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('apLabel')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -225,11 +233,13 @@ export class QuadStore { */ public getDiagramLabel( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getLabels(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('diagramLabel')), - )?.object; + return ( + this.getLabels(subject, graph).find((x: RDF.Quad) => + x.predicate.equals(ns.oslo('diagramLabel')) + )?.object + ); } /** @@ -240,20 +250,20 @@ export class QuadStore { */ public getDefinitions( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Quad[] { const vocDefinitions: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('vocDefinition'), null, - graph, + graph ); const apDefinitions: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('apDefinition'), null, - graph, + graph ); return vocDefinitions.concat(apDefinitions); } @@ -268,12 +278,15 @@ export class QuadStore { public getVocDefinition( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getDefinitions(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('vocDefinition')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getDefinitions(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('vocDefinition')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -286,12 +299,15 @@ export class QuadStore { public getApDefinition( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getDefinitions(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('apDefinition')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getDefinitions(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('apDefinition')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -302,7 +318,7 @@ export class QuadStore { */ public getRange( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.rdfs('range'), graph).shift() @@ -317,7 +333,7 @@ export class QuadStore { */ public getDomain( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.rdfs('domain'), graph).shift() @@ -332,20 +348,20 @@ export class QuadStore { */ public getUsageNotes( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Quad[] { const vocUsageNotes: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('vocUsageNote'), null, - graph, + graph ); const apUsageNotes: RDF.Quad[] = this.store.getQuads( subject, ns.oslo('apUsageNote'), null, - graph, + graph ); return vocUsageNotes.concat(apUsageNotes); } @@ -360,12 +376,15 @@ export class QuadStore { public getVocUsageNote( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getUsageNotes(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('vocUsageNote')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getUsageNotes(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('vocUsageNote')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -378,12 +397,15 @@ export class QuadStore { public getApUsageNote( subject: RDF.Term, language?: string, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { - return this.getUsageNotes(subject, graph).find( - (x: RDF.Quad) => x.predicate.equals(ns.oslo('apUsageNote')) && - (x.object).language === (language || ''), - )?.object; + return ( + this.getUsageNotes(subject, graph).find( + (x: RDF.Quad) => + x.predicate.equals(ns.oslo('apUsageNote')) && + (x.object).language === (language || '') + )?.object + ); } /** @@ -393,7 +415,7 @@ export class QuadStore { */ public getScope( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.oslo('scope'), graph).shift() @@ -407,7 +429,7 @@ export class QuadStore { */ public getMinCardinality( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { return ( this.store.getObjects(subject, ns.shacl('minCount'), graph).shift() @@ -421,7 +443,7 @@ export class QuadStore { */ public getMaxCardinality( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.Literal | undefined { return ( this.store.getObjects(subject, ns.shacl('maxCount'), graph).shift() @@ -436,7 +458,7 @@ export class QuadStore { */ public getParentsOfClass( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode[] { return ( this.store.getObjects(subject, ns.rdfs('subClassOf'), graph) @@ -451,7 +473,7 @@ export class QuadStore { */ public getParentOfProperty( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.rdfs('subPropertyOf'), graph).shift() @@ -460,10 +482,25 @@ export class QuadStore { public getCodelist( subject: RDF.Term, - graph: RDF.Term | null = null, + graph: RDF.Term | null = null ): RDF.NamedNode | undefined { return ( this.store.getObjects(subject, ns.oslo('codelist'), graph).shift() ); } + + /** + * Finds the status of a given RDF.Term + * @param subject The RDF.Term to find the parent of + * @param store A N3 quad store + * @returns An RDF.Term or undefined if not found + */ + public getStatus( + subject: RDF.Term, + graph: RDF.Term | null = null + ): RDF.NamedNode | undefined { + return ( + this.store.getObjects(subject, ns.oslo('status'), graph).shift() + ); + } } diff --git a/packages/oslo-core/package.json b/packages/oslo-core/package.json index 02d78f8..5476e53 100644 --- a/packages/oslo-core/package.json +++ b/packages/oslo-core/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/core", - "version": "0.0.15-alpha.0", + "version": "0.0.16-alpha.0", "description": "Core interfaces and utilities", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-core#readme", diff --git a/packages/oslo-extractor-uml-ea/package.json b/packages/oslo-extractor-uml-ea/package.json index 82c79f2..141396d 100644 --- a/packages/oslo-extractor-uml-ea/package.json +++ b/packages/oslo-extractor-uml-ea/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/ea-uml-extractor", - "version": "0.0.23-alpha.0", + "version": "0.0.24-alpha.0", "description": "Reads all the information from an Enterprise Architect UML diagram", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-extract-uml-ea#readme", @@ -31,7 +31,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "alasql": "1.7.3", "inversify": "^6.0.1", "mdb-reader": "github:Informatievlaanderen/mdb-reader", diff --git a/packages/oslo-generator-html/lib/templates/voc2.j2 b/packages/oslo-generator-html/lib/templates/voc2.j2 index 1271389..11abc80 100644 --- a/packages/oslo-generator-html/lib/templates/voc2.j2 +++ b/packages/oslo-generator-html/lib/templates/voc2.j2 @@ -1,6 +1,6 @@ + http://www.w3.org/2001/02pd/rec54#" xmlns="http://www.w3.org/1999/xhtml"> {{ data.metadata.title }} @@ -192,7 +192,7 @@ resource="#ref" rel="bibo:Chapter">

Samenvatting

-
+
{{ block.super }} {% block summary %}

@@ -209,7 +209,7 @@

Status van dit document

-
+
{% block status %}

Deze sectie beschrijft de status van dit document op het moment van publicatie. Het kan zijn dat er ondertussen al @@ -390,6 +390,20 @@ {{ class.vocabularyUsageNote[language] }} {% endif %} + + +

Status

+ + {% if class.status %} + + {{ class.status }} + + {% else %} + + {{ data.metadata.status }} + + {% endif %} +
@@ -472,6 +486,20 @@ {{ property.vocabularyUsageNote[language] }} {% endif %} + + +

Status

+ + {% if class.status %} + + {{ class.status }} + + {% else %} + + {{ data.metadata.status }} + + {% endif %} +
diff --git a/packages/oslo-generator-html/package.json b/packages/oslo-generator-html/package.json index f20204b..92fbc5b 100644 --- a/packages/oslo-generator-html/package.json +++ b/packages/oslo-generator-html/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/html-generator", - "version": "0.0.18-alpha.0", + "version": "0.0.19-alpha.0", "description": "Generates an HTML file using an OSLO webuniversum config", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-html#readme", @@ -35,7 +35,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "inversify": "^6.0.1", "n3": "^1.16.4", "nunjucks": "^3.2.4", diff --git a/packages/oslo-generator-json-webuniversum/lib/JsonWebuniversumGenerationService.ts b/packages/oslo-generator-json-webuniversum/lib/JsonWebuniversumGenerationService.ts index 38cf190..df6caf1 100644 --- a/packages/oslo-generator-json-webuniversum/lib/JsonWebuniversumGenerationService.ts +++ b/packages/oslo-generator-json-webuniversum/lib/JsonWebuniversumGenerationService.ts @@ -244,6 +244,8 @@ export class JsonWebuniversumGenerationService implements IService { const scope: string | undefined = this.store.getScope(entity)?.value; + const status: string | undefined = this.store.getStatus(entity)?.value; + const entityData: WebuniversumObject = { id: assignedURI.value, ...(vocabularyLabel && { @@ -280,6 +282,9 @@ export class JsonWebuniversumGenerationService implements IService { ...(scope && { scope: scope, }), + ...(status && { + status: status, + }), }; if (includeProperties) { diff --git a/packages/oslo-generator-json-webuniversum/lib/types/WebuniversumObject.ts b/packages/oslo-generator-json-webuniversum/lib/types/WebuniversumObject.ts index 1ca3610..b78d45f 100644 --- a/packages/oslo-generator-json-webuniversum/lib/types/WebuniversumObject.ts +++ b/packages/oslo-generator-json-webuniversum/lib/types/WebuniversumObject.ts @@ -1,16 +1,20 @@ -import type { WebuniversumProperty } from "./WebuniversumProperty"; +import type { WebuniversumProperty } from './WebuniversumProperty'; export interface WebuniversumObject { - id: string; - vocabularyLabel?: Record; - applicationProfileLabel?: Record; - vocabularyDefinition?: Record; - applicationProfileDefinition?: Record; - vocabularyUsageNote?: Record; - applicationProfileUsageNote?: Record; - parents?: Pick[]; + id: string; + vocabularyLabel?: Record; + applicationProfileLabel?: Record; + vocabularyDefinition?: Record; + applicationProfileDefinition?: Record; + vocabularyUsageNote?: Record; + applicationProfileUsageNote?: Record; + parents?: Pick< + WebuniversumObject, + 'id' | 'vocabularyLabel' | 'applicationProfileLabel' + >[]; + status?: string; - // TODO: this should be made mandatory in the future - scope?: string; - properties?: WebuniversumProperty[]; -} \ No newline at end of file + // TODO: this should be made mandatory in the future + scope?: string; + properties?: WebuniversumProperty[]; +} diff --git a/packages/oslo-generator-json-webuniversum/package.json b/packages/oslo-generator-json-webuniversum/package.json index 997b818..c7f7c2c 100644 --- a/packages/oslo-generator-json-webuniversum/package.json +++ b/packages/oslo-generator-json-webuniversum/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/json-webuniversum-generator", - "version": "0.0.8-alpha.0", + "version": "0.0.9-alpha.0", "description": "Generates a JSON file which is used to generate an HTML template using Webuniversum 3", "author": "Dwight Van Lancker ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-json-webuniversum#readme", @@ -30,7 +30,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "inversify": "^6.0.1", "n3": "^1.17.2", "rdf-data-factory": "^1.1.2", diff --git a/packages/oslo-generator-jsonld-context/package.json b/packages/oslo-generator-jsonld-context/package.json index 79052ad..6c42818 100644 --- a/packages/oslo-generator-jsonld-context/package.json +++ b/packages/oslo-generator-jsonld-context/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/jsonld-context-generator", - "version": "0.0.10-alpha.0", + "version": "0.0.11-alpha.0", "description": "Generates a JSON-LD context file from an OSLO-compliant RDF file", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-jsonld-context#readme", @@ -39,7 +39,7 @@ "@rdfjs/types": "^1.1.0" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "inversify": "^6.0.1", "n3": "^1.16.2", "rdf-data-factory": "^1.1.2", diff --git a/packages/oslo-generator-rdf-vocabulary/package.json b/packages/oslo-generator-rdf-vocabulary/package.json index e4141c4..8437748 100644 --- a/packages/oslo-generator-rdf-vocabulary/package.json +++ b/packages/oslo-generator-rdf-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/rdf-vocabulary-generator", - "version": "0.0.11-alpha.0", + "version": "0.0.12-alpha.0", "description": "Transform an Enterprise Architect UML diagram to RDF", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-rdf-vocabulary#readme", @@ -40,7 +40,7 @@ "@types/streamify-array": "^1.0.0" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "inversify": "^6.0.1", "n3": "^1.16.2", "rdf-data-factory": "^1.1.1", diff --git a/packages/oslo-generator-respec-html/package.json b/packages/oslo-generator-respec-html/package.json index fbe1477..ef845c9 100644 --- a/packages/oslo-generator-respec-html/package.json +++ b/packages/oslo-generator-respec-html/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/html-respec-generator", - "version": "0.0.11-alpha.0", + "version": "0.0.12-alpha.0", "description": "Generates an HTML respec file using an OSLO-compliant RDF file", "author": "Digitaal Vlaanderen ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-respec-html#readme", @@ -34,7 +34,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "@oslo-flanders/html-respec-generator": "^0.0.11-alpha.0", "@oslo-flanders/stakeholders-converter": "^0.0.12-alpha.0", "inversify": "^6.0.1", diff --git a/packages/oslo-generator-shacl-template/package.json b/packages/oslo-generator-shacl-template/package.json index fc4aedf..a61abce 100644 --- a/packages/oslo-generator-shacl-template/package.json +++ b/packages/oslo-generator-shacl-template/package.json @@ -1,6 +1,6 @@ { "name": "@oslo-flanders/shacl-template-generator", - "version": "0.0.5-alpha.0", + "version": "0.0.6-alpha.0", "description": "Generates a SHACL template based on an OSLO JSON-LD file", "author": "Dwight Van Lancker ", "homepage": "https://github.com/informatievlaanderen/OSLO-UML-Transformer/tree/main/packages/oslo-generator-shacl-template#readme", @@ -37,7 +37,7 @@ "url": "https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues" }, "dependencies": { - "@oslo-flanders/core": "^0.0.15-alpha.0", + "@oslo-flanders/core": "^0.0.16-alpha.0", "i18n": "^0.15.1", "inversify": "^6.0.1", "n3": "^1.17.2",