From 384897912309e35786c4958f9e8b7ef90e4005a0 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Fri, 13 Mar 2020 10:31:08 +0100 Subject: [PATCH] test (read resource): determine link prop Iri form link value prop Iri --- .../v2/resources/ResourcesConversionUtil.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/models/v2/resources/ResourcesConversionUtil.spec.ts b/src/models/v2/resources/ResourcesConversionUtil.spec.ts index 77dac1a59..9a7e7cd57 100644 --- a/src/models/v2/resources/ResourcesConversionUtil.spec.ts +++ b/src/models/v2/resources/ResourcesConversionUtil.spec.ts @@ -303,6 +303,22 @@ describe("ResourcesConversionUtil", () => { }); + it("attempt to determine a link property IRI from a non link value property IRI", done => { + + const resource = require("../../../../test/data/api/v2/resources/testding-expanded.json"); + + ResourcesConversionUtil.createReadResourceSequence(resource, knoraApiConnection.v2.ontologyCache, knoraApiConnection.v2.listNodeCache, jsonConvert).subscribe( + resSeq => { + + expect( + () => { + resSeq[0].getLinkPropertyIriFromLinkValuePropertyIri("http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThing"); + }).toThrow(new Error("http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThing is not a valid link value property IRI")); + + done(); + }); + }); + it("parse JSON-lD representing a resource with a StillImageRepresentation", done => { const resource = require("../../../../test/data/api/v2/values/get-still-image-file-value-response-expanded.json");