From 99bd90302d471ce59d48f70d18a7f47853486af8 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Fri, 7 Jun 2024 13:46:39 +0200 Subject: [PATCH 01/13] feat: margin of error --- .changeset/tricky-numbers-pay.md | 5 +++++ relation/core.md | 12 ++++++++++++ relation/relation.ttl | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .changeset/tricky-numbers-pay.md diff --git a/.changeset/tricky-numbers-pay.md b/.changeset/tricky-numbers-pay.md new file mode 100644 index 0000000..4539494 --- /dev/null +++ b/.changeset/tricky-numbers-pay.md @@ -0,0 +1,5 @@ +--- +"cube-link": patch +--- + +Relation vocabulary: added relation types for asymmetrical margin of error diff --git a/relation/core.md b/relation/core.md index b43ac95..8f98f4b 100644 --- a/relation/core.md +++ b/relation/core.md @@ -22,3 +22,15 @@ The standard error is 3 standard deviation of the mean of the sample. ### relation:StandardDeviation {#StandardDeviation} Dispersion of the values of a random variable around its expected value. + +### relation:MarginOfError {#MarginOfError} + + The margin of error is the range of values below and above the sample statistic in a confidence interval. + +#### relation:MarginOfErrorUpperBound {#MarginOfErrorUppoerBound} + + In case of asymmetric confidence intervals, the upper bound of the margin of error. + +#### relation:MarginOfErrorLowerBound {#MarginOfErrorLowerBound} + + In case of asymmetric confidence intervals, the lower bound of the margin of error. diff --git a/relation/relation.ttl b/relation/relation.ttl index 6212512..5b4ad20 100644 --- a/relation/relation.ttl +++ b/relation/relation.ttl @@ -39,3 +39,29 @@ relation:StandardDeviation a meta:DimensionRelation; rdfs:comment "Dispersion of the values of a random variable around its expected value."; schema:about ; schema:sameAs . + +relation:MarginOfError a meta:DimensionRelation; + schema:name "Margin of Error"; + rdfs:label "Margin of Error"; + schema:description "The margin of error is a statistic expressing the amount of random sampling error in a survey's results."; + rdfs:comment "The margin of error is a statistic expressing the amount of random sampling error in a survey's results."; + schema:about ; + schema:sameAs . + +relation:MarginOfErrorUpperBound + a meta:DimensionRelation; + schema:name "Margin of Error (Upper Bound)"; + rdfs:label "Margin of Error (Upper Bound)"; + schema:description "The upper bound of the margin of error."; + rdfs:comment "The upper bound of the margin of error."; + schema:about ; + schema:sameAs . + +relation:MarginOfErrorLowerBound + a meta:DimensionRelation; + schema:name "Margin of Error (Lower Bound)"; + rdfs:label "Margin of Error (Lower Bound)"; + schema:description "The lower bound of the margin of error."; + rdfs:comment "The lower bound of the margin of error."; + schema:about ; + schema:sameAs . From 56033a378cde417874e27dbaa0357971e4478c25 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Fri, 28 Jun 2024 13:42:33 +0200 Subject: [PATCH 02/13] refactor: term is confidence --- relation/core.md | 32 +++++++++++++++++++++++--------- relation/relation.ttl | 42 +++++++++++++++++------------------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/relation/core.md b/relation/core.md index 8f98f4b..f40331d 100644 --- a/relation/core.md +++ b/relation/core.md @@ -23,14 +23,28 @@ The standard error is 3 standard deviation of the mean of the sample. Dispersion of the values of a random variable around its expected value. -### relation:MarginOfError {#MarginOfError} +### relation:Confidence {#MarginOfError} - The margin of error is the range of values below and above the sample statistic in a confidence interval. +Use `Confidence` to specify the level of uncertainty in the estimate. It can be used multiple times, +in which case add `dcterms:type` to each dimension relation to specify the type of confidence +(Margin of Error, Confidence Interval, etc.). -#### relation:MarginOfErrorUpperBound {#MarginOfErrorUppoerBound} - - In case of asymmetric confidence intervals, the upper bound of the margin of error. - -#### relation:MarginOfErrorLowerBound {#MarginOfErrorLowerBound} - - In case of asymmetric confidence intervals, the lower bound of the margin of error. +#### relation:ConfidenceUpperBound and relation:ConfidenceUpperBound {#ConfidenceBounds} + +In case of asymmetric confidence intervals, use `relation:ConfidenceUpperBound` together with +`relation:ConfidenceUpperBound` to specify the upper and lower bounds of the confidence interval. + +```turtle +[ + meta:dimensionRelation [ + a relation:ConfidenceLowerBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ex:lowerConfidence ; + ], + meta:dimensionRelation [ + a relation:ConfidenceLowerBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ex:upperConfidence ; + ] +] . +``` diff --git a/relation/relation.ttl b/relation/relation.ttl index 5b4ad20..ad44897 100644 --- a/relation/relation.ttl +++ b/relation/relation.ttl @@ -40,28 +40,20 @@ relation:StandardDeviation a meta:DimensionRelation; schema:about ; schema:sameAs . -relation:MarginOfError a meta:DimensionRelation; - schema:name "Margin of Error"; - rdfs:label "Margin of Error"; - schema:description "The margin of error is a statistic expressing the amount of random sampling error in a survey's results."; - rdfs:comment "The margin of error is a statistic expressing the amount of random sampling error in a survey's results."; - schema:about ; - schema:sameAs . - -relation:MarginOfErrorUpperBound - a meta:DimensionRelation; - schema:name "Margin of Error (Upper Bound)"; - rdfs:label "Margin of Error (Upper Bound)"; - schema:description "The upper bound of the margin of error."; - rdfs:comment "The upper bound of the margin of error."; - schema:about ; - schema:sameAs . - -relation:MarginOfErrorLowerBound - a meta:DimensionRelation; - schema:name "Margin of Error (Lower Bound)"; - rdfs:label "Margin of Error (Lower Bound)"; - schema:description "The lower bound of the margin of error."; - rdfs:comment "The lower bound of the margin of error."; - schema:about ; - schema:sameAs . +relation:Confidence a meta:DimensionRelation; + schema:name "Confidence" ; + rdfs:label "Confidence" ; + schema:about . + +relation:ConfidenceUpperBound + a meta:DimensionRelation ; + schema:name "Confidence (Upper Bound)" ; + rdfs:label "Confidence (Upper Bound)" ; + schema:about +. + +relation:ConfidenceLowerBound + a meta:DimensionRelation ; + schema:name "Confidence (Lower Bound)" ; + rdfs:label "Confidence (Lower Bound)" ; + schema:about . From 7dda5fc41a31286533d27d805c786eb18233a771 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 8 Jul 2024 07:30:04 +0200 Subject: [PATCH 03/13] fix: typing errors --- relation/core.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relation/core.md b/relation/core.md index f40331d..dbe00a3 100644 --- a/relation/core.md +++ b/relation/core.md @@ -29,10 +29,10 @@ Use `Confidence` to specify the level of uncertainty in the estimate. It can be in which case add `dcterms:type` to each dimension relation to specify the type of confidence (Margin of Error, Confidence Interval, etc.). -#### relation:ConfidenceUpperBound and relation:ConfidenceUpperBound {#ConfidenceBounds} +#### relation:ConfidenceUpperBound and relation:ConfidenceLowerBound {#ConfidenceBounds} In case of asymmetric confidence intervals, use `relation:ConfidenceUpperBound` together with -`relation:ConfidenceUpperBound` to specify the upper and lower bounds of the confidence interval. +`relation:ConfidenceLowerBound` to specify the upper and lower bounds of the confidence interval. ```turtle [ @@ -42,7 +42,7 @@ In case of asymmetric confidence intervals, use `relation:ConfidenceUpperBound` meta:relatesTo ex:lowerConfidence ; ], meta:dimensionRelation [ - a relation:ConfidenceLowerBound ; + a relation:ConfidenceUpperBound ; dcterms:type "Confidence interval" ; meta:relatesTo ex:upperConfidence ; ] From 7c58565df2d4d3c4584ad0d9c1415b070f71f9e6 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Thu, 18 Jul 2024 13:22:13 +0200 Subject: [PATCH 04/13] refactor: review suggestions --- relation/core.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relation/core.md b/relation/core.md index dbe00a3..0950ce7 100644 --- a/relation/core.md +++ b/relation/core.md @@ -25,7 +25,7 @@ The standard error is 3 standard deviation of the mean of the sample. ### relation:Confidence {#MarginOfError} -Use `Confidence` to specify the level of uncertainty in the estimate. It can be used multiple times, +Use `Confidence` to specify uncertainty in the estimate. It can be used multiple times, in which case add `dcterms:type` to each dimension relation to specify the type of confidence (Margin of Error, Confidence Interval, etc.). @@ -39,12 +39,12 @@ In case of asymmetric confidence intervals, use `relation:ConfidenceUpperBound` meta:dimensionRelation [ a relation:ConfidenceLowerBound ; dcterms:type "Confidence interval" ; - meta:relatesTo ex:lowerConfidence ; + meta:relatesTo ex:measurement-dimension ; ], meta:dimensionRelation [ a relation:ConfidenceUpperBound ; dcterms:type "Confidence interval" ; - meta:relatesTo ex:upperConfidence ; + meta:relatesTo ex:measurement-dimension ; ] ] . ``` From 2051a36bbf07d4372423722cad045d46c175f907 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Thu, 18 Jul 2024 13:46:33 +0200 Subject: [PATCH 05/13] refactor: better snippet --- relation/core.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/relation/core.md b/relation/core.md index 0950ce7..03ddae9 100644 --- a/relation/core.md +++ b/relation/core.md @@ -36,15 +36,24 @@ In case of asymmetric confidence intervals, use `relation:ConfidenceUpperBound` ```turtle [ - meta:dimensionRelation [ - a relation:ConfidenceLowerBound ; - dcterms:type "Confidence interval" ; - meta:relatesTo ex:measurement-dimension ; - ], - meta:dimensionRelation [ - a relation:ConfidenceUpperBound ; - dcterms:type "Confidence interval" ; - meta:relatesTo ex:measurement-dimension ; - ] + sh:property [ + sh:path ex:measurement-dimension ; + ] ; + sh:property [ + sh:path ex:lower-confidence-dimension ; + meta:dimensionRelation [ + a relation:ConfidenceLowerBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ex:measurement-dimension ; + ] ; + ] ; + sh:property [ + sh:path ex:lower-confidence-dimension ; + meta:dimensionRelation [ + a relation:ConfidenceUpperBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ex:measurement-dimension ; + ] ; + ] ; ] . ``` From 792fdc06572e3a577214dce21c0210df48ddd1a5 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Wed, 18 Sep 2024 13:40:24 +0200 Subject: [PATCH 06/13] test: dimension relation basic tests --- ...valid.dimensionRelation-multipleDcType.ttl | 62 +++++++++++++++ ...onRelation-multipleDcType.ttl.approved.txt | 21 +++++ .../valid.dimensionRelation.ttl | 76 +++++++++++++++++++ .../standalone-constraint-constraint.ttl | 10 +++ 4 files changed, 169 insertions(+) create mode 100644 test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl create mode 100644 test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl.approved.txt create mode 100644 test/standalone-constraint-constraint/valid.dimensionRelation.ttl diff --git a/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl new file mode 100644 index 0000000..2595a5b --- /dev/null +++ b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl @@ -0,0 +1,62 @@ +PREFIX dcterms: +@prefix relation: . +@prefix meta: . +@prefix rdf: . +@prefix cube: . +@prefix observation: . +@prefix sh: . +@prefix xsd: . +@prefix schema: . +@base . + + a cube:Cube ; + cube:observationConstraint ; + cube:observationSet . + + cube:observation , , . + + a cube:Observation ; + cube:observedBy ; + 4.9 ; + 0.1 ; +. + + a cube:Constraint ; + sh:targetClass cube:Observation ; + sh:closed true ; + sh:property + [ + sh:path rdf:type ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:path cube:observedBy ; ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "dimension" ; + sh:minCount 1 ; + sh:maxCount 1 ; + ], + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "upper confidence" ; + sh:minCount 1 ; + sh:maxCount 1 ; + meta:dimensionRelation + [ + a relation:ConfidenceUpperBound ; + dcterms:type "Confidence interval", "bogus" ; + meta:relatesTo ; + ] ; + ]; +. diff --git a/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl.approved.txt b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl.approved.txt new file mode 100644 index 0000000..2ce2feb --- /dev/null +++ b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl.approved.txt @@ -0,0 +1,21 @@ +@prefix sh: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix schema: . +@prefix cube: . + +_:report a sh:ValidationReport ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; + sh:sourceShape [ + sh:path ; + sh:maxCount 1 ; + ] ; + sh:focusNode _:b5 ; + sh:resultPath ; + sh:resultMessage "More than 1 values" ; + ] ; + sh:conforms false . diff --git a/test/standalone-constraint-constraint/valid.dimensionRelation.ttl b/test/standalone-constraint-constraint/valid.dimensionRelation.ttl new file mode 100644 index 0000000..823a02d --- /dev/null +++ b/test/standalone-constraint-constraint/valid.dimensionRelation.ttl @@ -0,0 +1,76 @@ +PREFIX dcterms: +@prefix relation: . +@prefix meta: . +@prefix rdf: . +@prefix cube: . +@prefix observation: . +@prefix sh: . +@prefix xsd: . +@prefix schema: . +@base . + + a cube:Cube ; + cube:observationConstraint ; + cube:observationSet . + + cube:observation , , . + + a cube:Observation ; + cube:observedBy ; + 4.9 ; + 0.1 ; + 0.15 ; +. + + a cube:Constraint ; + sh:targetClass cube:Observation ; + sh:closed true ; + sh:property + [ + sh:path rdf:type ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:path cube:observedBy ; ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "dimension" ; + sh:minCount 1 ; + sh:maxCount 1 ; + ], + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "upper confidence" ; + sh:minCount 1 ; + sh:maxCount 1 ; + meta:dimensionRelation + [ + a relation:ConfidenceUpperBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ; + ] ; + ], + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "lower confidence" ; + sh:minCount 1 ; + sh:maxCount 1 ; + meta:dimensionRelation + [ + a relation:ConfidenceLowerBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ; + ] ; + ] ; +. diff --git a/validation/standalone-constraint-constraint.ttl b/validation/standalone-constraint-constraint.ttl index bc3c56b..0ef1aea 100644 --- a/validation/standalone-constraint-constraint.ttl +++ b/validation/standalone-constraint-constraint.ttl @@ -1,3 +1,4 @@ +@prefix dcterms: . @prefix : . @prefix dash: . @prefix rdf: . @@ -8,6 +9,7 @@ @prefix cube: . @prefix meta: . @prefix qudt: . +@prefix relation: . # # This is the bare minimal SHACL shape for validating a Cube Constraint. @@ -190,6 +192,14 @@ ] ; . +:Confidende a sh:NodeShape ; + sh:targetClass relation:ConfidenceLowerBound, relation:ConfidenceUpperBound ; + sh:property + [ + sh:path dcterms:type ; + sh:maxCount 1 ; + ] ; +. # Testing proper rdf:list construction From c911e11307c4e9ec7d51a8b52ed16b3efa091a93 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Wed, 18 Sep 2024 14:13:18 +0200 Subject: [PATCH 07/13] test: validate `meta:relatesTo` --- ...dimensionRelation-relatesToNotMatching.ttl | 62 +++++++++++++++++++ ...tion-relatesToNotMatching.ttl.approved.txt | 46 ++++++++++++++ .../standalone-constraint-constraint.ttl | 27 +++++--- 3 files changed, 128 insertions(+), 7 deletions(-) create mode 100644 test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl create mode 100644 test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl.approved.txt diff --git a/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl b/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl new file mode 100644 index 0000000..7c27982 --- /dev/null +++ b/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl @@ -0,0 +1,62 @@ +@prefix dcterms: . +@prefix relation: . +@prefix meta: . +@prefix rdf: . +@prefix cube: . +@prefix observation: . +@prefix sh: . +@prefix xsd: . +@prefix schema: . +@base . + + a cube:Cube ; + cube:observationConstraint ; + cube:observationSet . + + cube:observation , , . + + a cube:Observation ; + cube:observedBy ; + 4.9 ; + 0.1 ; +. + + a cube:Constraint ; + sh:targetClass cube:Observation ; + sh:closed true ; + sh:property + [ + sh:path rdf:type ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:path cube:observedBy ; ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 + ] ; + sh:property + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "dimension" ; + sh:minCount 1 ; + sh:maxCount 1 ; + ], + [ + sh:datatype xsd:decimal ; + sh:path ; + schema:name "upper confidence" ; + sh:minCount 1 ; + sh:maxCount 1 ; + meta:dimensionRelation + [ + a relation:ConfidenceUpperBound ; + dcterms:type "Confidence interval" ; + meta:relatesTo ; + ] ; + ]; +. diff --git a/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl.approved.txt b/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl.approved.txt new file mode 100644 index 0000000..4bac4dc --- /dev/null +++ b/test/standalone-constraint-constraint/invalid.dimensionRelation-relatesToNotMatching.ttl.approved.txt @@ -0,0 +1,46 @@ +@prefix sh: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix schema: . +@prefix cube: . + +_:report a sh:ValidationReport ; + sh:result [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:NodeConstraintComponent ; + sh:sourceShape [ + sh:path sh:property ; + sh:node ; + ] ; + sh:focusNode ; + sh:resultPath sh:property ; + sh:resultMessage "Value does not have shape " ; + sh:detail [ + rdf:type sh:ValidationResult ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinCountConstraintComponent ; + sh:sourceShape [ + sh:path _:b675 ; + sh:class cube:Constraint ; + sh:minCount 1 ; + sh:message "value of meta:relatesTo must be a cube dimension" ; + ] ; + sh:focusNode _:b5 ; + sh:resultPath _:b675 ; + sh:resultMessage "value of meta:relatesTo must be a cube dimension" ; + ] ; + sh:value _:b4 ; + ] ; + sh:conforms false . + +_:b675 rdf:first ; + rdf:rest ( + [ + sh:inversePath sh:path ; + ] + [ + sh:inversePath sh:property ; + ] + ) . diff --git a/validation/standalone-constraint-constraint.ttl b/validation/standalone-constraint-constraint.ttl index 0ef1aea..ff86003 100644 --- a/validation/standalone-constraint-constraint.ttl +++ b/validation/standalone-constraint-constraint.ttl @@ -181,14 +181,27 @@ . :DimensionRelation a sh:NodeShape ; - sh:property [ + sh:property + [ sh:path meta:dimensionRelation; - sh:property [ - sh:path meta:relatesTo; - sh:nodeKind sh:IRI ; - sh:minCount 1; - sh:message "meta:dimensionRelation requires at least one meta:relatesTo"; - ] ; + sh:property + [ + sh:path meta:relatesTo ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:message "meta:dimensionRelation requires at least one meta:relatesTo" ; + ], + [ + sh:path + ( + meta:relatesTo + [ sh:inversePath sh:path ] + [ sh:inversePath sh:property ] + ) ; + sh:minCount 1 ; + sh:class cube:Constraint ; + sh:message "value of meta:relatesTo must be a cube dimension" ; + ] ; ] ; . From a41f71625bc13408a1092dbdf9770fcfba82fd47 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Wed, 18 Sep 2024 14:14:43 +0200 Subject: [PATCH 08/13] chore: changeset --- .changeset/lucky-doors-brush.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/lucky-doors-brush.md diff --git a/.changeset/lucky-doors-brush.md b/.changeset/lucky-doors-brush.md new file mode 100644 index 0000000..65b6db4 --- /dev/null +++ b/.changeset/lucky-doors-brush.md @@ -0,0 +1,8 @@ +--- +"cube-link": patch +--- + +Improve validation of `meta:dimensionRelation`: + +1. Check that upper/lower bound has at most one `dcterms:type` +2. Check that `meta:relatesTo` is actually a dimension From 35f7f7ad7a732a0a2cf84fef0112553e7a9bcf9a Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Wed, 18 Sep 2024 15:09:10 +0200 Subject: [PATCH 09/13] ci: running script on windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ba9cb1..03dbb7f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "trifid:local": "trifid --verbose --config=trifid/config.local.json", "lint": "standard", "test": "run-p --aggregate-output -cns \"test:* -- {@}\" --", - "test:observations": "./test/check-observations.sh", + "test:observations": "sh ./test/check-observations.sh", "test:basic-cube-constraint": "./test/check-metadata.sh basic-cube-constraint", "test:standalone-cube-constraint": "./test/check-metadata.sh standalone-cube-constraint", "test:standalone-constraint-constraint": "./test/check-metadata.sh standalone-constraint-constraint", From bb83580c246c4b8d1df8497fdbe4d266fb5d1751 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Thu, 19 Sep 2024 10:47:15 +0200 Subject: [PATCH 10/13] chore: update blank nodes in tests --- .../invalid.malformedList.ttl.approved.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt b/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt index 97be214..d8ac373 100644 --- a/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt +++ b/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt @@ -10,7 +10,7 @@ _:report a sh:ValidationReport ; rdf:type sh:ValidationResult ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape _:b679 ; + sh:sourceShape _:b686 ; sh:focusNode _:b6 ; sh:resultPath rdf:rest ; sh:resultMessage "list node needs exactly one rdf:rest" ; @@ -41,7 +41,7 @@ _:report a sh:ValidationReport ; rdf:type sh:ValidationResult ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape _:b679 ; + sh:sourceShape _:b686 ; sh:focusNode _:b6 ; sh:resultPath rdf:rest ; sh:resultMessage "list node needs exactly one rdf:rest" ; @@ -60,7 +60,7 @@ _:report a sh:ValidationReport ; ] ; sh:conforms false . -_:b679 sh:path rdf:rest ; +_:b686 sh:path rdf:rest ; sh:maxCount 1 ; sh:minCount 1 ; sh:message "list node needs exactly one rdf:rest" . From 49c2df2d683977531b0f3f947cd63dae2912ded5 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Tue, 24 Sep 2024 12:05:20 +0200 Subject: [PATCH 11/13] fix typo --- validation/standalone-constraint-constraint.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/standalone-constraint-constraint.ttl b/validation/standalone-constraint-constraint.ttl index ff86003..3b88cac 100644 --- a/validation/standalone-constraint-constraint.ttl +++ b/validation/standalone-constraint-constraint.ttl @@ -205,7 +205,7 @@ ] ; . -:Confidende a sh:NodeShape ; +:Confidence a sh:NodeShape ; sh:targetClass relation:ConfidenceLowerBound, relation:ConfidenceUpperBound ; sh:property [ From a31482ae4e9ba10e4d577d201405cf41430135f6 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 30 Sep 2024 11:17:15 +0200 Subject: [PATCH 12/13] feat: require related dimension to be a cube:MeasureDimension --- .../invalid.dimensionRelation-multipleDcType.ttl | 1 + .../valid.dimensionRelation.ttl | 1 + validation/standalone-constraint-constraint.ttl | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl index 2595a5b..d6ea241 100644 --- a/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl +++ b/test/standalone-constraint-constraint/invalid.dimensionRelation-multipleDcType.ttl @@ -40,6 +40,7 @@ PREFIX dcterms: ] ; sh:property [ + a cube:MeasureDimension ; sh:datatype xsd:decimal ; sh:path ; schema:name "dimension" ; diff --git a/test/standalone-constraint-constraint/valid.dimensionRelation.ttl b/test/standalone-constraint-constraint/valid.dimensionRelation.ttl index 823a02d..ef32bcd 100644 --- a/test/standalone-constraint-constraint/valid.dimensionRelation.ttl +++ b/test/standalone-constraint-constraint/valid.dimensionRelation.ttl @@ -41,6 +41,7 @@ PREFIX dcterms: ] ; sh:property [ + a cube:MeasureDimension ; sh:datatype xsd:decimal ; sh:path ; schema:name "dimension" ; diff --git a/validation/standalone-constraint-constraint.ttl b/validation/standalone-constraint-constraint.ttl index 3b88cac..ebd84ae 100644 --- a/validation/standalone-constraint-constraint.ttl +++ b/validation/standalone-constraint-constraint.ttl @@ -201,6 +201,15 @@ sh:minCount 1 ; sh:class cube:Constraint ; sh:message "value of meta:relatesTo must be a cube dimension" ; + ], + [ + sh:path + ( + meta:relatesTo + [ sh:inversePath sh:path ] + ) ; + sh:class cube:MeasureDimension ; + sh:message "value of meta:relatesTo must point to measure dimension " ; ] ; ] ; . From 7cb9da89dc3f46560de61bf82d3020ee79146cba Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Mon, 30 Sep 2024 11:27:34 +0200 Subject: [PATCH 13/13] chore: approve bnodes --- .../invalid.malformedList.ttl.approved.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt b/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt index d8ac373..e9aa921 100644 --- a/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt +++ b/test/standalone-constraint-constraint/invalid.malformedList.ttl.approved.txt @@ -10,7 +10,7 @@ _:report a sh:ValidationReport ; rdf:type sh:ValidationResult ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape _:b686 ; + sh:sourceShape _:b690 ; sh:focusNode _:b6 ; sh:resultPath rdf:rest ; sh:resultMessage "list node needs exactly one rdf:rest" ; @@ -41,7 +41,7 @@ _:report a sh:ValidationReport ; rdf:type sh:ValidationResult ; sh:resultSeverity sh:Violation ; sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape _:b686 ; + sh:sourceShape _:b690 ; sh:focusNode _:b6 ; sh:resultPath rdf:rest ; sh:resultMessage "list node needs exactly one rdf:rest" ; @@ -60,7 +60,7 @@ _:report a sh:ValidationReport ; ] ; sh:conforms false . -_:b686 sh:path rdf:rest ; +_:b690 sh:path rdf:rest ; sh:maxCount 1 ; sh:minCount 1 ; sh:message "list node needs exactly one rdf:rest" .