From f3d6ed2b77b436f4761bbff46acd8c759364ac7d Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 11 Jul 2020 19:08:22 -0400 Subject: [PATCH] update schema/validator --- reproschema/tests/contexts/generic | 4 ++-- reproschema/tests/data/activities/activity1.jsonld | 6 ++++++ reproschema/tests/reproschema-shacl.ttl | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/reproschema/tests/contexts/generic b/reproschema/tests/contexts/generic index 1aa0ec3..7ab9c3e 100644 --- a/reproschema/tests/contexts/generic +++ b/reproschema/tests/contexts/generic @@ -116,8 +116,8 @@ "@id": "schema:readonlyValue", "@nest": "ui" }, - "scoringLogic": { - "@id": "reproschema:scoringLogic", + "compute": { + "@id": "reproschema:compute", "@container": "@index" }, "jsExpression": { diff --git a/reproschema/tests/data/activities/activity1.jsonld b/reproschema/tests/data/activities/activity1.jsonld index 22c6778..294472a 100644 --- a/reproschema/tests/data/activities/activity1.jsonld +++ b/reproschema/tests/data/activities/activity1.jsonld @@ -11,6 +11,12 @@ "en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?", "es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?" }, + "compute": [ + { + "variableName": "phq9_total_score", + "jsExpression": "phq9_1 + phq9_2 + phq9_3 + phq9_4 + phq9_5 + phq9_6 + phq9_7 + phq9_8 + phq9_9" + } + ], "ui": { "addProperties": [ { "isAbout": "items/item1.jsonld", diff --git a/reproschema/tests/reproschema-shacl.ttl b/reproschema/tests/reproschema-shacl.ttl index 1febabf..587a629 100644 --- a/reproschema/tests/reproschema-shacl.ttl +++ b/reproschema/tests/reproschema-shacl.ttl @@ -31,8 +31,8 @@ reproschema:ActivityShape a sh:NodeShape ; [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], - [ sh:node reproschema:ScoringShape ; - sh:path reproschema:scoringLogic ], + [ sh:node reproschema:ComputeSpecificationShape ; + sh:path reproschema:compute ], [ sh:maxCount 1 ; sh:node dash:ListShape ; @@ -126,8 +126,8 @@ reproschema:ProtocolShape a sh:NodeShape ; [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], - [ sh:node reproschema:ScoringShape ; - sh:path reproschema:scoringLogic ], + [ sh:node reproschema:ComputeSpecificationShape ; + sh:path reproschema:compute ], [ sh:minCount 1 ; sh:node dash:ListShape ; @@ -229,7 +229,7 @@ reproschema:IsVisShape a sh:NodeShape ; sh:minCount 1 ; sh:path reproschema:payload ] . -reproschema:ScoringShape a sh:NodeShape ; +reproschema:ComputeSpecificationShape a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ;