/// import type { URL } from 'url'; import type { QuadStore } from '@oslo-flanders/core'; import { Logger } from '@oslo-flanders/core'; import type { DataRegistry, EaObject } from '@oslo-flanders/ea-uml-extractor'; import type * as RDF from '@rdfjs/types'; import { DataFactory } from 'rdf-data-factory'; import { EaUmlConverterConfiguration } from '../config/EaUmlConverterConfiguration'; import type { UriRegistry } from '../UriRegistry'; export declare abstract class ConverterHandler { readonly config: EaUmlConverterConfiguration; readonly logger: Logger; readonly df: DataFactory; readonly baseUrnScheme: string; /** * Creates RDF.Quads for objects with type T in the normalized model and adds them to an RDF.Store */ abstract convert(model: DataRegistry, uriRegistry: UriRegistry, store: QuadStore): Promise; /** * Normalizes objects with type T in the data model */ abstract normalize(model: DataRegistry): Promise; /** * Assigns URIs to objects with type T in the data model and adds them to the URI registry */ abstract assignUris(normalizedModel: DataRegistry, uriRegistry: UriRegistry): Promise; /** * Creates and returns quads for an object with type T */ abstract createQuads(object: T, uriRegistry: UriRegistry, model?: DataRegistry): RDF.Quad[]; /** * Removes objects that contain an ignore tag * @param model - The data registry containing the entities */ abstract filterIgnoredObjects(model: DataRegistry): Promise; /** * Removes objects that are set to hidden in the EA model * @param model - The data registry containing the entities */ abstract filterHiddenObjects(model: DataRegistry): Promise; /** * Adds information that was set via tags on an entity to the array of quads * @param object - The entity to extract the information from and add it to the array of quads * @param objectInternalId - An RDF.NamedNode representing the internal ID of the entity * @param quads - The array of quads * @param graph - The graph to add the quads to */ addEntityInformation(object: T, objectInternalId: RDF.NamedNode, quads: RDF.Quad[], graph?: RDF.Quad_Graph): void; addOtherTags(object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; addDefinitions(object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; addLabels(object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; addUsageNotes(object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; addStatus(object: T, objectInternalId: RDF.NamedNode, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; /** * Determines the scope of the assigned URI of an entity * @param object - The entity to determine the scope for * @param objectInternalId - An RDF.NamedNode representing the internal ID of the entity * @param packageBaseUri - The base URI that has been set on the EA package * @param idUriMap - A map containing the entity id and assigned URI * @param quads - An array of RDF.Quads to add the quad to */ addScope(object: T, objectInternalId: RDF.NamedNode, packageBaseUri: string, idUriMap: Map, graph: RDF.Quad_Graph, quads: RDF.Quad[]): void; handleError(value: string | any[] | undefined | null, error: string): boolean; /** * Extract the value for a tag * @param tagName - The name of the tag to extract the value for * @param languages - An array of the possible LanguageCodes * @returns - A string with the value of the tag without any language code suffix */ private getBaseTagName; /** * Extract the value for a tag * @param object - The entity to extract the tag values from * @param tag - The name of the tag to extract the value for * @returns - An array of RDF.Literals */ private getTagValue; /** * Adds RDF.Literals to an array of quads for a configurable subject and predicate * @param values - An array of RDF.Literals * @param objectInternalId - An RDF.NamedNode representing the URI of the subject * @param predicate - An RDF.NamedNode representing the predicate * @param graph - To graph to add to quads to * @param quads - The array of quads */ private addValuesToQuads; /** * Returns all values of tags that contain the tag name * @param object — The object to extract the tag values from * @param name — The name of the tag */ private getLanguageDependentTag; }