diff --git a/package-lock.json b/package-lock.json index 07c7874e02..ed1c3b0bbd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@angular/platform-browser-dynamic": "^13.2.6", "@angular/router": "^13.2.6", "@ckeditor/ckeditor5-angular": "^2.0.2", - "@dasch-swiss/dsp-js": "^7.0.2", + "@dasch-swiss/dsp-js": "^7.1.0", "@datadog/browser-rum": "^3.11.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "6.0.0", @@ -2425,9 +2425,9 @@ } }, "node_modules/@dasch-swiss/dsp-js": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.2.tgz", - "integrity": "sha512-hnyviSFRdPyhqOXKPRWrXnge7T7p9NR1Ka068kuShFL5UErHr+Cu8Pat0U5kX72TqZTD6KcldkGvFBmuaaDJKw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.1.0.tgz", + "integrity": "sha512-JhjoSdrlolaO+SoYpQdYbKxENbXpg0I5hyRIjutSZ5VfRm3fh5FVr4k6at+9bQwaNvutufvmW+yxoz5MCYKtSA==", "dependencies": { "@babel/helper-compilation-targets": "^7.16.7", "@types/jsonld": "^1.5.6", @@ -17127,9 +17127,9 @@ } }, "@dasch-swiss/dsp-js": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.0.2.tgz", - "integrity": "sha512-hnyviSFRdPyhqOXKPRWrXnge7T7p9NR1Ka068kuShFL5UErHr+Cu8Pat0U5kX72TqZTD6KcldkGvFBmuaaDJKw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-7.1.0.tgz", + "integrity": "sha512-JhjoSdrlolaO+SoYpQdYbKxENbXpg0I5hyRIjutSZ5VfRm3fh5FVr4k6at+9bQwaNvutufvmW+yxoz5MCYKtSA==", "requires": { "@babel/helper-compilation-targets": "^7.16.7", "@types/jsonld": "^1.5.6", diff --git a/package.json b/package.json index 28d3d88fd3..f4d8eff6b9 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@angular/platform-browser-dynamic": "^13.2.6", "@angular/router": "^13.2.6", "@ckeditor/ckeditor5-angular": "^2.0.2", - "@dasch-swiss/dsp-js": "^7.0.2", + "@dasch-swiss/dsp-js": "^7.1.0", "@datadog/browser-rum": "^3.11.0", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "6.0.0", diff --git a/src/app/project/ontology/default-data/default-resource-classes.ts b/src/app/project/ontology/default-data/default-resource-classes.ts index 070fc5a059..eae519ac4b 100644 --- a/src/app/project/ontology/default-data/default-resource-classes.ts +++ b/src/app/project/ontology/default-data/default-resource-classes.ts @@ -53,7 +53,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'StillImageRepresentation', + iri: Constants.StillImageRepresentation, label: 'Still Image', icons: [ 'photo', @@ -80,7 +80,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'MovingImageRepresentation', + iri: Constants.MovingImageRepresentation, label: 'Moving Image', icons: [ 'movie', @@ -98,7 +98,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'AudioRepresentation', + iri: Constants.AudioRepresentation, label: 'Audio', icons: [ 'audiotrack', @@ -117,7 +117,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'TextRepresentation', + iri: Constants.TextRepresentation, label: 'Text', icons: [ 'rtt', @@ -127,7 +127,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'DocumentRepresentation', + iri: Constants.DocumentRepresentation, label: 'Document (PDF, etc.)', icons: [ 'description', @@ -142,7 +142,7 @@ export class DefaultResourceClasses { ] }, { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'ArchiveRepresentation', + iri: Constants.ArchiveRepresentation, label: 'Archive (zip, x-tar, gzip)', icons: [ 'archive', @@ -156,7 +156,7 @@ export class DefaultResourceClasses { /* --> DSP-1559: disable RTI class; the following object can be added again to the default classes as soon as a RTI viewer is implemented { - iri: Constants.KnoraApiV2 + Constants.HashDelimiter + 'DDDRepresentation', + iri: Constants.DDDRepresentation, label: 'RTI Image', icons: [ 'view_in_ar', diff --git a/src/app/workspace/resource/properties/properties.component.ts b/src/app/workspace/resource/properties/properties.component.ts index da53b5fed0..40ee4e727d 100644 --- a/src/app/workspace/resource/properties/properties.component.ts +++ b/src/app/workspace/resource/properties/properties.component.ts @@ -133,7 +133,7 @@ export class PropertiesComponent implements OnInit, OnChanges, OnDestroy { booleanValueTypeIri = Constants.BooleanValue; - hasIncomingLinkIri = Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasIncomingLinkValue'; + hasIncomingLinkIri = Constants.HasIncomingLinkValue; project: ReadProject; user: ReadUser; diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.ts b/src/app/workspace/resource/representation/still-image/still-image.component.ts index fccd705a60..766e28a234 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.ts @@ -303,7 +303,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { const geometry = geom.geometry; - const colorValues: ReadColorValue[] = geom.region.properties[Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasColor'] as ReadColorValue[]; + const colorValues: ReadColorValue[] = geom.region.properties[Constants.HasColor] as ReadColorValue[]; // if the geometry has a color property, use that value as the color for the line if (colorValues && colorValues.length) { @@ -435,7 +435,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { ',"y":' + y1.toString() + '},{"x":' + x2.toString() + ',"y":' + y2.toString() + '}],"type":"rectangle"}'; const createResource = new CreateResource(); createResource.label = label; - createResource.type = Constants.KnoraApiV2 + Constants.HashDelimiter + 'Region'; + createResource.type = Constants.Region; createResource.attachedToProject = this.project; const geomVal = new CreateGeomValue(); geomVal.type = Constants.GeomValue; @@ -451,10 +451,10 @@ export class StillImageComponent implements OnChanges, OnDestroy { commentVal.text = comment; createResource.properties = { - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasComment']: [commentVal], - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasColor']: [colorVal], - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'isRegionOfValue']: [linkVal], - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasGeometry']: [geomVal] + [Constants.HasComment]: [commentVal], + [Constants.HasColor]: [colorVal], + [Constants.IsRegionOfValue]: [linkVal], + [Constants.HasGeometry]: [geomVal] }; this._dspApiConnection.v2.res.createResource(createResource).subscribe( (res: ReadResource) => { diff --git a/src/app/workspace/resource/resource-link-form/resource-link-form.component.spec.ts b/src/app/workspace/resource/resource-link-form/resource-link-form.component.spec.ts index 0a4ba4732e..dd8918ff7f 100644 --- a/src/app/workspace/resource/resource-link-form/resource-link-form.component.spec.ts +++ b/src/app/workspace/resource/resource-link-form/resource-link-form.component.spec.ts @@ -270,11 +270,11 @@ describe('ResourceLinkFormComponent', () => { createVal.push(linkVal); }); - props[Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasLinkToValue'] = createVal; + props[Constants.HasLinkToValue] = createVal; const expectedCreateResource = new CreateResource(); expectedCreateResource.label = 'My Label'; - expectedCreateResource.type = Constants.KnoraApiV2 + Constants.HashDelimiter + 'LinkObj'; + expectedCreateResource.type = Constants.LinkObj; expectedCreateResource.properties = props; // --> TODO create a Router spy to mock the navigation diff --git a/src/app/workspace/resource/resource-link-form/resource-link-form.component.ts b/src/app/workspace/resource/resource-link-form/resource-link-form.component.ts index d930ff8513..069dadfba7 100644 --- a/src/app/workspace/resource/resource-link-form/resource-link-form.component.ts +++ b/src/app/workspace/resource/resource-link-form/resource-link-form.component.ts @@ -120,7 +120,7 @@ export class ResourceLinkFormComponent implements OnInit { linkObj.label = this.form.controls['label'].value; - linkObj.type = Constants.KnoraApiV2 + Constants.HashDelimiter + 'LinkObj'; + linkObj.type = Constants.LinkObj; linkObj.attachedToProject = this.selectedProject; @@ -139,12 +139,12 @@ export class ResourceLinkFormComponent implements OnInit { commentVal.type = Constants.TextValue; commentVal.text = comment; linkObj.properties = { - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasLinkToValue']: hasLinkToValue, - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasComment']: [commentVal], + [Constants.HasLinkToValue]: hasLinkToValue, + [Constants.HasComment]: [commentVal], }; } else { linkObj.properties = { - [Constants.KnoraApiV2 + Constants.HashDelimiter + 'hasLinkToValue']: hasLinkToValue, + [Constants.HasLinkToValue]: hasLinkToValue, }; } diff --git a/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/operator-constants.ts b/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/operator-constants.ts index fe63c7e631..1ef3b20948 100644 --- a/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/operator-constants.ts +++ b/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/operator-constants.ts @@ -29,5 +29,5 @@ export class ComparisonOperatorConstants { static MatchComparisonOperator = 'contains'; static MatchComparisonLabel = 'matches'; - static MatchFunction = Constants.KnoraApiV2 + Constants.HashDelimiter + 'matchText'; + static MatchFunction = Constants.MatchText; }