Skip to content

Commit

Permalink
Update converter handlers towards OSLO JSON-LD
Browse files Browse the repository at this point in the history
This update contains the following changes:
- Each converter handler now contains a clear assign URI and create quads functions (which is documented on Confluence as well)
- JsonLdOutputHandler has been moved to oslo-converter-uml-ea
- Partially updated QuadStore to work with the OSLO JSON-LD
- For each (primitive) datatype a unique id is calculcated which can be used as identifier in the OSLO JSON-LD
  • Loading branch information
ddvlanck committed Oct 20, 2023
1 parent 561a2cb commit 3af2a43
Show file tree
Hide file tree
Showing 13 changed files with 1,455 additions and 847 deletions.
1 change: 0 additions & 1 deletion packages/oslo-converter-uml-ea/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ The service is executed from the CLI and expects the following parameters:
| `--umlFile` | The URL or local file path of an EA UML diagram | :heavy_check_mark: ||
| `--diagramName` | The name of the UML diagram within the EAP file | :heavy_check_mark: ||
| `--outputFile` | The name of the RDF output file | No, but if omitted, output is written to process.stdout ||
| `--specificationType` | The type of the specification | :heavy_check_mark: | `ApplicationProfile` or `Vocabulary` |
| `--versionId` | Version identifier for the document | :heavy_check_mark: ||
| `--outputFormat` | RDF content-type specifiying the output format | :heavy_check_mark: | `application/ld+json` |
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,38 @@ container

container
.bind<OutputHandlerService>(
EaUmlConverterServiceIdentifier.OutputHandlerService
)
EaUmlConverterServiceIdentifier.OutputHandlerService,
)
.to(OutputHandlerService);

container
.bind<ConverterHandler<EaPackage>>(
EaUmlConverterServiceIdentifier.ConverterHandler
)
EaUmlConverterServiceIdentifier.ConverterHandler,
)
.to(PackageConverterHandler)
.inSingletonScope()
.whenTargetNamed('PackageConverterHandler');

container
.bind<ConverterHandler<EaAttribute>>(
EaUmlConverterServiceIdentifier.ConverterHandler
)
EaUmlConverterServiceIdentifier.ConverterHandler,
)
.to(AttributeConverterHandler)
.inSingletonScope()
.whenTargetNamed('AttributeConverterHandler');

container
.bind<ConverterHandler<EaElement>>(
EaUmlConverterServiceIdentifier.ConverterHandler
)
EaUmlConverterServiceIdentifier.ConverterHandler,
)
.to(ElementConverterHandler)
.inSingletonScope()
.whenTargetNamed('ElementConverterHandler');

container
.bind<ConverterHandler<NormalizedConnector>>(
EaUmlConverterServiceIdentifier.ConverterHandler
)
EaUmlConverterServiceIdentifier.ConverterHandler,
)
.to(ConnectorConverterHandler)
.inSingletonScope()
.whenTargetNamed('ConnectorConverterHandler');
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ export class EaUmlConverterConfiguration implements IConfiguration {
*/
private _diagramName: string | undefined;

/**
* Type of the specification for the intermediary RDF (JSON-LD) file.
* Mainly used to extract the correct labels from tags in the UML diagram
* Possible values are "ApplicationProfile" or "Vocabulary"
*/
private _specificationType: string | undefined;

/**
* Name of the RDF output file
*/
Expand All @@ -43,7 +36,6 @@ export class EaUmlConverterConfiguration implements IConfiguration {
public async createFromCli(params: YargsParams): Promise<void> {
this._umlFile = <string>params.umlFile;
this._diagramName = <string>params.diagramName;
this._specificationType = <string>params.specificationType;
this._outputFile = <string>(params.outputFile || 'report.jsonld');
this._versionId = <string>params.versionId;
this._outputFormat = <string>params.outputFormat;
Expand All @@ -64,13 +56,6 @@ export class EaUmlConverterConfiguration implements IConfiguration {
return this._diagramName;
}

public get specificationType(): string {
if (!this._specificationType) {
throw new Error(`Trying to access property "specificationType" before it was set.`);
}
return this._specificationType;
}

public get outputFile(): string {
if (!this._outputFile) {
throw new Error(`Trying to access property "outputFile" before it was set.`);
Expand Down
Loading

0 comments on commit 3af2a43

Please sign in to comment.