From fe0df2e72378fcc11c358c9ada5e9f7e7cb83214 Mon Sep 17 00:00:00 2001 From: Rdataflow Date: Fri, 26 Apr 2024 08:24:20 +0200 Subject: [PATCH] test: observedBy in ObservationConstraint --- cli/test/lib/commands/publish.test.ts | 4 ++++ cli/test/lib/commands/transform.test.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/cli/test/lib/commands/publish.test.ts b/cli/test/lib/commands/publish.test.ts index 78981a0e2..d3f08e277 100644 --- a/cli/test/lib/commands/publish.test.ts +++ b/cli/test/lib/commands/publish.test.ts @@ -475,6 +475,10 @@ describe('@cube-creator/cli/lib/commands/publish', function () { minCount: 1, }, }) + + const observedByIns = [props.has(sh.path, cube.observedBy).out(sh.in).list()!].map(ptr => ptr.term) + expect(observedByIns).to.deep.contain.members([$rdf.namedNode('https://ld.admin.ch/office/VII.1.7')]) + expect(observedByIns).to.have.length(1) }) it('removes all csvw triples', async () => { diff --git a/cli/test/lib/commands/transform.test.ts b/cli/test/lib/commands/transform.test.ts index 87eb1d26b..29fead48c 100644 --- a/cli/test/lib/commands/transform.test.ts +++ b/cli/test/lib/commands/transform.test.ts @@ -84,9 +84,12 @@ describe('@cube-creator/cli/lib/commands/transform', function () { path: rdf.type, hasValue: cube.Observation, minCount: 1, + maxCount: 1, }, { path: cube.observedBy, + hasValue: $rdf.namedNode('https://ld.admin.ch/office/VII.1.7'), minCount: 1, + maxCount: 1, }, { path: $rdf.namedNode('https://environment.ld.admin.ch/foen/ubd/28/dimension/year'), hasValue: $rdf.literal('2000', xsd.gYear),