From 4893be4363f87ecd4d2940b281f350daa4c488ba Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Mon, 29 Jun 2020 12:49:08 -0400 Subject: [PATCH 01/18] add AllowReplay constant to generic and terms --- contexts/generic | 1 + terms/AllowReplay | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 terms/AllowReplay diff --git a/contexts/generic b/contexts/generic index a0713c7663..d77ff88b6e 100644 --- a/contexts/generic +++ b/contexts/generic @@ -141,6 +141,7 @@ "reproschema:AutoAdvance": {"@id": "reproschema:AutoAdvance"}, "reproschema:DisableBack": {"@id": "reproschema:DisableBack"}, "reproschema:AllowExport": {"@id": "reproschema:AllowExport"}, + "reproschema:AllowReplay": {"@id": "reproschema:AllowReplay"}, "timer": { "@id": "reproschema:timer", "@type": "@id", diff --git a/terms/AllowReplay b/terms/AllowReplay new file mode 100644 index 0000000000..4ab2fd94b0 --- /dev/null +++ b/terms/AllowReplay @@ -0,0 +1,7 @@ +{ + "@context": "../contexts/base", + "@id": "reproschema:AllowReplay", + "@type": "rdfs:Class", + "rdfs:comment": "Indicates (by boolean) if items can be replayed or not.", + "rdfs:label": "Allow replay" +} From 16509fa7e447986c8ea3024b8f272bb289296c22 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Mon, 29 Jun 2020 12:56:27 -0400 Subject: [PATCH 02/18] ref: single validation file --- .github/workflows/pythonpackage.yml | 2 +- validation/ActivityShape.ttl | 131 --------------- validation/FieldShape.ttl | 114 ------------- validation/ProtocolShape.ttl | 130 --------------- validation/ResponseOptionShape.ttl | 75 --------- validation/reproschema-shacl.ttl | 248 ++++++++++++++++++++++++++++ 6 files changed, 249 insertions(+), 451 deletions(-) delete mode 100644 validation/ActivityShape.ttl delete mode 100644 validation/FieldShape.ttl delete mode 100644 validation/ProtocolShape.ttl delete mode 100644 validation/ResponseOptionShape.ttl create mode 100644 validation/reproschema-shacl.ttl diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 2d375db3f8..122e9cd006 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -27,4 +27,4 @@ jobs: - name: Test with pyshacl run: | python tests/jsonParser.py - reproschema -l DEBUG validate --shapedir validation examples + reproschema -l DEBUG validate --shapefile validation/reproschema-shacl.ttl examples diff --git a/validation/ActivityShape.ttl b/validation/ActivityShape.ttl deleted file mode 100644 index 0138285cda..0000000000 --- a/validation/ActivityShape.ttl +++ /dev/null @@ -1,131 +0,0 @@ -@prefix dash: . -@prefix rdf: . -@prefix rdfs: . -@prefix schema: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . -@prefix reproschema: . -@prefix skos: . - - -reproschema:ActivityShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass reproschema:Activity ; - sh:property [ - sh:path schema:description; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:schemaVersion; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:version ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:citation ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path skos:prefLabel ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:preamble; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path reproschema:scoringLogic ; - sh:node reproschema:ScoringShape ; - ] ; - sh:property [ - sh:path reproschema:order ; - sh:node dash:ListShape ; - sh:maxCount 1 ; - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - ] - ] ; - sh:property [ - sh:path reproschema:addProperties ; - sh:node reproschema:AddPropertiesShape ; - ] ; - sh:property [ - sh:path reproschema:inputType ; - sh:datatype xsd:string ; - ] ; - sh:property [ - sh:path reproschema:shuffle ; - sh:datatype schema:Boolean ; - ] ; - sh:property [ - sh:path reproschema:allow ; - sh:nodeKind sh:IRI ; - ] . - -reproschema:AddPropertiesShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path reproschema:variableName ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:isAbout ; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:requiredValue ; - sh:datatype schema:Boolean ; - ] ; - sh:property [ - sh:path reproschema:isVis ; - sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ]) ; - ] ; - sh:property [ - sh:path skos:prefLabel ; - sh:datatype rdf:langString ; - ] . - -reproschema:ScoringShape - a sh:NodeShape ; - sh:closed true ; - sh:property [ - sh:path reproschema:variableName ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:jsExpression ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] . - -reproschema:IsVisShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path schema:method ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:url ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path reproschema:payload ; - sh:datatype rdf:langString ; - ] . \ No newline at end of file diff --git a/validation/FieldShape.ttl b/validation/FieldShape.ttl deleted file mode 100644 index 622646e052..0000000000 --- a/validation/FieldShape.ttl +++ /dev/null @@ -1,114 +0,0 @@ -@prefix dash: . -@prefix rdf: . -@prefix rdfs: . -@prefix schema: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . -@prefix skos: . -@prefix reproschema: . - -reproschema:FieldShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass reproschema:Field ; - sh:property [ - sh:path skos:prefLabel; - sh:datatype rdf:langString ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path skos:altLabel; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:description ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:schemaVersion ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:version ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:question ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path reproschema:preamble; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:inputType ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:readOnly ; - sh:datatype xsd:boolean ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:responseOptions ; - sh:node reproschema:ResponseOptionsShape ; - ] . - -reproschema:ResponseOptionsShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path reproschema:multipleChoice ; - sh:datatype schema:Boolean ; - ] ; - sh:property [ - sh:path schema:minValue ; - sh:datatype xsd:integer ; - ] ; - sh:property [ - sh:path schema:maxValue ; - sh:datatype xsd:integer ; - ] ; - sh:property [ - sh:path reproschema:valueType ; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path schema:itemListElement ; - sh:node reproschema:ChoicesShape ; - ] . - -reproschema:ChoicesShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path schema:name ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:value ; - sh:datatype xsd:integer ; - ] ; - sh:property [ - sh:path schema:image ; - sh:datatype xsd:string ; - ] ; - sh:property [ - sh:path reproschema:dontKnow ; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path reproschema:skipped ; - sh:nodeKind sh:IRI ; - ] . \ No newline at end of file diff --git a/validation/ProtocolShape.ttl b/validation/ProtocolShape.ttl deleted file mode 100644 index 8b0f945cdc..0000000000 --- a/validation/ProtocolShape.ttl +++ /dev/null @@ -1,130 +0,0 @@ -@prefix dash: . -@prefix rdf: . -@prefix rdfs: . -@prefix schema: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . -@prefix reproschema: . -@prefix skos: . - - -reproschema:ProtocolShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass reproschema:Protocol ; - sh:property [ - sh:path schema:description; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:schemaVersion; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:version ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:image ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:landingPage ; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path skos:prefLabel ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:preamble; - sh:datatype rdf:langString ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:scoringLogic ; - sh:node reproschema:ScoringShape ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:order ; - sh:node dash:ListShape ; - sh:minCount 1 ; - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - ] - ] ; - sh:property [ - sh:path reproschema:addProperties ; - sh:node reproschema:AddPropertiesShape ; - ] ; - sh:property [ - sh:path reproschema:shuffle ; - sh:datatype schema:Boolean ; - ] ; - sh:property [ - sh:path reproschema:allow ; - sh:nodeKind sh:IRI ; - ] . - -reproschema:AddPropertiesShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path reproschema:variableName ; - sh:datatype rdf:langString ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:isAbout ; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path reproschema:isVis ; - sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ]) ; - ] ; - sh:property [ - sh:path skos:prefLabel ; - sh:datatype rdf:langString ; - ] . - -reproschema:IsVisShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path schema:method ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:url ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path reproschema:payload ; - sh:datatype rdf:langString ; - ] . - -reproschema:ScoringShape - a sh:NodeShape ; - sh:closed true ; - sh:property [ - sh:path reproschema:variableName ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path reproschema:jsExpression ; - sh:datatype rdf:langString ; - ] . diff --git a/validation/ResponseOptionShape.ttl b/validation/ResponseOptionShape.ttl deleted file mode 100644 index 08e5809466..0000000000 --- a/validation/ResponseOptionShape.ttl +++ /dev/null @@ -1,75 +0,0 @@ -@prefix dash: . -@prefix rdf: . -@prefix rdfs: . -@prefix schema: . -@prefix sh: . -@prefix xsd: . -@prefix dash: . -@prefix skos: . -@prefix reproschema: . - -reproschema:ResponseOptionsShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass reproschema:ResponseOptions ; - sh:property [ - sh:path reproschema:valueType; - sh:nodeKind sh:IRI ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path schema:minValue ; - sh:datatype xsd:integer ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:maxValue ; - sh:datatype xsd:integer ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:multipleChoice; - sh:datatype schema:Boolean ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path reproschema:datumType ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:unitCode ; - sh:or ( [ sh:datatype schema:URL ] [ sh:datatype rdf:langString ] ) ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:path schema:itemListElement ; - sh:node reproschema:ChoicesShape ; - ] . - - -reproschema:ChoicesShape - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ - sh:path schema:name ; - sh:datatype rdf:langString ; - ] ; - sh:property [ - sh:path schema:value ; - sh:datatype xsd:integer ; - ] ; - sh:property [ - sh:path schema:image ; - sh:datatype xsd:string ; - ] ; - sh:property [ - sh:path reproschema:dontKnow ; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path reproschema:skipped ; - sh:nodeKind sh:IRI ; - ] . \ No newline at end of file diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl new file mode 100644 index 0000000000..de11c52da3 --- /dev/null +++ b/validation/reproschema-shacl.ttl @@ -0,0 +1,248 @@ +@prefix nidm: . +@prefix prov: . +@prefix rdf: . +@prefix rdfs: . +@prefix reproschema: . +@prefix schema: . +@prefix skos: . + +reproschema:Activity a nidm:Assessment, + rdfs:Class, + prov:Entity, + prov:Plan ; + rdfs:label "Activity" ; + rdfs:comment "An assessment in a protocol." ; + rdfs:subClassOf schema:CreativeWork . + +reproschema:AdditionalProperty a rdfs:Class ; + rdfs:label "Additional properties" ; + rdfs:comment "An object to describe the various properties added to assessments and fields." . + +reproschema:AllowExport a rdfs:Class ; + rdfs:label "Allow export" ; + rdfs:comment "Indicates (by boolean) if data can be exported or not." . + +reproschema:AutoAdvance a rdfs:Class ; + rdfs:label "Auto advance" ; + rdfs:comment "Indicates (by boolean) if assessments in a protocol can auto advance or not." . + +reproschema:Choice a rdfs:Class ; + rdfs:label "Response choice" ; + rdfs:comment "An array to list the available options in responseOptions of the Field item." . + +reproschema:DisableBack a rdfs:Class ; + rdfs:label "Disable redo" ; + rdfs:comment "Indicates (by boolean) if we can go back to a completed assessment in a protocol." . + +reproschema:DontKnow a rdfs:Class ; + rdfs:label "Do not know" ; + rdfs:comment "An element to describe the choice when response is not known." . + +reproschema:Field a nidm:DataElement, + rdfs:Class, + prov:Entity ; + rdfs:label "Field" ; + rdfs:comment "An item in an assessment." ; + rdfs:subClassOf schema:CreativeWork . + +reproschema:Protocol a rdfs:Class, + prov:Entity, + prov:Plan ; + rdfs:label "Protocol" ; + rdfs:comment "A representation of a study which comprises one or more assessments." ; + rdfs:subClassOf schema:CreativeWork . + +reproschema:ResponseOption a rdfs:Class ; + rdfs:label "Response option" ; + rdfs:comment "An element (object or by URL)to describe the properties of response of the Field item." . + +reproschema:Scoring a rdfs:Class ; + rdfs:label "Scoring logic" ; + rdfs:comment "An object indicating score in an activity or protocol and the score Field item " . + +reproschema:Skipped a rdfs:Class ; + rdfs:label "Skipped" ; + rdfs:comment "An element to describe the choice when the item is skipped." . + +reproschema:TimedOut a rdfs:Class ; + rdfs:label "Response timed out" ; + rdfs:comment "A boolean element to describe if the response did not occur within the prescribed time." . + +schema:about schema:domainIncludes reproschema:Activity, + reproschema:Field, + reproschema:Protocol . + +schema:associatedMedia schema:domainIncludes reproschema:Field . + +schema:citation schema:domainIncludes reproschema:Activity . + +schema:description schema:domainIncludes reproschema:Activity, + reproschema:Field, + reproschema:Protocol . + +schema:image schema:domainIncludes reproschema:Choice . + +schema:isPartOf schema:domainIncludes reproschema:Field ; + schema:rangeIncludes reproschema:Activity . + +schema:maxValue schema:domainIncludes reproschema:ResponseOption . + +schema:minValue schema:domainIncludes reproschema:ResponseOption . + +schema:name schema:domainIncludes reproschema:Choice . + +schema:question schema:domainIncludes reproschema:Field . + +schema:readonlyValue schema:domainIncludes reproschema:Field . + +schema:schemaVersion schema:domainIncludes reproschema:Activity, + reproschema:Field, + reproschema:Protocol . + +schema:unitCode schema:domainIncludes reproschema:ResponseOption . + +schema:value schema:domainIncludes reproschema:Choice ; + schema:rangeIncludes reproschema:DontKnow, + reproschema:Skipped . + +schema:valueRequired schema:domainIncludes reproschema:AdditionalProperty . + +schema:version schema:domainIncludes reproschema:Activity, + reproschema:Field, + reproschema:Protocol . + +reproschema:addProperties a rdf:Property ; + rdfs:label "addProperties" ; + schema:domainIncludes reproschema:Activity, + reproschema:Protocol ; + schema:rangeIncludes reproschema:AdditionalProperty ; + rdfs:comment "An array of objects to describe the various properties added to assessments and fields." . + +reproschema:allow a rdf:Property ; + rdfs:label "allow" ; + schema:domainIncludes reproschema:Protocol ; + schema:rangeIncludes schema:Thing ; + rdfs:comment "An array of items indicating properties allowed on an activity or protocol " . + +reproschema:choices a rdf:Property ; + rdfs:label "choices" ; + schema:domainIncludes reproschema:ResponseOption ; + schema:rangeIncludes schema:URL, + reproschema:Choice ; + schema:sameAs schema:itemListElement ; + rdfs:comment "An array to list the available options in responseOptions of the Field item." . + +reproschema:datumType a rdf:Property ; + rdfs:label "datumType" ; + schema:domainIncludes reproschema:ResponseOption ; + schema:rangeIncludes schema:Text, + schema:URL ; + rdfs:comment "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item." . + +reproschema:inputType a rdf:Property ; + rdfs:label "inputType" ; + schema:domainIncludes reproschema:Field ; + schema:rangeIncludes schema:Text ; + rdfs:comment "An element to describe the input type of a Field item." . + +reproschema:isAbout a rdf:Property ; + rdfs:label "isAbout" ; + schema:domainIncludes reproschema:AdditionalProperty ; + schema:rangeIncludes reproschema:Activity, + reproschema:Field ; + rdfs:comment "An element to define (by URL) the corresponding nodes." . + +reproschema:isVis a rdf:Property ; + rdfs:label "visibility" ; + schema:domainIncludes reproschema:AdditionalProperty ; + schema:rangeIncludes schema:Boolean, + schema:Text ; + rdfs:comment "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." . + +reproschema:jsExpression a rdf:Property ; + rdfs:label "JavaScript Expression" ; + schema:domainIncludes reproschema:Scoring ; + schema:rangeIncludes schema:Boolean, + schema:Text ; + rdfs:comment "A JavaScript expression to compute a score from other variables." . + +reproschema:landingPage a rdf:Property ; + rdfs:label "Landing page content" ; + schema:domainIncludes reproschema:Protocol ; + schema:rangeIncludes schema:Text, + schema:URL ; + rdfs:comment "An element (by URL) to point to the protocol readme or landing page." . + +reproschema:multipleChoice a rdf:Property ; + rdfs:label "Multiple choice response expectation" ; + schema:domainIncludes reproschema:ResponseOption ; + schema:rangeIncludes schema:Boolean ; + rdfs:comment "Indicates (by bool) if response for the Field item has one or more answer." . + +reproschema:order a rdf:Property ; + rdfs:label "Order" ; + schema:domainIncludes reproschema:Activity, + reproschema:Protocol ; + schema:rangeIncludes schema:URL, + reproschema:Activity, + reproschema:Field ; + rdfs:comment "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." . + +reproschema:preamble a rdf:Property ; + rdfs:label "Preamble" ; + schema:domainIncludes reproschema:Activity, + reproschema:Field ; + schema:rangeIncludes schema:Text, + rdf:langString ; + rdfs:comment "The preamble for an assessment" . + +reproschema:responseOptions a rdf:Property ; + rdfs:label "Response options" ; + schema:domainIncludes reproschema:Field ; + schema:rangeIncludes schema:URL, + reproschema:ResponseOption ; + rdfs:comment "An element (object or by URL)to describe the properties of response of the Field item." . + +reproschema:scoringLogic a rdf:Property ; + rdfs:label "Scoring logic objects" ; + schema:domainIncludes reproschema:Activity, + reproschema:Protocol ; + schema:rangeIncludes reproschema:Scoring ; + rdfs:comment "An array of objects indicating score in an activity or protocol and maps it to the score Field item " . + +reproschema:shuffle a rdf:Property ; + rdfs:label "Shuffle" ; + schema:domainIncludes reproschema:Activity, + reproschema:Protocol ; + schema:rangeIncludes schema:boolean ; + rdfs:comment "An element (bool) to determine if the list of items is shuffled or in order." . + +reproschema:statusOptions a rdf:Property ; + rdfs:label "Status options" ; + schema:rangeIncludes schema:Text ; + rdfs:comment "Provides information on whether or not a field item wants to be accompanied by the additional status option(s) defined in “statusOptions”" . + +reproschema:valueType a rdf:Property ; + rdfs:label "The type of the response" ; + schema:domainIncludes reproschema:ResponseOption ; + schema:rangeIncludes schema:Text, + rdf:langString ; + rdfs:comment "The type of the response of an item. For example, string, integer, etc." . + +reproschema:variableName a rdf:Property ; + rdfs:label "variableName" ; + schema:domainIncludes reproschema:AdditionalProperty, + reproschema:Scoring ; + schema:rangeIncludes schema:Text ; + rdfs:comment "The name used to represent an item." . + +skos:prefLabel a rdf:Property ; + rdfs:label "prefLabel" ; + schema:domainIncludes reproschema:Activity, + reproschema:AdditionalProperty, + reproschema:Field, + reproschema:Protocol ; + schema:rangeIncludes schema:Text ; + rdfs:comment "Indicates the label of an Activity or Field to be used as display name.", + "Indicates the label of the Field.", + "The preferred name of the assessment." . From 716e5542d044756e5523ecfd48ab129808543691 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Mon, 29 Jun 2020 14:07:55 -0400 Subject: [PATCH 03/18] expand example activity, protocol --- examples/activities/activity1_embed.jsonld | 76 ++++++++++++++ examples/protocols/protocol1_embed.jsonld | 110 +++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 examples/activities/activity1_embed.jsonld create mode 100644 examples/protocols/protocol1_embed.jsonld diff --git a/examples/activities/activity1_embed.jsonld b/examples/activities/activity1_embed.jsonld new file mode 100644 index 0000000000..3326cd8485 --- /dev/null +++ b/examples/activities/activity1_embed.jsonld @@ -0,0 +1,76 @@ +{ + "@context": "../../contexts/generic", + "@type": "reproschema:Activity", + "@id": "activity1.jsonld", + "skos:prefLabel": "Example 1", + "description": "Activity example 1", + "schemaVersion": "0.0.1", + "version": "0.0.1", + "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/", + "preamble": { + "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?" + }, + "ui": { + "addProperties": [ + { "isAbout": "items/item1.jsonld", + "variableName": "item1", + "requiredValue": true, + "isVis": true} + ], + "order": [ + { + "@type": "reproschema:Field", + "@id": "items/item1.jsonld", + "skos:prefLabel": "item1", + "description": "Q1 of example 1", + "schemaVersion": "0.0.1", + "version": "0.0.1", + "question": { + "en": "Little interest or pleasure in doing things", + "es": "Poco interés o placer en hacer cosas" + }, + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": 0, + "maxValue": 3, + "multipleChoice": false, + "choices": [ + { + "name": { + "en": "Not at all", + "es": "Para nada" + }, + "value": 0 + }, + { + "name": { + "en": "Several days", + "es": "Varios días" + }, + "value": 1 + }, + { + "name": { + "en": "More than half the days", + "es": "Más de la mitad de los días" + }, + "value": 2 + }, + { + "name": { + "en": "Nearly everyday", + "es": "Casi todos los días" + }, + "value": 3 + } + ] + } + } + ], + "shuffle": false + } +} \ No newline at end of file diff --git a/examples/protocols/protocol1_embed.jsonld b/examples/protocols/protocol1_embed.jsonld new file mode 100644 index 0000000000..9734b243e8 --- /dev/null +++ b/examples/protocols/protocol1_embed.jsonld @@ -0,0 +1,110 @@ +{ + "@context": "../../contexts/generic", + "@type": "reproschema:Protocol", + "@id": "protocol1.jsonld", + "prefLabel": { + "en": "Protocol1", + "es": "Protocol1_es" + }, + "description": "example Protocol", + "schemaVersion": "0.0.1", + "version": "0.0.1", + "ui": { + "addProperties": [ + { + "isAbout": "../activities/activity1.jsonld", + "variableName": "activity1", + "prefLabel": { + "en": "Screening", + "es": "Screening_es" + }, + "isVis": true + } + ], + "order": [ + { + "@type": "reproschema:Activity", + "@id": "../activities/activity1.jsonld", + "skos:prefLabel": "Example 1", + "description": "Activity example 1", + "schemaVersion": "0.0.1", + "version": "0.0.1", + "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/", + "preamble": { + "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?" + }, + "ui": { + "addProperties": [ + { + "isAbout": "../activities/items/item1.jsonld", + "variableName": "item1", + "requiredValue": true, + "isVis": true + } + ], + "order": [ + { + "@type": "reproschema:Field", + "@id": "../activities/items/item1.jsonld", + "skos:prefLabel": "item1", + "description": "Q1 of example 1", + "schemaVersion": "0.0.1", + "version": "0.0.1", + "question": { + "en": "Little interest or pleasure in doing things", + "es": "Poco interés o placer en hacer cosas" + }, + "ui": { + "inputType": "radio" + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": 0, + "maxValue": 3, + "multipleChoice": false, + "choices": [ + { + "name": { + "en": "Not at all", + "es": "Para nada" + }, + "value": 0 + }, + { + "name": { + "en": "Several days", + "es": "Varios días" + }, + "value": 1 + }, + { + "name": { + "en": "More than half the days", + "es": "Más de la mitad de los días" + }, + "value": 2 + }, + { + "name": { + "en": "Nearly everyday", + "es": "Casi todos los días" + }, + "value": 3 + } + ] + } + } + ], + "shuffle": false + } + } + ], + "shuffle": false, + "allow": [ + "reproschema:AutoAdvance", + "reproschema:DisableBack", + "reproschema:AllowExport" + ] + } +} From c85d78b5a2afa639a3a39171dc829b3164f78680 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Mon, 29 Jun 2020 15:10:04 -0400 Subject: [PATCH 04/18] deprefix skos:prefLabel in examples --- examples/activities/activity1.jsonld | 2 +- examples/activities/items/item1.jsonld | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/activities/activity1.jsonld b/examples/activities/activity1.jsonld index e6679bd65a..ae7cec9875 100644 --- a/examples/activities/activity1.jsonld +++ b/examples/activities/activity1.jsonld @@ -2,7 +2,7 @@ "@context": "../../contexts/generic", "@type": "reproschema:Activity", "@id": "activity1.jsonld", - "skos:prefLabel": "Example 1", + "prefLabel": "Example 1", "description": "Activity example 1", "schemaVersion": "0.0.1", "version": "0.0.1", diff --git a/examples/activities/items/item1.jsonld b/examples/activities/items/item1.jsonld index c0553b76c5..73e2670738 100644 --- a/examples/activities/items/item1.jsonld +++ b/examples/activities/items/item1.jsonld @@ -2,7 +2,7 @@ "@context": "../../../contexts/generic", "@type": "reproschema:Field", "@id": "item1.jsonld", - "skos:prefLabel": "item1", + "prefLabel": "item1", "description": "Q1 of example 1", "schemaVersion": "0.0.1", "version": "0.0.1", From 954f1870f8b359cd001b0fa0ceacf22da52d3a22 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Tue, 30 Jun 2020 14:33:33 -0400 Subject: [PATCH 05/18] refactor landingPage and remove required key --- contexts/generic | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/contexts/generic b/contexts/generic index d77ff88b6e..bbe1b753db 100644 --- a/contexts/generic +++ b/contexts/generic @@ -49,7 +49,7 @@ }, "landingPage": { "@id": "reproschema:landingPage", - "@container": "@language" + "@container": "@set" }, "question": { "@id": "schema:question", @@ -119,11 +119,6 @@ "isVis": { "@id": "reproschema:isVis" }, - "required": { - "@id": "reproschema:required", - "@container": "@index", - "@nest": "ui" - }, "variableName": "reproschema:variableName", "isAbout": { "@id": "reproschema:isAbout", From 5b2a75a28e48a2f10b08ab6dee9bae26f45b8319 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 30 Jun 2020 16:49:52 -0400 Subject: [PATCH 06/18] remove skos --- examples/activities/activity1_embed.jsonld | 4 ++-- examples/protocols/protocol1_embed.jsonld | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/activities/activity1_embed.jsonld b/examples/activities/activity1_embed.jsonld index 3326cd8485..bb021750d5 100644 --- a/examples/activities/activity1_embed.jsonld +++ b/examples/activities/activity1_embed.jsonld @@ -2,7 +2,7 @@ "@context": "../../contexts/generic", "@type": "reproschema:Activity", "@id": "activity1.jsonld", - "skos:prefLabel": "Example 1", + "prefLabel": "Example 1", "description": "Activity example 1", "schemaVersion": "0.0.1", "version": "0.0.1", @@ -22,7 +22,7 @@ { "@type": "reproschema:Field", "@id": "items/item1.jsonld", - "skos:prefLabel": "item1", + "prefLabel": "item1", "description": "Q1 of example 1", "schemaVersion": "0.0.1", "version": "0.0.1", diff --git a/examples/protocols/protocol1_embed.jsonld b/examples/protocols/protocol1_embed.jsonld index 9734b243e8..0959dfff76 100644 --- a/examples/protocols/protocol1_embed.jsonld +++ b/examples/protocols/protocol1_embed.jsonld @@ -25,7 +25,7 @@ { "@type": "reproschema:Activity", "@id": "../activities/activity1.jsonld", - "skos:prefLabel": "Example 1", + "prefLabel": "Example 1", "description": "Activity example 1", "schemaVersion": "0.0.1", "version": "0.0.1", @@ -47,7 +47,7 @@ { "@type": "reproschema:Field", "@id": "../activities/items/item1.jsonld", - "skos:prefLabel": "item1", + "prefLabel": "item1", "description": "Q1 of example 1", "schemaVersion": "0.0.1", "version": "0.0.1", From 86cf6b4e89a2ba470a7319d7090fc6173d678b44 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Tue, 30 Jun 2020 17:21:03 -0400 Subject: [PATCH 07/18] fix: shape file snafu --- validation/reproschema-shacl.ttl | 475 +++++++++++++++---------------- 1 file changed, 232 insertions(+), 243 deletions(-) diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index de11c52da3..c66d70509b 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -1,248 +1,237 @@ -@prefix nidm: . -@prefix prov: . +@prefix dash: . @prefix rdf: . -@prefix rdfs: . @prefix reproschema: . @prefix schema: . +@prefix sh: . @prefix skos: . +@prefix xsd: . + +reproschema:ActivityShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:path schema:description ], + [ sh:datatype rdf:langString ; + sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; + sh:path schema:version ], + [ sh:datatype rdf:langString ; + sh:path schema:citation ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; + sh:path reproschema:preamble ], + [ sh:node reproschema:ScoringShape ; + sh:path reproschema:scoringLogic ], + [ sh:maxCount 1 ; + sh:node dash:ListShape ; + sh:path reproschema:order ; + sh:property [ sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], + [ sh:node reproschema:AddPropertiesShape ; + sh:path reproschema:addProperties ], + [ sh:datatype xsd:string ; + sh:path reproschema:inputType ], + [ sh:datatype schema:Boolean ; + sh:path reproschema:shuffle ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:allow ] ; + sh:targetClass reproschema:Activity . + +reproschema:FieldShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path skos:altLabel ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:description ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:version ], + [ sh:datatype rdf:langString ; + sh:path schema:question ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:path reproschema:inputType ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:path reproschema:readOnly ], + [ sh:node reproschema:ResponseOptionsShape ; + sh:path reproschema:responseOptions ] ; + sh:targetClass reproschema:Field . + +reproschema:ProtocolShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:description ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:version ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path schema:image ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path reproschema:landingPage ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:path reproschema:preamble ], + [ sh:maxCount 1 ; + sh:node reproschema:ScoringShape ; + sh:path reproschema:scoringLogic ], + [ sh:minCount 1 ; + sh:node dash:ListShape ; + sh:path reproschema:order ; + sh:property [ sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], + [ sh:node reproschema:AddPropertiesShape ; + sh:path reproschema:addProperties ], + [ sh:datatype schema:Boolean ; + sh:path reproschema:shuffle ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:allow ] ; + sh:targetClass reproschema:Protocol . + +reproschema:ResponseOptionsShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ), + ( rdf:type ) ; + sh:property [ sh:datatype schema:Boolean ; + sh:path reproschema:multipleChoice ], + [ sh:datatype xsd:integer ; + sh:path schema:minValue ], + [ sh:datatype xsd:integer ; + sh:path schema:maxValue ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:valueType ], + [ sh:node reproschema:ChoicesShape ; + sh:path schema:itemListElement ], + [ sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path reproschema:valueType ], + [ sh:datatype xsd:integer ; + sh:maxCount 1 ; + sh:path schema:minValue ], + [ sh:datatype xsd:integer ; + sh:maxCount 1 ; + sh:path schema:maxValue ], + [ sh:datatype schema:Boolean ; + sh:maxCount 1 ; + sh:path reproschema:multipleChoice ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:path reproschema:datumType ], + [ sh:maxCount 1 ; + sh:or ( [ sh:datatype schema:URL ] [ sh:datatype rdf:langString ] ) ; + sh:path schema:unitCode ], + [ sh:node reproschema:ChoicesShape ; + sh:path schema:itemListElement ] ; + sh:targetClass reproschema:ResponseOptions . + +reproschema:AddPropertiesShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ), + ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:variableName ], + [ sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path reproschema:isAbout ], + [ sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ] ) ; + sh:path reproschema:isVis ], + [ sh:datatype rdf:langString ; + sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:variableName ], + [ sh:minCount 1 ; + sh:nodeKind sh:IRI ; + sh:path reproschema:isAbout ], + [ sh:datatype schema:Boolean ; + sh:path reproschema:requiredValue ], + [ sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ] ) ; + sh:path reproschema:isVis ], + [ sh:datatype rdf:langString ; + sh:path skos:prefLabel ] . + +reproschema:ChoicesShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ), + ( rdf:type ) ; + sh:property [ sh:datatype xsd:string ; + sh:path schema:image ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:dontKnow ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:skipped ], + [ sh:datatype rdf:langString ; + sh:path schema:name ], + [ sh:datatype xsd:integer ; + sh:path schema:value ], + [ sh:datatype rdf:langString ; + sh:path schema:name ], + [ sh:datatype xsd:integer ; + sh:path schema:value ], + [ sh:datatype xsd:string ; + sh:path schema:image ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:dontKnow ], + [ sh:nodeKind sh:IRI ; + sh:path reproschema:skipped ] . + +reproschema:IsVisShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ), + ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:path schema:method ], + [ sh:datatype rdf:langString ; + sh:path schema:url ], + [ sh:datatype rdf:langString ; + sh:path reproschema:payload ], + [ sh:datatype rdf:langString ; + sh:path schema:method ], + [ sh:datatype rdf:langString ; + sh:path schema:url ], + [ sh:datatype rdf:langString ; + sh:path reproschema:payload ] . + +reproschema:ScoringShape a sh:NodeShape ; + sh:closed true ; + sh:property [ sh:datatype rdf:langString ; + sh:path reproschema:variableName ], + [ sh:datatype rdf:langString ; + sh:path reproschema:jsExpression ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:path reproschema:variableName ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:path reproschema:jsExpression ] . -reproschema:Activity a nidm:Assessment, - rdfs:Class, - prov:Entity, - prov:Plan ; - rdfs:label "Activity" ; - rdfs:comment "An assessment in a protocol." ; - rdfs:subClassOf schema:CreativeWork . - -reproschema:AdditionalProperty a rdfs:Class ; - rdfs:label "Additional properties" ; - rdfs:comment "An object to describe the various properties added to assessments and fields." . - -reproschema:AllowExport a rdfs:Class ; - rdfs:label "Allow export" ; - rdfs:comment "Indicates (by boolean) if data can be exported or not." . - -reproschema:AutoAdvance a rdfs:Class ; - rdfs:label "Auto advance" ; - rdfs:comment "Indicates (by boolean) if assessments in a protocol can auto advance or not." . - -reproschema:Choice a rdfs:Class ; - rdfs:label "Response choice" ; - rdfs:comment "An array to list the available options in responseOptions of the Field item." . - -reproschema:DisableBack a rdfs:Class ; - rdfs:label "Disable redo" ; - rdfs:comment "Indicates (by boolean) if we can go back to a completed assessment in a protocol." . - -reproschema:DontKnow a rdfs:Class ; - rdfs:label "Do not know" ; - rdfs:comment "An element to describe the choice when response is not known." . - -reproschema:Field a nidm:DataElement, - rdfs:Class, - prov:Entity ; - rdfs:label "Field" ; - rdfs:comment "An item in an assessment." ; - rdfs:subClassOf schema:CreativeWork . - -reproschema:Protocol a rdfs:Class, - prov:Entity, - prov:Plan ; - rdfs:label "Protocol" ; - rdfs:comment "A representation of a study which comprises one or more assessments." ; - rdfs:subClassOf schema:CreativeWork . - -reproschema:ResponseOption a rdfs:Class ; - rdfs:label "Response option" ; - rdfs:comment "An element (object or by URL)to describe the properties of response of the Field item." . - -reproschema:Scoring a rdfs:Class ; - rdfs:label "Scoring logic" ; - rdfs:comment "An object indicating score in an activity or protocol and the score Field item " . - -reproschema:Skipped a rdfs:Class ; - rdfs:label "Skipped" ; - rdfs:comment "An element to describe the choice when the item is skipped." . - -reproschema:TimedOut a rdfs:Class ; - rdfs:label "Response timed out" ; - rdfs:comment "A boolean element to describe if the response did not occur within the prescribed time." . - -schema:about schema:domainIncludes reproschema:Activity, - reproschema:Field, - reproschema:Protocol . - -schema:associatedMedia schema:domainIncludes reproschema:Field . - -schema:citation schema:domainIncludes reproschema:Activity . - -schema:description schema:domainIncludes reproschema:Activity, - reproschema:Field, - reproschema:Protocol . - -schema:image schema:domainIncludes reproschema:Choice . - -schema:isPartOf schema:domainIncludes reproschema:Field ; - schema:rangeIncludes reproschema:Activity . - -schema:maxValue schema:domainIncludes reproschema:ResponseOption . - -schema:minValue schema:domainIncludes reproschema:ResponseOption . - -schema:name schema:domainIncludes reproschema:Choice . - -schema:question schema:domainIncludes reproschema:Field . - -schema:readonlyValue schema:domainIncludes reproschema:Field . - -schema:schemaVersion schema:domainIncludes reproschema:Activity, - reproschema:Field, - reproschema:Protocol . - -schema:unitCode schema:domainIncludes reproschema:ResponseOption . - -schema:value schema:domainIncludes reproschema:Choice ; - schema:rangeIncludes reproschema:DontKnow, - reproschema:Skipped . - -schema:valueRequired schema:domainIncludes reproschema:AdditionalProperty . - -schema:version schema:domainIncludes reproschema:Activity, - reproschema:Field, - reproschema:Protocol . - -reproschema:addProperties a rdf:Property ; - rdfs:label "addProperties" ; - schema:domainIncludes reproschema:Activity, - reproschema:Protocol ; - schema:rangeIncludes reproschema:AdditionalProperty ; - rdfs:comment "An array of objects to describe the various properties added to assessments and fields." . - -reproschema:allow a rdf:Property ; - rdfs:label "allow" ; - schema:domainIncludes reproschema:Protocol ; - schema:rangeIncludes schema:Thing ; - rdfs:comment "An array of items indicating properties allowed on an activity or protocol " . - -reproschema:choices a rdf:Property ; - rdfs:label "choices" ; - schema:domainIncludes reproschema:ResponseOption ; - schema:rangeIncludes schema:URL, - reproschema:Choice ; - schema:sameAs schema:itemListElement ; - rdfs:comment "An array to list the available options in responseOptions of the Field item." . - -reproschema:datumType a rdf:Property ; - rdfs:label "datumType" ; - schema:domainIncludes reproschema:ResponseOption ; - schema:rangeIncludes schema:Text, - schema:URL ; - rdfs:comment "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item." . - -reproschema:inputType a rdf:Property ; - rdfs:label "inputType" ; - schema:domainIncludes reproschema:Field ; - schema:rangeIncludes schema:Text ; - rdfs:comment "An element to describe the input type of a Field item." . - -reproschema:isAbout a rdf:Property ; - rdfs:label "isAbout" ; - schema:domainIncludes reproschema:AdditionalProperty ; - schema:rangeIncludes reproschema:Activity, - reproschema:Field ; - rdfs:comment "An element to define (by URL) the corresponding nodes." . - -reproschema:isVis a rdf:Property ; - rdfs:label "visibility" ; - schema:domainIncludes reproschema:AdditionalProperty ; - schema:rangeIncludes schema:Boolean, - schema:Text ; - rdfs:comment "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." . - -reproschema:jsExpression a rdf:Property ; - rdfs:label "JavaScript Expression" ; - schema:domainIncludes reproschema:Scoring ; - schema:rangeIncludes schema:Boolean, - schema:Text ; - rdfs:comment "A JavaScript expression to compute a score from other variables." . - -reproschema:landingPage a rdf:Property ; - rdfs:label "Landing page content" ; - schema:domainIncludes reproschema:Protocol ; - schema:rangeIncludes schema:Text, - schema:URL ; - rdfs:comment "An element (by URL) to point to the protocol readme or landing page." . - -reproschema:multipleChoice a rdf:Property ; - rdfs:label "Multiple choice response expectation" ; - schema:domainIncludes reproschema:ResponseOption ; - schema:rangeIncludes schema:Boolean ; - rdfs:comment "Indicates (by bool) if response for the Field item has one or more answer." . - -reproschema:order a rdf:Property ; - rdfs:label "Order" ; - schema:domainIncludes reproschema:Activity, - reproschema:Protocol ; - schema:rangeIncludes schema:URL, - reproschema:Activity, - reproschema:Field ; - rdfs:comment "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." . - -reproschema:preamble a rdf:Property ; - rdfs:label "Preamble" ; - schema:domainIncludes reproschema:Activity, - reproschema:Field ; - schema:rangeIncludes schema:Text, - rdf:langString ; - rdfs:comment "The preamble for an assessment" . - -reproschema:responseOptions a rdf:Property ; - rdfs:label "Response options" ; - schema:domainIncludes reproschema:Field ; - schema:rangeIncludes schema:URL, - reproschema:ResponseOption ; - rdfs:comment "An element (object or by URL)to describe the properties of response of the Field item." . - -reproschema:scoringLogic a rdf:Property ; - rdfs:label "Scoring logic objects" ; - schema:domainIncludes reproschema:Activity, - reproschema:Protocol ; - schema:rangeIncludes reproschema:Scoring ; - rdfs:comment "An array of objects indicating score in an activity or protocol and maps it to the score Field item " . - -reproschema:shuffle a rdf:Property ; - rdfs:label "Shuffle" ; - schema:domainIncludes reproschema:Activity, - reproschema:Protocol ; - schema:rangeIncludes schema:boolean ; - rdfs:comment "An element (bool) to determine if the list of items is shuffled or in order." . - -reproschema:statusOptions a rdf:Property ; - rdfs:label "Status options" ; - schema:rangeIncludes schema:Text ; - rdfs:comment "Provides information on whether or not a field item wants to be accompanied by the additional status option(s) defined in “statusOptions”" . - -reproschema:valueType a rdf:Property ; - rdfs:label "The type of the response" ; - schema:domainIncludes reproschema:ResponseOption ; - schema:rangeIncludes schema:Text, - rdf:langString ; - rdfs:comment "The type of the response of an item. For example, string, integer, etc." . - -reproschema:variableName a rdf:Property ; - rdfs:label "variableName" ; - schema:domainIncludes reproschema:AdditionalProperty, - reproschema:Scoring ; - schema:rangeIncludes schema:Text ; - rdfs:comment "The name used to represent an item." . - -skos:prefLabel a rdf:Property ; - rdfs:label "prefLabel" ; - schema:domainIncludes reproschema:Activity, - reproschema:AdditionalProperty, - reproschema:Field, - reproschema:Protocol ; - schema:rangeIncludes schema:Text ; - rdfs:comment "Indicates the label of an Activity or Field to be used as display name.", - "Indicates the label of the Field.", - "The preferred name of the assessment." . From cf762a79263189d695933a2ba1224393d5f57563 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Wed, 1 Jul 2020 02:51:52 -0400 Subject: [PATCH 08/18] refactor responseOptions in generic context --- contexts/generic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contexts/generic b/contexts/generic index bbe1b753db..1833b30d3d 100644 --- a/contexts/generic +++ b/contexts/generic @@ -65,7 +65,8 @@ }, "responseOptions": { "@id": "reproschema:responseOptions", - "@type": "@vocab" + "@container": "@set", + "@type": "@id" }, "dataType": { "@id": "schema:DataType", From f6c1a499793f190edbb643aada064bbfb1c71404 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Wed, 1 Jul 2020 03:10:56 -0400 Subject: [PATCH 09/18] minor refactoring --- contexts/generic | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contexts/generic b/contexts/generic index 1833b30d3d..8216a5c874 100644 --- a/contexts/generic +++ b/contexts/generic @@ -58,7 +58,7 @@ "choices": { "@id": "schema:itemListElement" }, - "valueRequired": "https://schema.org/valueRequired", + "valueRequired": "schema:valueRequired", "multipleChoice": { "@id": "reproschema:multipleChoice", "@type": "schema:Boolean" @@ -107,7 +107,7 @@ "@nest": "ui" }, "readonlyValue": { - "@id": "https://schema.org/readonlyValue", + "@id": "schema:readonlyValue", "@nest": "ui" }, "scoringLogic": { From ef386cc8bb6c36a5c771cfeeb433b6311e79f72d Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Fri, 3 Jul 2020 00:00:48 -0400 Subject: [PATCH 10/18] refactor reproschema shapes and terms --- contexts/generic | 10 +- terms/Field | 9 ++ terms/value | 27 ++++++ validation/reproschema-shacl.ttl | 154 ++++++++++++++++--------------- 4 files changed, 121 insertions(+), 79 deletions(-) create mode 100644 terms/value diff --git a/contexts/generic b/contexts/generic index 8216a5c874..a49b83824d 100644 --- a/contexts/generic +++ b/contexts/generic @@ -12,12 +12,12 @@ "@container": "@language" }, "value": { - "@id": "schema:value", + "@id": "reproschema:value", "@container": "@language" }, "image": { "@id": "schema:image", - "@type": "@vocab" + "@type": "@id" }, "citation": { "@id": "schema:citation", @@ -56,7 +56,7 @@ "@container": "@language" }, "choices": { - "@id": "schema:itemListElement" + "@id": "reproschema:choices" }, "valueRequired": "schema:valueRequired", "multipleChoice": { @@ -78,6 +78,10 @@ "maxValue": { "@id": "schema:maxValue" }, + "unitCode": { + "@id": "schema:unitCode", + "@container": "@set" + }, "ui" : "@nest", "order": { "@id": "reproschema:order", diff --git a/terms/Field b/terms/Field index 22cd711868..f1a21016fd 100644 --- a/terms/Field +++ b/terms/Field @@ -43,6 +43,15 @@ "@id": "reproschema:Field" } }, + { + "@id": "schema:image", + "@type": "rdf:Property", + "rdfs:comment": "An image of the item. This can be a URL or a fully described ImageObject.", + "rdfs:label": "image" + "schema:domainIncludes": { + "@id": "reproschema:Field" + } + }, { "@id": "reproschema:inputType", "schema:domainIncludes": { diff --git a/terms/value b/terms/value new file mode 100644 index 0000000000..5ce0645cb9 --- /dev/null +++ b/terms/value @@ -0,0 +1,27 @@ +{ + "@context": "../contexts/base", + "@id": "reproschema:value", + "@type": "rdf:Property", + "rdfs:comment": "The value for each option in choices", + "rdfs:label": "value", + "http://schema.org/rangeIncludes": [ + { + "@id": "schema:Boolean" + }, + { + "@id": "schema:StructuredValue" + }, + { + "@id": "schema:Number" + }, + { + "@id": "schema:Text" + }, + { + "@id": "schema:URL" + } + ], + "schema:sameAs": { + "@id": "schema:value" + } +} \ No newline at end of file diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index c66d70509b..bf8a7d34c8 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -11,32 +11,47 @@ reproschema:ActivityShape a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; sh:path schema:description ], + [ sh:datatype rdf:langString ; sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; sh:path schema:version ], + [ sh:datatype rdf:langString ; sh:path schema:citation ], + + [ sh:nodeKind sh:IRI ; + sh:path schema:image ], + [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], + [ sh:node reproschema:ScoringShape ; sh:path reproschema:scoringLogic ], + [ sh:maxCount 1 ; sh:node dash:ListShape ; sh:path reproschema:order ; sh:property [ sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], + [ sh:node reproschema:AddPropertiesShape ; sh:path reproschema:addProperties ], + [ sh:datatype xsd:string ; sh:path reproschema:inputType ], + [ sh:datatype schema:Boolean ; sh:path reproschema:shuffle ], + [ sh:nodeKind sh:IRI ; + sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay ) ; sh:path reproschema:allow ] ; sh:targetClass reproschema:Activity . @@ -46,31 +61,39 @@ reproschema:FieldShape a sh:NodeShape ; sh:property [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path skos:altLabel ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:description ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:version ], + [ sh:datatype rdf:langString ; sh:path schema:question ], - [ sh:datatype rdf:langString ; + + [ sh:nodeKind sh:IRI ; sh:maxCount 1 ; + sh:path schema:image ], + + [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:minCount 1 ; sh:path reproschema:inputType ], + [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:path reproschema:readOnly ], - [ sh:node reproschema:ResponseOptionsShape ; + sh:path schema:readonlyValue ], + + [ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproschema:ResponseOptionsShape ] ) ; sh:path reproschema:responseOptions ] ; sh:targetClass reproschema:Field . @@ -78,160 +101,139 @@ reproschema:ProtocolShape a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:description ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:schemaVersion ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path schema:version ], - [ sh:datatype rdf:langString ; + + [ sh:nodeKind sh:IRI ; sh:maxCount 1 ; sh:path schema:image ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; + + [ sh:nodeKind sh:IRI ; sh:path reproschema:landingPage ], + [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path skos:prefLabel ], + [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:path reproschema:preamble ], - [ sh:maxCount 1 ; - sh:node reproschema:ScoringShape ; + + [ sh:node reproschema:ScoringShape ; sh:path reproschema:scoringLogic ], + [ sh:minCount 1 ; sh:node dash:ListShape ; sh:path reproschema:order ; sh:property [ sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], + [ sh:node reproschema:AddPropertiesShape ; sh:path reproschema:addProperties ], + [ sh:datatype schema:Boolean ; sh:path reproschema:shuffle ], + [ sh:nodeKind sh:IRI ; + sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay ) ; sh:path reproschema:allow ] ; sh:targetClass reproschema:Protocol . reproschema:ResponseOptionsShape a sh:NodeShape ; sh:closed true ; - sh:ignoredProperties ( rdf:type ), - ( rdf:type ) ; + sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype schema:Boolean ; + sh:maxCount 1 ; sh:path reproschema:multipleChoice ], - [ sh:datatype xsd:integer ; - sh:path schema:minValue ], - [ sh:datatype xsd:integer ; - sh:path schema:maxValue ], + [ sh:nodeKind sh:IRI ; + sh:maxCount 1 ; sh:path reproschema:valueType ], - [ sh:node reproschema:ChoicesShape ; - sh:path schema:itemListElement ], - [ sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:path reproschema:valueType ], + [ sh:datatype xsd:integer ; sh:maxCount 1 ; sh:path schema:minValue ], + [ sh:datatype xsd:integer ; sh:maxCount 1 ; sh:path schema:maxValue ], - [ sh:datatype schema:Boolean ; - sh:maxCount 1 ; - sh:path reproschema:multipleChoice ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:path reproschema:datumType ], - [ sh:maxCount 1 ; - sh:or ( [ sh:datatype schema:URL ] [ sh:datatype rdf:langString ] ) ; + + [ sh:or ( [ sh:datatype schema:URL ] [ sh:datatype rdf:langString ] ) ; sh:path schema:unitCode ], + [ sh:node reproschema:ChoicesShape ; sh:path schema:itemListElement ] ; sh:targetClass reproschema:ResponseOptions . reproschema:AddPropertiesShape a sh:NodeShape ; sh:closed true ; - sh:ignoredProperties ( rdf:type ), - ( rdf:type ) ; + sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path reproschema:variableName ], + [ sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:path reproschema:isAbout ], + [ sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ] ) ; sh:path reproschema:isVis ], + [ sh:datatype rdf:langString ; sh:path skos:prefLabel ], - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:variableName ], - [ sh:minCount 1 ; - sh:nodeKind sh:IRI ; - sh:path reproschema:isAbout ], - [ sh:datatype schema:Boolean ; - sh:path reproschema:requiredValue ], - [ sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] [ sh:node reproschema:IsVisShape ] ) ; - sh:path reproschema:isVis ], - [ sh:datatype rdf:langString ; - sh:path skos:prefLabel ] . + + [ sh:datatype xsd:boolean ; + sh:path schema:valueRequired ] . reproschema:ChoicesShape a sh:NodeShape ; sh:closed true ; - sh:ignoredProperties ( rdf:type ), - ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:nodeKind sh:IRI ; sh:path schema:image ], + [ sh:nodeKind sh:IRI ; - sh:path reproschema:dontKnow ], + sh:path reproschema:DontKnow ], + [ sh:nodeKind sh:IRI ; - sh:path reproschema:skipped ], - [ sh:datatype rdf:langString ; - sh:path schema:name ], - [ sh:datatype xsd:integer ; - sh:path schema:value ], + sh:path reproschema:Skipped ], + [ sh:datatype rdf:langString ; sh:path schema:name ], + [ sh:datatype xsd:integer ; - sh:path schema:value ], - [ sh:datatype xsd:string ; - sh:path schema:image ], - [ sh:nodeKind sh:IRI ; - sh:path reproschema:dontKnow ], - [ sh:nodeKind sh:IRI ; - sh:path reproschema:skipped ] . + sh:path schema:value ] . reproschema:IsVisShape a sh:NodeShape ; sh:closed true ; - sh:ignoredProperties ( rdf:type ), - ( rdf:type ) ; + sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; + sh:minCount 1 ; sh:path schema:method ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; sh:path schema:url ], + [ sh:datatype rdf:langString ; - sh:path reproschema:payload ], - [ sh:datatype rdf:langString ; - sh:path schema:method ], - [ sh:datatype rdf:langString ; - sh:path schema:url ], - [ sh:datatype rdf:langString ; + sh:minCount 1 ; sh:path reproschema:payload ] . reproschema:ScoringShape a sh:NodeShape ; sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; - sh:path reproschema:variableName ], - [ sh:datatype rdf:langString ; - sh:path reproschema:jsExpression ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:minCount 1 ; sh:path reproschema:variableName ], [ sh:datatype rdf:langString ; - sh:maxCount 1 ; sh:minCount 1 ; sh:path reproschema:jsExpression ] . From 4d8dc1fb237e46a537e26a8e7aa8430461d9e5a8 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Fri, 3 Jul 2020 00:06:25 -0400 Subject: [PATCH 11/18] fix trailing comma --- terms/Field | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terms/Field b/terms/Field index f1a21016fd..d43fef3987 100644 --- a/terms/Field +++ b/terms/Field @@ -47,7 +47,7 @@ "@id": "schema:image", "@type": "rdf:Property", "rdfs:comment": "An image of the item. This can be a URL or a fully described ImageObject.", - "rdfs:label": "image" + "rdfs:label": "image", "schema:domainIncludes": { "@id": "reproschema:Field" } From b4c51e5a77c0d723177ddcfe7c3b99422f8f83c5 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Fri, 3 Jul 2020 01:57:21 -0400 Subject: [PATCH 12/18] refactor value --- contexts/generic | 4 +++- validation/reproschema-shacl.ttl | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/contexts/generic b/contexts/generic index a49b83824d..4fe0b567aa 100644 --- a/contexts/generic +++ b/contexts/generic @@ -13,6 +13,7 @@ }, "value": { "@id": "reproschema:value", + "@type": "@id", "@container": "@language" }, "image": { @@ -45,7 +46,8 @@ }, "valueType": { "@id": "reproschema:valueType", - "@type": "@vocab" + "@type": "@id", + "@container": "@set" }, "landingPage": { "@id": "reproschema:landingPage", diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index bf8a7d34c8..19320e8737 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -152,7 +152,6 @@ reproschema:ResponseOptionsShape a sh:NodeShape ; sh:path reproschema:multipleChoice ], [ sh:nodeKind sh:IRI ; - sh:maxCount 1 ; sh:path reproschema:valueType ], [ sh:datatype xsd:integer ; @@ -171,7 +170,7 @@ reproschema:ResponseOptionsShape a sh:NodeShape ; sh:path schema:unitCode ], [ sh:node reproschema:ChoicesShape ; - sh:path schema:itemListElement ] ; + sh:path reproschema:choices ] ; sh:targetClass reproschema:ResponseOptions . reproschema:AddPropertiesShape a sh:NodeShape ; @@ -209,8 +208,8 @@ reproschema:ChoicesShape a sh:NodeShape ; [ sh:datatype rdf:langString ; sh:path schema:name ], - [ sh:datatype xsd:integer ; - sh:path schema:value ] . + [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] ) ; + sh:path reproschema:value ] . reproschema:IsVisShape a sh:NodeShape ; sh:closed true ; From ba1a42c6c28141e1f0528bb698a1a6963eb9a083 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Fri, 3 Jul 2020 02:33:27 -0400 Subject: [PATCH 13/18] refactor allow list in shapes --- validation/reproschema-shacl.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index 19320e8737..8cfad567e0 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -51,7 +51,7 @@ reproschema:ActivityShape a sh:NodeShape ; sh:path reproschema:shuffle ], [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay ) ; + sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; sh:path reproschema:allow ] ; sh:targetClass reproschema:Activity . From a792ad9d7f7465fa6f9dc09dd4d841577e8c373a Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Fri, 3 Jul 2020 02:36:55 -0400 Subject: [PATCH 14/18] refactor allow list in Protocol shape also --- validation/reproschema-shacl.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index 8cfad567e0..9ea12825f7 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -140,7 +140,7 @@ reproschema:ProtocolShape a sh:NodeShape ; sh:path reproschema:shuffle ], [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay ) ; + sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; sh:path reproschema:allow ] ; sh:targetClass reproschema:Protocol . From 0b2eb21358e5f1c35ae0c6a45cd9a2d1a5f6161e Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Wed, 8 Jul 2020 16:57:01 -0400 Subject: [PATCH 15/18] add terms for additional notes in generic context --- contexts/generic | 12 ++++++++++++ terms/AdditionalNoteObj | 29 +++++++++++++++++++++++++++++ terms/AdditionalProperty | 10 +--------- terms/additionalNotesObj | 11 +++++++++++ terms/column | 11 +++++++++++ terms/source | 11 +++++++++++ terms/value | 2 +- 7 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 terms/AdditionalNoteObj create mode 100644 terms/additionalNotesObj create mode 100644 terms/column create mode 100644 terms/source diff --git a/contexts/generic b/contexts/generic index 4fe0b567aa..1aa0ec3c1e 100644 --- a/contexts/generic +++ b/contexts/generic @@ -154,6 +154,18 @@ "@type": "@id", "@nest": "ui" }, + "additionalNotesObj": { + "@id": "reproschema:additionalNotesObj", + "@container": "@set" + }, + "source": { + "@id": "reproschema:source", + "@type": "xsd:string" + }, + "column": { + "@id": "reproschema:column", + "@type": "xsd:string" + }, "importedFrom": { "@id": "pav:importedFrom", "@type": "@id" diff --git a/terms/AdditionalNoteObj b/terms/AdditionalNoteObj new file mode 100644 index 0000000000..9127ce02ec --- /dev/null +++ b/terms/AdditionalNoteObj @@ -0,0 +1,29 @@ +{ + "@context": "../contexts/base", + "@graph": [ + { + "@id": "reproschema:source", + "schema:domainIncludes": { + "@id": "reproschema:AdditionalNoteObj" + } + }, + { + "@id": "reproschema:column", + "schema:domainIncludes": { + "@id": "reproschema:AdditionalNoteObj" + } + }, + { + "@id": "reproschema:value", + "schema:domainIncludes": { + "@id": "reproschema:AdditionalNoteObj" + } + }, + { + "@id": "reproschema:AdditionalNoteObj", + "@type": "rdfs:Class", + "rdfs:comment": "A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema", + "rdfs:label": "Additional Notes Object" + } + ] +} diff --git a/terms/AdditionalProperty b/terms/AdditionalProperty index 176584d5f0..8989e7ac16 100644 --- a/terms/AdditionalProperty +++ b/terms/AdditionalProperty @@ -11,15 +11,7 @@ "@id": "reproschema:isAbout", "schema:domainIncludes": { "@id": "reproschema:AdditionalProperty" - }, - "schema:rangeIncludes": [ - { - "@id": "reproschema:Activity" - }, - { - "@id": "reproschema:Field" - } - ] + } }, { "@id": "schema:valueRequired", diff --git a/terms/additionalNotesObj b/terms/additionalNotesObj new file mode 100644 index 0000000000..9518897bb1 --- /dev/null +++ b/terms/additionalNotesObj @@ -0,0 +1,11 @@ +{ + "@context": "../contexts/base", + "@type": "rdf:Property", + "@id": "reproschema:additionalNotesObj", + "rdfs:comment": "A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema.", + "rdfs:label": "additional notes", + "schema:rangeIncludes": { + "@id": "reproschema:AdditionalNoteObj" + } +} + diff --git a/terms/column b/terms/column new file mode 100644 index 0000000000..2cd38ce940 --- /dev/null +++ b/terms/column @@ -0,0 +1,11 @@ +{ + "@context": "../contexts/base", + "@type": "rdf:Property", + "@id": "reproschema:column", + "rdfs:comment": "An element to define the column name where the note was taken from.", + "rdfs:label": "column", + "schema:rangeIncludes": { + "@id": "rdf:langString" + } +} + diff --git a/terms/source b/terms/source new file mode 100644 index 0000000000..0345551f03 --- /dev/null +++ b/terms/source @@ -0,0 +1,11 @@ +{ + "@context": "../contexts/base", + "@type": "rdf:Property", + "@id": "reproschema:source", + "rdfs:comment": "An element to define the source (eg. RedCap, NDA) where the note was taken from.", + "rdfs:label": "source", + "schema:rangeIncludes": { + "@id": "rdf:langString" + } +} + diff --git a/terms/value b/terms/value index 5ce0645cb9..8d3baf5f0c 100644 --- a/terms/value +++ b/terms/value @@ -2,7 +2,7 @@ "@context": "../contexts/base", "@id": "reproschema:value", "@type": "rdf:Property", - "rdfs:comment": "The value for each option in choices", + "rdfs:comment": "The value for each option in choices or in additionalNotesObj", "rdfs:label": "value", "http://schema.org/rangeIncludes": [ { From 04faa75b373cd85260610a6cc6c335cf71517e45 Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Thu, 9 Jul 2020 19:33:34 -0400 Subject: [PATCH 16/18] add new keys to examples and update shape file --- examples/activities/items/item1.jsonld | 9 ++++++++- validation/reproschema-shacl.ttl | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/examples/activities/items/item1.jsonld b/examples/activities/items/item1.jsonld index 73e2670738..5f4fd303fa 100644 --- a/examples/activities/items/item1.jsonld +++ b/examples/activities/items/item1.jsonld @@ -48,6 +48,13 @@ "value": 3 } ] - } + }, + "additionalNotesObj": [ + { + "source": "redcap", + "column": "notes", + "value": "some extra note" + } + ] } \ No newline at end of file diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index 9ea12825f7..7d3dd5180d 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/reproschema-shacl.ttl @@ -93,6 +93,9 @@ reproschema:FieldShape a sh:NodeShape ; sh:maxCount 1 ; sh:path schema:readonlyValue ], + [ sh:node reproschema:AdditionalNoteObj ; + sh:path reproschema:additionalNotesObj ], + [ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproschema:ResponseOptionsShape ] ) ; sh:path reproschema:responseOptions ] ; sh:targetClass reproschema:Field . @@ -208,7 +211,7 @@ reproschema:ChoicesShape a sh:NodeShape ; [ sh:datatype rdf:langString ; sh:path schema:name ], - [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] ) ; + [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ]) ; sh:path reproschema:value ] . reproschema:IsVisShape a sh:NodeShape ; @@ -236,3 +239,17 @@ reproschema:ScoringShape a sh:NodeShape ; sh:minCount 1 ; sh:path reproschema:jsExpression ] . +reproschema:AdditionalNoteObjShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:source ], + + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:column ], + + [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ]) ; + sh:path reproschema:value ] . + From 8275adbad784ac43f52aab554922fe986b82124f Mon Sep 17 00:00:00 2001 From: Sanu Ann Date: Sat, 11 Jul 2020 17:22:40 -0400 Subject: [PATCH 17/18] improve naming of scoringLogic and Scoring --- contexts/generic | 4 ++-- examples/activities/activity1.jsonld | 6 ++++++ terms/{Scoring => ComputeSpecification} | 10 +++++----- terms/compute | 10 ++++++++++ terms/scoringLogic | 10 ---------- validation/reproschema-shacl.ttl | 10 +++++----- 6 files changed, 28 insertions(+), 22 deletions(-) rename terms/{Scoring => ComputeSpecification} (65%) create mode 100644 terms/compute delete mode 100644 terms/scoringLogic diff --git a/contexts/generic b/contexts/generic index 1aa0ec3c1e..7ab9c3e156 100644 --- a/contexts/generic +++ b/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/examples/activities/activity1.jsonld b/examples/activities/activity1.jsonld index ae7cec9875..4abd69a18b 100644 --- a/examples/activities/activity1.jsonld +++ b/examples/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/terms/Scoring b/terms/ComputeSpecification similarity index 65% rename from terms/Scoring rename to terms/ComputeSpecification index 62aa0cfd70..aaaf0c9751 100644 --- a/terms/Scoring +++ b/terms/ComputeSpecification @@ -7,7 +7,7 @@ "rdfs:comment": "The name used to represent an item.", "rdfs:label": "variableName", "schema:domainIncludes": { - "@id": "reproschema:Scoring" + "@id": "reproschema:ComputeSpecification" }, "schema:rangeIncludes": { "@id": "schema:Text" @@ -16,14 +16,14 @@ { "@id": "reproschema:jsExpression", "schema:domainIncludes": { - "@id": "reproschema:Scoring" + "@id": "reproschema:ComputeSpecification" } }, { - "@id": "reproschema:Scoring", + "@id": "reproschema:ComputeSpecification", "@type": "rdfs:Class", - "rdfs:comment": "An object indicating score in an activity or protocol and the score Field item ", - "rdfs:label": "Scoring logic" + "rdfs:comment": "An object to define computations in an activity or protocol.", + "rdfs:label": "Compute Specification" } ] } diff --git a/terms/compute b/terms/compute new file mode 100644 index 0000000000..d32479910c --- /dev/null +++ b/terms/compute @@ -0,0 +1,10 @@ +{ + "@context": "../contexts/base", + "@id": "reproschema:compute", + "@type": "rdf:Property", + "rdfs:comment": "An array of objects indicating computations in an activity or protocol and maps it to the corresponding Field item. scoring logic is a subset of all computations that could be performed and not all computations will be scoring. For example, one may want to do conversion from one unit to another. ", + "rdfs:label": "computation", + "schema:rangeIncludes": { + "@id": "reproschema:ComputeSpecification" + } +} diff --git a/terms/scoringLogic b/terms/scoringLogic deleted file mode 100644 index cadf799218..0000000000 --- a/terms/scoringLogic +++ /dev/null @@ -1,10 +0,0 @@ -{ - "@context": "../contexts/base", - "@id": "reproschema:scoringLogic", - "@type": "rdf:Property", - "rdfs:comment": "An array of objects indicating score in an activity or protocol and maps it to the score Field item ", - "rdfs:label": "Scoring logic objects", - "schema:rangeIncludes": { - "@id": "reproschema:Scoring" - } -} diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl index 7d3dd5180d..3803647cff 100644 --- a/validation/reproschema-shacl.ttl +++ b/validation/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 ; From 2d4b0148c7dbdd0ec15b0b0f260799b2480ad7a3 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Mon, 13 Jul 2020 16:51:52 -0400 Subject: [PATCH 18/18] enh: updated docs --- .github/workflows/publishdocs.yaml | 18 ++++ docs/01_introduction.md | 156 ++++++++++++++++++----------- docs/20_project_structure.md | 42 ++++++-- docs/index.md | 26 ++--- 4 files changed, 162 insertions(+), 80 deletions(-) create mode 100644 .github/workflows/publishdocs.yaml diff --git a/.github/workflows/publishdocs.yaml b/.github/workflows/publishdocs.yaml new file mode 100644 index 0000000000..d6c320aa76 --- /dev/null +++ b/.github/workflows/publishdocs.yaml @@ -0,0 +1,18 @@ +name: Publish docs via GitHub Pages +on: + push: + branches: + - refactor-1.0 + +jobs: + build: + name: Deploy docs + runs-on: ubuntu-latest + steps: + - name: Checkout master + uses: actions/checkout@v1 + + - name: Deploy docs + uses: mhausenblas/mkdocs-deploy-gh-pages@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/01_introduction.md b/docs/01_introduction.md index 38d06284a4..a62b705525 100644 --- a/docs/01_introduction.md +++ b/docs/01_introduction.md @@ -2,66 +2,103 @@ ??? example "Tl;DR - Advantages of the current schema representation" - Rich contexts for a questionnaire with JSON-LD rather than a "flat" csv file. - - A single source of curated assessments from [ReproNim](https://github.com/ReproNim) + - A single source of curated assessments from [ReproSchema Library](https://github.com/reproschema-library) - Each `item` (i.e question), `activity` (i.e questionnaire), and `protocol` (i.e set of questionnaires) provides unique and persistent identifiers. - Versions of a given questionnaire can be tracked (e.g., PHQ-9, PHQ-8). - Allows, supports, and tracks internationalization (e.g. ABCD requires Spanish and English forms). - Implementation agnostic – the schema can be used by several software - - Still a linked data graph that can be validated using [SHACL](https://www.w3.org/TR/shacl/). + - Uses a linked data graph that can be validated using [SHACL](https://www.w3.org/TR/shacl/). ## The problem -Cognitive and clinical questionnaires and assessments are used throughout neuroscience. Despite many efforts -([Cognitive Atlas](https://www.cognitiveatlas.org/), [Cognitive Paradigm Ontology](http://www.cogpo.org/), [OOve](???)...) -there is little consistency in assessment data acquisition or response representation across studies or laboratories. Each -project tends to use its own format and data collection tool (paper, form, ...). In the long run, this can the source of a -lot inefficiencies not only in terms data curation but also by diminishing the value of the data less inter-operable and reusable. -Imagine for example a researcher wanting to run a meta or mega-analysis across several studies, but having no way to find out -which version of a questionnaire was used or how exactly it was scored. - -This highlights the need for harmonization across projects. For example, the National institute for mental health (NIMH) -Data Archive (NDA) enforces harmonization during data submission. However, harmonizing data after acquisition is resource -intensive and this approach can create a mismatch between collected and submitted data due to human error during the -harmonization process. Another possibility would be to reverse engineer the data dictionaries to their original assessments: -this would mean figuring out the information describing the content, format, and structure of the questionnaire from the -data contained in the questionnaires themselves. This approach is potentially feasible using a tool like [Brainverse](???), but -it can be very tedious. - -## Goals and general description - -A simpler solution is to enforce consistency directly at the data acquisition stage by relying on a `schema` that encodes -how the different elements of the data and / or the metadata relate to one another. This way, all this relational -information between these elements is captured from the very start as it is already embedded in the formal description -of the assessment. - -This is the goal of the Reproschema project that covers: - -1. a schema that can be found [in the present repository](https://github.com/ReproNim/reproschema) that describes the content and relations of the different elements of a questionnaire or set of assessment tools, +Cognitive and clinical questionnaires and assessments are used throughout +neuroscience. There is little consistency in assessment data acquisition or response +representation across studies or laboratories. Each project tends to use its own +format and data collection tool (e.g., paper, survey tools, RedCap, LORIS). In the +long run, this can the source of a lot inefficiencies not only in terms data +curation but also by diminishing the value of the data less interoperable and +reusable. Imagine for example a researcher wanting to run a meta or mega-analysis +across several studies. To do this each one would not only need to know which +specific assessments were collected, but also to relate differing column names in +data spreadsheets to these assessments and across projects. + +Several efforts have focused on linking the assessments themselves +through consistent terminologies and relationships that map to human cognition +(e.g., ([Cognitive Atlas](https://www.cognitiveatlas.org/), +[Cognitive Paradigm Ontology](http://www.cogpo.org/)). Other efforts such as the +National Institute for Mental Health (NIMH) Data Archive (NDA) and the National +Library of Medicine (NLM) [Common Data Elements](https://www.nlm.nih.gov/cde/index.html) +have curated data elements corresponding to the items and calculated scores from +these questionnaires. However, these resources are often used to make data +consistent and reusable after, rather than during data collection. However, +harmonizing data after acquisition is resource intensive and this approach can +create a mismatch between collected and submitted data due to human error during +the harmonization process. To faciliate tedious harmonization efforts, several +projects, over the last two decades, have developed technologies to automatically +or interactively align and harmonize data elements (e.g., BIRN mediator, OpenRefine). + +Given the dynamic and evolving nature of scientific investigation, many +questionnaires are altered when used to suit the requirements of a particular +study (e.g., different language, selective and new questions). This information +linking the specific information used when asking a question is often decoupled +from the data element representing the response to the question. When questions +are changed, researchers often shoehorn the response into an existing data +element, thus creating additional noise. Another drawback to these data elements +is that there is often no way to find out which version of a questionnaire was +used or how exactly it was scored. + +## Our solution + +Our simpler solution is to enforce consistency directly at the data acquisition +stage by relying on a common `schema` that encodes how the different elements of +the data and / or the metadata relate to one another. This way, all this relational +information between these elements is captured from the very start as it is already +embedded in the formal description of the assessment. This solution was inspired +by the work of [CEDAR Metadata Model](https://more.metadatacenter.org/tools-training/outreach/cedar-template-model). + +In this project we provide a comprehensive set of tools to create and use the +schemas, while tracking the source of the schema, and changes to it over time. +The Reproschema project covers: + +1. a schema that can be found [in the present repository](https://github.com/ReproNim/reproschema) +that describes the content and relations of the different elements of a +questionnaire or set of assessment tools, 2. an [associated curated library of reusable common assessments and questionnaires](https://github.com/ReproNim/reproschema-library), -3. a [python package](https://github.com/ReproNim/reproschema-py) to help create and validate the schemas of new assessments, -4. a [user interface](https://github.com/ReproNim/reproschema-ui) to visualize questionnaire and collect data. - -In brief, Reproschema offers a way to standardize the underlying representation of assessment tools. It comes with an open -and accessible library of questionnaire with appropriate conversion (e.g., to [RedCap](https://www.project-redcap.org/)) and data collection -tools (e.g., [MindLogger](https://mindlogger.org/), LORIS, [RedCap](https://www.project-redcap.org/)) to enable a more consistent acquisition across projects, with results being harmonized by design. +3. a [python package](https://github.com/ReproNim/reproschema-py) to help create +and validate the schemas of new assessments, +4. a [user interface](https://github.com/ReproNim/reproschema-ui) to visualize +questionnaire and collect data locally, +5. a [backend server](https://github.com/sensein/voice-backend) to capture the +data remotely. + +In brief, Reproschema offers a way to standardize the underlying representation +of assessment tools. It comes with an open and accessible library of questionnaires +with appropriate conversion (e.g., from/to [RedCap](https://www.project-redcap.org/)) +and data collection tools (e.g., [MindLogger](https://mindlogger.org/), +[RedCap](https://www.project-redcap.org/), [LORIS - future work](https://loris.ca)) +to enable a more consistent acquisition across projects, with data being +harmonized by design. ## General description With this schema we can represent: -- at the `item` level, the elements of an individual assessment, like the questions in a questionnaire -- at the `activity` level, an individual assessment that contains a set of `items`, like for example a whole questionnaire - with a several questions. -- at the `protocols` level, a collection of `activities` performed by a participant, e.g a set of questionnaires used in - a study. +- at the `item` level, the elements of an individual assessment, like the questions +in a questionnaire +- at the `activity` level, an individual assessment that contains a set of `items`, +like for example a whole questionnaire with a several questions. +- at the `protocols` level, a collection of `activities` performed by a participant, + e.g a set of questionnaires used in a study. -All those elements are specified text files in a `JSON-LD` format (JavaScript Object Notation for Linked Data) and each -`item`, `activity`, and `protocol` provides unique and persistent identifiers. +All those elements are specified text files in a `JSON-LD` format (JavaScript +Object Notation for Linked Data) and each `item`, `activity`, and `protocol` provides +unique and persistent identifiers. -Below we show an example of one of the possible ways a questionnaire with 3 question for a study could be organized -with a `protocol` for that study, one `activity` and 3 `items`. +Below we show an example of one of the possible ways a questionnaire with 3 questions +for a study could be organized with a `protocol` for that study, one `activity` +and 3 `items`. ```json ├── activities @@ -74,17 +111,22 @@ with a `protocol` for that study, one `activity` and 3 `items`. └── protocol1.jsonld ``` -The Reproschema can also easily and flexibly specify details about how the schema for an assessment should be implemented. -Independently of what solution is chosen in the end by a researcher, a lab, or an institute to display the assessment to -their participants or patients (for example whether using an web-app written in javascript or a mobile app written in -python), the schema can already specify: - -- the `input type` to choose among several user-interface rendering options e.g if an item should be displayed as a - Likert scale, a dropdown menu, a multiple choice... -- the `visibility` to decide whether a given `item` or `activity` should be displayed to the user and under which conditions, -- the `scoring logic` of how the total score to the responses on a questionnaire should be computed - -The Reproschema also allows for internationalization and multiple languages support by making it very easy to keep everything -the same about a questionnaire and only specify which language should be displayed by the user interface. - -Finally Reproschema allows tracking of variations and version of different assessments tools (e.g., PHQ-9, PHQ-8). \ No newline at end of file +The Reproschema can also easily and flexibly specify details about how the schema +for an assessment should be used. Independently of what solution is chosen in the +end by a researcher, a lab, or an institute to display the assessment to their +participants or patients (for example whether using an Web-app written in javascript +or a mobile app written in React-native), the schema can already specify: + +- the `input type` to choose among several user-interface rendering options e.g +if an item should be displayed as a Likert scale, a dropdown menu, a multiple choice... +- the `visibility` to decide whether a given `item` or `activity` should be +displayed to the user and under which conditions, +- the `compute logic` of how the total score to the responses on a questionnaire +should be computed + +The Reproschema also allows for internationalization and multiple languages support +by making it very easy to keep everything the same about a questionnaire and only +specify which language should be displayed by the user interface. + +Finally Reproschema allows tracking of variations and version of different assessments +tools (e.g., PHQ-9, PHQ-8). \ No newline at end of file diff --git a/docs/20_project_structure.md b/docs/20_project_structure.md index 305694e472..9a74e791a5 100644 --- a/docs/20_project_structure.md +++ b/docs/20_project_structure.md @@ -13,31 +13,48 @@ A brief description of how they all interact could be along the following lines: ## [Reproschema](https://github.com/ReproNim/reproschema) -This repository contains the actual Reproschema with the [`contexts`](https://github.com/ReproNim/reproschema/tree/master/contexts) of the schema and the [`terms`](https://github.com/ReproNim/reproschema/tree/master/terms) that define its different elements and how they relate to each other and to other external entities. +This repository contains the actual Reproschema with the [`contexts`](https://github.com/ReproNim/reproschema/tree/master/contexts) +of the schema and the [`terms`](https://github.com/ReproNim/reproschema/tree/master/terms) +that define its different elements and how they relate to each other and to other +external entities. -This repository also contains some [`validation`](https://github.com/ReproNim/reproschema/tree/master/validation) tools that can allow you to ensure that any new `protocol`, `activity` or `item` you create conforms to the specifications of the schema. +This repository also contains SHACL-based validation information in [`validation`](https://github.com/ReproNim/reproschema/tree/master/validation), +which allows you to ensure that any new `protocol`, `activity` or `item` you create +conforms to the specifications of the schema. -There is also an [`example`](https://github.com/ReproNim/reproschema/tree/master/example) schema that can help give you a quick overview of what the protocol for a study might look like. +There is also an [`example`](https://github.com/ReproNim/reproschema/tree/master/example) +schema that can help give you a quick overview of what the protocol for a study +might look like. ## [Reproschema-library](https://github.com/ReproNim/reproschema-library) -This [repository](https://github.com/ReproNim/reproschema-library) hosts all the assessments an questionnaires that support the Reproschema standard. +This [repository](https://github.com/ReproNim/reproschema-library) hosts all the +community curated assessments and questionnaires that support the Reproschema +standard. -Imagine this as curated library of reusable assessments and questionnaires, from where you can easily pull a copy from rather than having to photocopy a new questionnaire for your next participant or patient. +Imagine this as curated library of reusable assessments and questionnaires, from +where you can easily pull a copy from rather than having to photocopy a new +questionnaire for your next participant or patient. Also you can mix and match +items from this library, knowing that the information is tracked in your protocol. -All the currently supported tools are listed in [the `activity` folder](https://github.com/ReproNim/reproschema-library/tree/master/activities) and are served [here](https://schema.repronim.org/rl/) if you want to visualize them. +All assessments are listed in [the `activity` folder](https://github.com/ReproNim/reproschema-library/tree/master/activities) +and are served [here](https://schema.repronim.org/rl/) if you want to visualize +them. ## [Reproschema-ui](https://github.com/ReproNim/reproschema-ui) -This repository contains the code for the user-interface for the ReproSchema to visualize questionnaires and collect data. +This repository contains the code for the user-interface for the ReproSchema to +visualize questionnaires and collect data. You can see it in action [here](https://schema.repronim.org/ui/) ## [Reproschema-py](https://github.com/ReproNim/reproschema-py) -This is the Reproschema python library. This is a python Command Line Interface (CLI) that allows you to help create and validate the schemas of new assessments +This is the Reproschema python library. This is a python Command Line Interface (CLI) +that allows you to help create and validate the schemas of new assessments. -- test that a schema for a `protocol`, `activity` or `item` is valid and matches the specificatiof the Reproschema +- test that a schema for a `protocol`, `activity` or `item` is valid and matches +the specification of the Reproschema - convert a csv file of a questionnaire into its equivalent Reproschema ## Other repositories @@ -48,8 +65,11 @@ This repository contain a full fledge protocol that can be used as demonstration ### [Reprolib-server](https://github.com/ReproNim/reprolib-server) -This contains some additional information on how the activities are served on [https://schema.repronim.org/rl/](https://schema.repronim.org/rl/). +This contains some additional information on how the activities are served on +[https://schema.repronim.org/rl/](https://schema.repronim.org/rl/). ### [Reproschema-builder](https://github.com/ReproNim/reproschema-builder) -This repository contains now mostly obsolete python and javascript conversion tools that have been used to create some of our activities. \ No newline at end of file +This repository contains a javascript conversion tool that have been used to +create some of our activities, and can be used to convert RedCap data +dictionaries to Reproschema. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index e818de065c..221b243e76 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,17 +7,17 @@ style="width: 350px; height: auto; display: block; margin-left: auto; margin-ri ## How to use this documentation -- If you want to know more about the Reproschema project, its goals and the problems it tries to solve: check out our [introduction](./01_introduction.md). +- If you want to know more about the Reproschema project, its goals and the problems +it tries to solve: check out our [introduction](./01_introduction.md). -- The Reproschema is related to the `semantic web` and relies on `linked data` and the `JSON-LD` format. If you are unfamiliar with such things, head over to our [FAQ](./98_FAQ.md). You do not need an in depth understanding of what those things are to use the Reproschema but some "big picture" conceptual understanding could save you from a lot of confusion. 😉 +- The Reproschema is related to the `semantic web` and relies on `linked data` +and the `JSON-LD` format. If you are unfamiliar with such things, head over to +our [FAQ](./98_FAQ.md). You do not need an in depth understanding of what those +things are to use the Reproschema but some "big picture" conceptual understanding +could save you from a lot of confusion. 😉 -- Not sure how the project is organized? Check out the [project structure](./20_project_structure) page. - -## 3.0: Advantages of current representation - -## 4.0: Schema - -Schema overall structure: +- Not sure how the project is organized? Check out the [project structure](./20_project_structure) +page. ## Licence @@ -25,8 +25,10 @@ Schema overall structure: ## Contributing and feedback -We are looking for people to give us feedback on this documentation if anything is unclear by [opening an issue on our repository](???). +We are looking for people to give us feedback on this documentation if anything +is unclear by [opening an issue on our repository](https://github.com/ReproNim/reproschema/issues). -You can also get in touch on [our channel on the mattermost Brainhack](???). +You can also get in touch on [our channel on the mattermost Brainhack](https://mattermost.brainhack.org/brainhack/channels/repronim-reproschema). -If you want to get started right away and contribute directly to this documentation,you can find references and how-to in the [about section](./100_about_this_doc.md). +If you want to get started right away and contribute directly to this +documentation,you can find references and how-to in the [about section](./100_about_this_doc.md).