From b5474b89aceb841cdfdbb0ea51d30e1389f301a2 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 2 Feb 2024 13:15:48 -0500 Subject: [PATCH 01/34] [wip] linkml version with shacl, context and pydantic --- contexts/reproschema_new | 319 ++++++++ examples/activities/activity1.jsonld | 8 +- examples/activities/activity1_embed.jsonld | 4 +- .../activities/items/activity1_total_score | 2 +- examples/activities/items/item1.jsonld | 2 +- examples/activities/items/item2.jsonld | 4 +- examples/protocols/protocol1.jsonld | 2 +- examples/protocols/protocol1_embed.jsonld | 4 +- examples/responses/response1.jsonld | 2 +- examples/responses/responseActivity1.jsonld | 2 +- linkml-schema/reproschema-shacl.ttl | 706 +++++++++++++++++ linkml-schema/reproschema.py | 355 +++++++++ linkml-schema/reproschema.yaml | 728 ++++++++++++++++++ 13 files changed, 2123 insertions(+), 15 deletions(-) create mode 100644 contexts/reproschema_new create mode 100644 linkml-schema/reproschema-shacl.ttl create mode 100644 linkml-schema/reproschema.py create mode 100644 linkml-schema/reproschema.yaml diff --git a/contexts/reproschema_new b/contexts/reproschema_new new file mode 100644 index 0000000000..1245533e3b --- /dev/null +++ b/contexts/reproschema_new @@ -0,0 +1,319 @@ +{ + "comments": { + "description": "Auto generated by LinkML jsonld context generator", + "generation_date": "2024-02-01T19:27:43", + "source": "reproschema.yaml" + }, + "@context": { + "linkml": "https://w3id.org/linkml/", + "nidm": "http://purl.org/nidash/nidm#", + "owl": "http://www.w3.org/2002/07/owl#", + "prov": "http://www.w3.org/ns/prov#", + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "reproschema": "http://schema.repronim.org/", + "schema": "http://schema.org/", + "skos": "http://www.w3.org/2004/02/skos/core#", + "xml": { + "@id": "http://www.w3.org/XML/1998/namespace", + "@prefix": true + }, + "xsd": "http://www.w3.org/2001/XMLSchema#", + "@vocab": "http://example.org/example/", + "about": { + "@id": "schema:about" + }, + "additionalNotesObj": { + "@id": "reproschema:additionalNotesObj" + }, + "addProperties": { + "@id": "reproschema:addProperties" + }, + "allow": { + "@id": "reproschema:allow" + }, + "altLabel": { + "@id": "skos:altLabel", + "@container": "@language" + }, + "associatedMedia": { + "@id": "schema:associatedMedia" + }, + "audio": { + "@type": "@id", + "@id": "schema:audio" + }, + "choices": { + "@id": "reproschema:choices" + }, + "citation": { + "@id": "schema:citation", + "@container": "@language" + }, + "column": { + "@id": "reproschema:column" + }, + "compute": { + "@id": "reproschema:compute" + }, + "contentUrl": { + "@type": "@id", + "@id": "schema:contentUrl" + }, + "cronTable": { + "@id": "reproschema:cronTable" + }, + "datumType": { + "@id": "reproschema:datumType" + }, + "description": { + "@id": "schema:description", + "@container": "@language" + }, + "endedAtTime": { + "@type": "xsd:dateTime", + "@id": "prov:endedAtTime" + }, + "generated": { + "@id": "prov:generated" + }, + "image": { + "@type": "@id", + "@id": "schema:image" + }, + "inLanguage": { + "@id": "schema:inLanguage" + }, + "inputType": { + "@id": "reproschema:inputType" + }, + "isAbout": { + "@id": "reproschema:isAbout" + }, + "isPartOf": { + "@id": "schema:isPartOf" + }, + "isVis": { + "@id": "reproschema:isVis" + }, + "jsExpression": { + "@id": "reproschema:jsExpression" + }, + "landingPage": { + "@id": "reproschema:landingPage" + }, + "limit": { + "@id": "reproschema:limit" + }, + "maxRetakes": { + "@id": "reproschema:maxRetakes" + }, + "maxValue": { + "@id": "schema:maxValue" + }, + "message": { + "@id": "reproschema:message", + "@container": "@language" + }, + "messages": { + "@id": "reproschema:messages" + }, + "minValue": { + "@id": "schema:minValue" + }, + "multipleChoice": { + "@id": "reproschema:multipleChoice" + }, + "name": { + "@id": "schema:name", + "@container": "@language" + }, + "order": { + "@id": "reproschema:order" + }, + "overrideProperties": { + "@id": "reproschema:overrideProperties" + }, + "preamble": { + "@id": "reproschema:preamble", + "@container": "@language" + }, + "prefLabel": { + "@id": "skos:prefLabel", + "@container": "@language" + }, + "question": { + "@id": "schema:question", + "@container": "@language" + }, + "randomMaxDelay": { + "@id": "reproschema:randomMaxDelay" + }, + "readonlyValue": { + "@id": "schema:readonlyValue" + }, + "responseOptions": { + "@id": "reproschema:responseOptions" + }, + "schedule": { + "@id": "reproschema:schedule" + }, + "schemaVersion": { + "@id": "schema:schemaVersion" + }, + "shuffle": { + "@id": "reproschema:shuffle" + }, + "source": { + "@id": "reproschema:source" + }, + "startedAtTime": { + "@type": "xsd:dateTime", + "@id": "prov:startedAtTime" + }, + "statusOptions": { + "@id": "reproschema:statusOptions" + }, + "subject_id": { + "@id": "nidm:subject_id" + }, + "ui": { + "@type": "@id", + "@id": "reproschema:ui" + }, + "unitOptions": { + "@id": "reproschema:unitOptions" + }, + "url": { + "@id": "schema:url" + }, + "used": { + "@id": "prov:used" + }, + "value": { + "@id": "reproschema:value" + }, + "valueRequired": { + "@type": "xsd:boolean", + "@id": "schema:valueRequired" + }, + "valueType": { + "@id": "reproschema:valueType" + }, + "variableName": { + "@id": "reproschema:variableName" + }, + "version": { + "@id": "schema:version" + }, + "video": { + "@type": "@id", + "@id": "schema:video" + }, + "wasAssociatedWith": { + "@type": "@id", + "@id": "prov:wasAssociatedWith" + }, + "wasAttributedTo": { + "@type": "@id", + "@id": "prov:wasAttributedTo" + }, + "Activity": { + "@id": "reproschema:Activity" + }, + "AdditionalNoteObj": { + "@id": "reproschema:AdditionalNoteObj" + }, + "AdditionalProperty": { + "@id": "reproschema:AdditionalProperty" + }, + "Agent": { + "@id": "prov:Agent" + }, + "AllowExport": { + "@id": "reproschema:AllowExport" + }, + "AllowReplay": { + "@id": "reproschema:AllowReplay" + }, + "AutoAdvance": { + "@id": "reproschema:AutoAdvance" + }, + "Choice": { + "@id": "reproschema:Choice" + }, + "ComputeSpecification": { + "@id": "reproschema:ComputeSpecification" + }, + "CreativeWork": { + "@id": "schema:CreativeWork" + }, + "DisableBack": { + "@id": "reproschema:DisableBack" + }, + "DontKnow": { + "@id": "reproschema:DontKnow" + }, + "Field": { + "@id": "reproschema:Field" + }, + "LandingPage": { + "@id": "reproschema:LandingPage" + }, + "LangString": { + "@id": "rdf:langString" + }, + "MediaObject": { + "@id": "schema:MediaObject" + }, + "MessageSpecification": { + "@id": "reproschema:MessageSpecification" + }, + "OverrideProperty": { + "@id": "reproschema:OverrideProperty" + }, + "Participant": { + "@id": "reproschema:Participant" + }, + "Protocol": { + "@id": "reproschema:Protocol" + }, + "Response": { + "@id": "reproschema:Response" + }, + "ResponseActivity": { + "@id": "reproschema:ResponseActivity" + }, + "ResponseOption": { + "@id": "reproschema:ResponseOption" + }, + "Schedule": { + "@id": "reproschema:Schedule" + }, + "Skipped": { + "@id": "reproschema:Skipped" + }, + "SoftwareAgent": { + "@id": "reproschema:SoftwareAgent" + }, + "StructuredValue": { + "@id": "schema:StructuredValue" + }, + "Thing": { + "@id": "schema:Thing" + }, + "TimedOut": { + "@id": "reproschema:TimedOut" + }, + "UI": { + "@id": "http://example.org/example/UI" + }, + "UnitOption": { + "@id": "reproschema:UnitOption" + }, + "VideoObject": { + "@id": "schema:VideoObject" + } + } +} + diff --git a/examples/activities/activity1.jsonld b/examples/activities/activity1.jsonld index 6a533ee6f4..a7da3bc16d 100644 --- a/examples/activities/activity1.jsonld +++ b/examples/activities/activity1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:Activity", "@id": "activity1.jsonld", "prefLabel": "Example 1", @@ -31,7 +31,7 @@ "addProperties": [ { "isAbout": "items/item1.jsonld", "variableName": "item1", - "requiredValue": true, + "valueRequired": true, "isVis": true, "randomMaxDelay": "PT2H", "limit": "P2D", @@ -39,13 +39,13 @@ }, { "isAbout": "items/item2.jsonld", "variableName": "item2", - "requiredValue": true, + "valueRequired": true, "isVis": true, "allow": ["reproschema:Skipped"] }, { "isAbout": "items/activity1_total_score", "variableName": "activity1_total_score", - "requiredValue": true, + "valueRequired": true, "isVis": false } ], diff --git a/examples/activities/activity1_embed.jsonld b/examples/activities/activity1_embed.jsonld index f732505139..cdf6e4382d 100644 --- a/examples/activities/activity1_embed.jsonld +++ b/examples/activities/activity1_embed.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:Activity", "@id": "activity1.jsonld", "prefLabel": "Example 1", @@ -15,7 +15,7 @@ "addProperties": [ { "isAbout": "items/item1.jsonld", "variableName": "item1", - "requiredValue": true, + "valueRequired": true, "isVis": true} ], "order": [ diff --git a/examples/activities/items/activity1_total_score b/examples/activities/items/activity1_total_score index 5ed7f84ea3..8174c85962 100644 --- a/examples/activities/items/activity1_total_score +++ b/examples/activities/items/activity1_total_score @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/generic", + "@context": "../../../contexts/reproschema_new", "@type": "reproschema:Field", "@id": "activity1_total_score", "prefLabel": "activity1_total_score", diff --git a/examples/activities/items/item1.jsonld b/examples/activities/items/item1.jsonld index 921061245f..26b76643b7 100644 --- a/examples/activities/items/item1.jsonld +++ b/examples/activities/items/item1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/generic", + "@context": "../../../contexts/reproschema_new", "@type": "reproschema:Field", "@id": "item1.jsonld", "prefLabel": "item1", diff --git a/examples/activities/items/item2.jsonld b/examples/activities/items/item2.jsonld index cf1b37a1df..dbaa7a2704 100644 --- a/examples/activities/items/item2.jsonld +++ b/examples/activities/items/item2.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/generic", + "@context": "../../../contexts/reproschema_new", "@type": "reproschema:Field", "@id": "item2.jsonld", "prefLabel": "item2", @@ -14,7 +14,7 @@ "@type": "VideoObject", "contentUrl": "http://media.freesound.org/data/0/previews/719__elmomo__12oclock_girona_preview.mp4" }, - "imageUrl": "http://example.com/sample-image.jpg", + "image": "http://example.com/sample-image.jpg", "ui": { "inputType": "float" }, diff --git a/examples/protocols/protocol1.jsonld b/examples/protocols/protocol1.jsonld index dc79103dc5..54d3d4178a 100644 --- a/examples/protocols/protocol1.jsonld +++ b/examples/protocols/protocol1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { diff --git a/examples/protocols/protocol1_embed.jsonld b/examples/protocols/protocol1_embed.jsonld index 69ac9cb23d..70ff72f785 100644 --- a/examples/protocols/protocol1_embed.jsonld +++ b/examples/protocols/protocol1_embed.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { @@ -39,7 +39,7 @@ { "isAbout": "../activities/items/item1.jsonld", "variableName": "item1", - "requiredValue": true, + "valueRequired": true, "isVis": true } ], diff --git a/examples/responses/response1.jsonld b/examples/responses/response1.jsonld index 9513cbf1eb..936070297c 100644 --- a/examples/responses/response1.jsonld +++ b/examples/responses/response1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:Response", "@id": "uuid:fc963765-1f1b-4ad9-bc4b-0d21b9de5acb", "wasAttributedTo": { diff --git a/examples/responses/responseActivity1.jsonld b/examples/responses/responseActivity1.jsonld index 781eabf43c..df73f87d33 100644 --- a/examples/responses/responseActivity1.jsonld +++ b/examples/responses/responseActivity1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/reproschema_new", "@type": "reproschema:ResponseActivity", "@id": "uuid:96496a96-50d6-4b87-a65e-468420e7c80d", "used": [ diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl new file mode 100644 index 0000000000..adac08be4b --- /dev/null +++ b/linkml-schema/reproschema-shacl.ttl @@ -0,0 +1,706 @@ +# metamodel_version: 1.7.0 +@prefix nidm: . +@prefix prov: . +@prefix rdf: . +@prefix reproschema: . +@prefix schema1: . +@prefix sh: . +@prefix skos: . +@prefix xsd: . + +schema1:CreativeWork a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass schema1:CreativeWork . + +schema1:MediaObject a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Media Object" ; + sh:property [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ], + [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 1 ; + sh:path schema1:inLanguage ] ; + sh:targetClass schema1:MediaObject . + +reproschema:AllowExport a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Allow export" ; + sh:targetClass reproschema:AllowExport . + +reproschema:AllowReplay a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Allow replay" ; + sh:targetClass reproschema:AllowReplay . + +reproschema:AutoAdvance a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Auto advance" ; + sh:targetClass reproschema:AutoAdvance . + +reproschema:DisableBack a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Disable redo" ; + sh:targetClass reproschema:DisableBack . + +reproschema:Protocol a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Protocol" ; + sh:property [ sh:name "computation" ; + sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; + sh:order 5 ; + sh:path reproschema:compute ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 13 ; + sh:path schema1:schemaVersion ], + [ sh:name "allow" ; + sh:or ( [ sh:node schema1:Thing ] ) ; + sh:order 2 ; + sh:path reproschema:allow ], + [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 12 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 6 ; + sh:path reproschema:cronTable ], + [ sh:name "overrideProperties" ; + sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; + sh:order 11 ; + sh:path reproschema:overrideProperties ], + [ sh:name "addProperties" ; + sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; + sh:order 1 ; + sh:path reproschema:addProperties ], + [ sh:maxCount 1 ; + sh:name "Shuffle" ; + sh:or ( [ sh:datatype xsd:boolean ] ) ; + sh:order 14 ; + sh:path reproschema:shuffle ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "associatedMedia" ; + sh:order 4 ; + sh:path schema1:associatedMedia ], + [ sh:name "Order" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 10 ; + sh:path reproschema:order ], + [ sh:name "messages" ; + sh:or ( [ sh:node reproschema:MessageSpecification ] ) ; + sh:order 9 ; + sh:path reproschema:messages ], + [ sh:node ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:order 15 ; + sh:path reproschema:ui ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 16 ; + sh:path schema1:version ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 3 ; + sh:path skos:altLabel ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 7 ; + sh:path schema1:description ], + [ sh:maxCount 1 ; + sh:name "Landing page content" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] [ sh:node reproschema:LandingPage ] ) ; + sh:order 8 ; + sh:path reproschema:landingPage ] ; + sh:targetClass reproschema:Protocol . + +reproschema:Response a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Response" ; + sh:property [ sh:node ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:order 1 ; + sh:path reproschema:ui ], + [ sh:maxCount 1 ; + sh:name "isAbout" ; + sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 0 ; + sh:path reproschema:isAbout ], + [ sh:node reproschema:Participant ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path prov:wasAttributedTo ], + [ sh:name "value" ; + sh:or ( [ sh:node reproschema:Skipped ] [ sh:node reproschema:DontKnow ] [ sh:datatype xsd:decimal ] [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] [ sh:node schema1:StructuredValue ] ) ; + sh:order 2 ; + sh:path reproschema:value ] ; + sh:targetClass reproschema:Response . + +reproschema:ResponseActivity a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "ResponseActivity" ; + sh:property [ sh:datatype xsd:string ; + sh:order 4 ; + sh:path prov:used ], + [ sh:node reproschema:SoftwareAgent ; + sh:maxCount 1 ; + sh:order 5 ; + sh:path prov:wasAssociatedWith ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path prov:generated ], + [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 2 ; + sh:path schema1:inLanguage ], + [ sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path prov:endedAtTime ], + [ sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path prov:startedAtTime ] ; + sh:targetClass reproschema:ResponseActivity . + +reproschema:TimedOut a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Response timed out" ; + sh:targetClass reproschema:TimedOut . + +prov:Agent a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass prov:Agent . + +schema1:VideoObject a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Video Object" ; + sh:property [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 1 ; + sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ] ; + sh:targetClass schema1:VideoObject . + +reproschema:AdditionalNoteObj a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Additional Notes Object" ; + sh:property [ sh:name "column" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path reproschema:column ], + [ sh:name "value" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; + sh:order 2 ; + sh:path reproschema:value ], + [ sh:name "source" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 1 ; + sh:path reproschema:source ] ; + sh:targetClass reproschema:AdditionalNoteObj . + +reproschema:Choice a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Response choice" ; + sh:property [ sh:maxCount 1 ; + sh:name "image" ; + sh:order 1 ; + sh:path schema1:image ], + [ sh:name "value" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; + sh:order 2 ; + sh:path reproschema:value ], + [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path schema1:name ] ; + sh:targetClass reproschema:Choice . + +reproschema:DontKnow a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Do not know" ; + sh:targetClass reproschema:DontKnow . + +reproschema:LandingPage a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Landing Page" ; + sh:property [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path schema1:inLanguage ] ; + sh:targetClass reproschema:LandingPage . + +reproschema:Participant a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Participant" ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path nidm:subject_id ] ; + sh:targetClass reproschema:Participant . + +reproschema:ResponseOption a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Response option" ; + sh:property [ sh:maxCount 1 ; + sh:name "datumType" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] ) ; + sh:order 1 ; + sh:path reproschema:datumType ], + [ sh:name "The type of the response" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 6 ; + sh:path reproschema:valueType ], + [ sh:maxCount 1 ; + sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; + sh:order 3 ; + sh:path schema1:minValue ], + [ sh:name "unitOptions" ; + sh:or ( [ sh:node reproschema:UnitOption ] ) ; + sh:order 5 ; + sh:path reproschema:unitOptions ], + [ sh:maxCount 1 ; + sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; + sh:order 2 ; + sh:path schema1:maxValue ], + [ sh:name "choices" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Choice ] ) ; + sh:order 0 ; + sh:path reproschema:choices ], + [ sh:maxCount 1 ; + sh:name "Multiple choice response expectation" ; + sh:or ( [ sh:datatype xsd:boolean ] ) ; + sh:order 4 ; + sh:path reproschema:multipleChoice ] ; + sh:targetClass reproschema:ResponseOption . + +reproschema:Skipped a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Skipped" ; + sh:targetClass reproschema:Skipped . + +reproschema:SoftwareAgent a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Software Agent" ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:url ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:version ] ; + sh:targetClass reproschema:SoftwareAgent . + +reproschema:UnitOption a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Unit options" ; + sh:property [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path skos:prefLabel ], + [ sh:name "value" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] ) ; + sh:order 1 ; + sh:path reproschema:value ] ; + sh:targetClass reproschema:UnitOption . + +reproschema:ComputeSpecification a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Compute Specification" ; + sh:property [ sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 0 ; + sh:path reproschema:jsExpression ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "variableName" ; + sh:order 1 ; + sh:path reproschema:variableName ] ; + sh:targetClass reproschema:ComputeSpecification . + +reproschema:MessageSpecification a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Message Specification" ; + sh:property [ sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 0 ; + sh:path reproschema:jsExpression ], + [ sh:name "Message" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 1 ; + sh:path reproschema:message ] ; + sh:targetClass reproschema:MessageSpecification . + +reproschema:Schedule a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Schedule" ; + sh:targetClass reproschema:Schedule . + +schema1:StructuredValue a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass schema1:StructuredValue . + +reproschema:AdditionalProperty a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Additional properties" ; + sh:property [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 5 ; + sh:path skos:prefLabel ], + [ sh:maxCount 1 ; + sh:name "Schedule" ; + sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; + sh:order 7 ; + sh:path reproschema:schedule ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:valueRequired ], + [ sh:name "allow" ; + sh:or ( [ sh:node schema1:Thing ] ) ; + sh:order 0 ; + sh:path reproschema:allow ], + [ sh:maxCount 1 ; + sh:name "visibility" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 2 ; + sh:path reproschema:isVis ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "variableName" ; + sh:order 9 ; + sh:path reproschema:variableName ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 6 ; + sh:path reproschema:randomMaxDelay ], + [ sh:maxCount 1 ; + sh:name "isAbout" ; + sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 1 ; + sh:path reproschema:isAbout ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "limit" ; + sh:order 3 ; + sh:path reproschema:limit ], + [ sh:maxCount 1 ; + sh:name "maxRetakes" ; + sh:or ( [ sh:datatype xsd:decimal ] ) ; + sh:order 4 ; + sh:path reproschema:maxRetakes ] ; + sh:targetClass reproschema:AdditionalProperty . + +reproschema:OverrideProperty a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Additional properties" ; + sh:property [ sh:maxCount 1 ; + sh:name "maxRetakes" ; + sh:or ( [ sh:datatype xsd:decimal ] ) ; + sh:order 3 ; + sh:path reproschema:maxRetakes ], + [ sh:maxCount 1 ; + sh:name "visibility" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 1 ; + sh:path reproschema:isVis ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 7 ; + sh:path schema1:valueRequired ], + [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 4 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 5 ; + sh:path reproschema:randomMaxDelay ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "limit" ; + sh:order 2 ; + sh:path reproschema:limit ], + [ sh:maxCount 1 ; + sh:name "Schedule" ; + sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; + sh:order 6 ; + sh:path reproschema:schedule ], + [ sh:maxCount 1 ; + sh:name "isAbout" ; + sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 0 ; + sh:path reproschema:isAbout ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "variableName" ; + sh:order 8 ; + sh:path reproschema:variableName ] ; + sh:targetClass reproschema:OverrideProperty . + + a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "todo" ; + sh:property [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 6 ; + sh:path schema1:readonlyValue ], + [ sh:maxCount 1 ; + sh:name "Shuffle" ; + sh:or ( [ sh:datatype xsd:boolean ] ) ; + sh:order 4 ; + sh:path reproschema:shuffle ], + [ sh:name "addProperties" ; + sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; + sh:order 1 ; + sh:path reproschema:addProperties ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:valueRequired ], + [ sh:name "Order" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 0 ; + sh:path reproschema:order ], + [ sh:name "overrideProperties" ; + sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; + sh:order 2 ; + sh:path reproschema:overrideProperties ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "inputType" ; + sh:order 5 ; + sh:path reproschema:inputType ], + [ sh:name "Message" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 3 ; + sh:path reproschema:message ], + [ sh:name "allow" ; + sh:or ( [ sh:node schema1:Thing ] ) ; + sh:order 7 ; + sh:path reproschema:allow ] ; + sh:targetClass . + +schema1:Thing a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass schema1:Thing . + +reproschema:Field a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Field" ; + sh:property [ sh:maxCount 1 ; + sh:or ( [ sh:node reproschema:Activity ] ) ; + sh:order 8 ; + sh:path schema1:isPartOf ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 12 ; + sh:path schema1:readonlyValue ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "associatedMedia" ; + sh:order 3 ; + sh:path schema1:associatedMedia ], + [ sh:maxCount 1 ; + sh:name "Response options" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:ResponseOption ] ) ; + sh:order 13 ; + sh:path reproschema:responseOptions ], + [ sh:maxCount 1 ; + sh:name "image" ; + sh:order 6 ; + sh:path schema1:image ], + [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 10 ; + sh:path skos:prefLabel ], + [ sh:name "additional notes" ; + sh:or ( [ sh:node reproschema:AdditionalNoteObj ] ) ; + sh:order 1 ; + sh:path reproschema:additionalNotesObj ], + [ sh:maxCount 1 ; + sh:name "audio" ; + sh:order 4 ; + sh:path schema1:audio ], + [ sh:node ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:order 15 ; + sh:path reproschema:ui ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 16 ; + sh:path schema1:version ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 2 ; + sh:path skos:altLabel ], + [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 11 ; + sh:path schema1:question ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:node schema1:VideoObject ; + sh:maxCount 1 ; + sh:order 17 ; + sh:path schema1:video ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 14 ; + sh:path schema1:schemaVersion ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "inputType" ; + sh:order 7 ; + sh:path reproschema:inputType ], + [ sh:name "Preamble" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 9 ; + sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 5 ; + sh:path schema1:description ] ; + sh:targetClass reproschema:Field . + +reproschema:Activity a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Activity" ; + sh:property [ sh:node ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:order 17 ; + sh:path reproschema:ui ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 5 ; + sh:path schema1:citation ], + [ sh:name "preferred label" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 14 ; + sh:path skos:prefLabel ], + [ sh:name "Order" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 11 ; + sh:path reproschema:order ], + [ sh:maxCount 1 ; + sh:name "image" ; + sh:order 9 ; + sh:path schema1:image ], + [ sh:name "overrideProperties" ; + sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; + sh:order 12 ; + sh:path reproschema:overrideProperties ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:name "computation" ; + sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; + sh:order 6 ; + sh:path reproschema:compute ], + [ sh:maxCount 1 ; + sh:name "Shuffle" ; + sh:or ( [ sh:datatype xsd:boolean ] ) ; + sh:order 16 ; + sh:path reproschema:shuffle ], + [ sh:name "allow" ; + sh:or ( [ sh:node schema1:Thing ] ) ; + sh:order 2 ; + sh:path reproschema:allow ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 18 ; + sh:path schema1:version ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 7 ; + sh:path reproschema:cronTable ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "associatedMedia" ; + sh:order 4 ; + sh:path schema1:associatedMedia ], + [ sh:name "messages" ; + sh:or ( [ sh:node reproschema:MessageSpecification ] ) ; + sh:order 10 ; + sh:path reproschema:messages ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 15 ; + sh:path schema1:schemaVersion ], + [ sh:name "Preamble" ; + sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 13 ; + sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:description ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 3 ; + sh:path skos:altLabel ], + [ sh:name "addProperties" ; + sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; + sh:order 1 ; + sh:path reproschema:addProperties ] ; + sh:targetClass reproschema:Activity . + +rdf:langString a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass rdf:langString . + + diff --git a/linkml-schema/reproschema.py b/linkml-schema/reproschema.py new file mode 100644 index 0000000000..9d087baf58 --- /dev/null +++ b/linkml-schema/reproschema.py @@ -0,0 +1,355 @@ +from __future__ import annotations +from datetime import datetime, date +from enum import Enum + +from typing import List, Dict, Optional, Any, Union +from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator +import re +import sys +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +metamodel_version = "None" +version = "None" + +class ConfiguredBaseModel(BaseModel): + model_config = ConfigDict( + validate_assignment=True, + validate_default=True, + extra = 'forbid', + arbitrary_types_allowed=True, + use_enum_values = True) + pass + + +class AdditionalNoteObj(ConfiguredBaseModel): + + column: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="column") + source: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="source") + value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") + + + +class AdditionalProperty(ConfiguredBaseModel): + + allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") + isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") + isVis: Optional[Union[bool, str]] = Field(None, title="visibility") + limit: Optional[str] = Field(None, title="limit") + maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes") + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay") + schedule: Optional[Union[Schedule, str]] = Field(None, title="Schedule") + valueRequired: Optional[bool] = Field(None) + variableName: Optional[str] = Field(None, title="variableName") + + + +class Agent(ConfiguredBaseModel): + + None + + + +class AllowExport(ConfiguredBaseModel): + + None + + + +class AllowReplay(ConfiguredBaseModel): + + None + + + +class AutoAdvance(ConfiguredBaseModel): + + None + + + +class Choice(ConfiguredBaseModel): + + name: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + image: Optional[str] = Field(None, title="image") + value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") + + + +class ComputeSpecification(ConfiguredBaseModel): + + jsExpression: Optional[Union[bool, str]] = Field(None, title="JavaScript Expression") + variableName: Optional[str] = Field(None, title="variableName") + + + +class CreativeWork(ConfiguredBaseModel): + + None + + + +class Activity(CreativeWork): + + about: Optional[str] = Field(None) + addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") + allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") + altLabel: Optional[str] = Field(None, title="alternate label") + associatedMedia: Optional[str] = Field(None, title="associatedMedia") + citation: Optional[str] = Field(None) + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation") + cronTable: Optional[str] = Field(None, title="cronTable") + description: Optional[str] = Field(None) + image: Optional[str] = Field(None, title="image") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages") + order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") + overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") + preamble: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Preamble") + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + schemaVersion: Optional[str] = Field(None) + shuffle: Optional[bool] = Field(None, title="Shuffle") + ui: Optional[UI] = Field(None, title="UI") + version: Optional[str] = Field(None) + + + +class DisableBack(ConfiguredBaseModel): + + None + + + +class DontKnow(ConfiguredBaseModel): + + None + + + +class Field(CreativeWork): + + about: Optional[str] = Field(None) + additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes") + altLabel: Optional[str] = Field(None, title="alternate label") + associatedMedia: Optional[str] = Field(None, title="associatedMedia") + audio: Optional[str] = Field(None, title="audio") + description: Optional[str] = Field(None) + image: Optional[str] = Field(None, title="image") + inputType: Optional[str] = Field(None, title="inputType") + isPartOf: Optional[Activity] = Field(None) + preamble: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Preamble") + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + question: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + readonlyValue: Optional[str] = Field(None) + responseOptions: Optional[Union[ResponseOption, str]] = Field(None, title="Response options") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI") + version: Optional[str] = Field(None) + video: Optional[VideoObject] = Field(None) + + + +class LandingPage(ConfiguredBaseModel): + + inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + + + +class LangString(ConfiguredBaseModel): + + None + + + +class MediaObject(ConfiguredBaseModel): + + contentUrl: str = Field(...) + inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + + + +class MessageSpecification(ConfiguredBaseModel): + + jsExpression: Optional[Union[bool, str]] = Field(None, title="JavaScript Expression") + message: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Message") + + + +class OverrideProperty(ConfiguredBaseModel): + + isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") + isVis: Optional[Union[bool, str]] = Field(None, title="visibility") + limit: Optional[str] = Field(None, title="limit") + maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes") + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay") + schedule: Optional[Union[Schedule, str]] = Field(None, title="Schedule") + valueRequired: Optional[bool] = Field(None) + variableName: Optional[str] = Field(None, title="variableName") + + + +class Participant(Agent): + + subject_id: Optional[str] = Field(None) + + + +class Protocol(CreativeWork): + + about: Optional[str] = Field(None) + addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") + allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") + altLabel: Optional[str] = Field(None, title="alternate label") + associatedMedia: Optional[str] = Field(None, title="associatedMedia") + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation") + cronTable: Optional[str] = Field(None, title="cronTable") + description: Optional[str] = Field(None) + landingPage: Optional[Union[LandingPage, str]] = Field(None, title="Landing page content") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages") + order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") + overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + schemaVersion: Optional[str] = Field(None) + shuffle: Optional[bool] = Field(None, title="Shuffle") + ui: Optional[UI] = Field(None, title="UI") + version: Optional[str] = Field(None) + + + +class Response(CreativeWork): + + isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") + ui: Optional[UI] = Field(None, title="UI") + value: Optional[List[Union[Decimal, DontKnow, Skipped, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") + wasAttributedTo: Optional[Participant] = Field(None) + + + +class ResponseActivity(CreativeWork): + + endedAtTime: Optional[datetime ] = Field(None) + generated: Optional[str] = Field(None) + inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + startedAtTime: Optional[datetime ] = Field(None) + used: Optional[List[str]] = Field(default_factory=list) + wasAssociatedWith: Optional[SoftwareAgent] = Field(None) + + + +class ResponseOption(ConfiguredBaseModel): + + choices: Optional[List[Union[Choice, str]]] = Field(default_factory=list, title="choices") + datumType: Optional[str] = Field(None, title="datumType") + maxValue: Optional[Union[float, int]] = Field(None) + minValue: Optional[Union[float, int]] = Field(None) + multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation") + unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions") + valueType: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="The type of the response") + + + +class Schedule(ConfiguredBaseModel): + + None + + + +class Skipped(ConfiguredBaseModel): + + None + + + +class SoftwareAgent(ConfiguredBaseModel): + + version: Optional[str] = Field(None) + url: Optional[str] = Field(None) + + + +class StructuredValue(ConfiguredBaseModel): + + None + + + +class Thing(ConfiguredBaseModel): + + None + + + +class TimedOut(ConfiguredBaseModel): + + None + + + +class UI(ConfiguredBaseModel): + + order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") + addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") + overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") + message: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Message") + shuffle: Optional[bool] = Field(None, title="Shuffle") + inputType: Optional[str] = Field(None, title="inputType") + readonlyValue: Optional[str] = Field(None) + allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") + valueRequired: Optional[bool] = Field(None) + + + +class UnitOption(ConfiguredBaseModel): + + prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") + value: Optional[List[str]] = Field(default_factory=list, title="value") + + + +class VideoObject(ConfiguredBaseModel): + + contentUrl: str = Field(...) + inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + + + + +# Model rebuild +# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +AdditionalNoteObj.model_rebuild() +AdditionalProperty.model_rebuild() +Agent.model_rebuild() +AllowExport.model_rebuild() +AllowReplay.model_rebuild() +AutoAdvance.model_rebuild() +Choice.model_rebuild() +ComputeSpecification.model_rebuild() +CreativeWork.model_rebuild() +Activity.model_rebuild() +DisableBack.model_rebuild() +DontKnow.model_rebuild() +Field.model_rebuild() +LandingPage.model_rebuild() +LangString.model_rebuild() +MediaObject.model_rebuild() +MessageSpecification.model_rebuild() +OverrideProperty.model_rebuild() +Participant.model_rebuild() +Protocol.model_rebuild() +Response.model_rebuild() +ResponseActivity.model_rebuild() +ResponseOption.model_rebuild() +Schedule.model_rebuild() +Skipped.model_rebuild() +SoftwareAgent.model_rebuild() +StructuredValue.model_rebuild() +Thing.model_rebuild() +TimedOut.model_rebuild() +UI.model_rebuild() +UnitOption.model_rebuild() +VideoObject.model_rebuild() + diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml new file mode 100644 index 0000000000..bccd378554 --- /dev/null +++ b/linkml-schema/reproschema.yaml @@ -0,0 +1,728 @@ +name: reproschema +id: http://example.org/example # todo: change this +imports: +- linkml:types +prefixes: + owl: http://www.w3.org/2002/07/owl# + rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# + rdfs: http://www.w3.org/2000/01/rdf-schema# + xsd: http://www.w3.org/2001/XMLSchema# + xml: http://www.w3.org/XML/1998/namespace + nidm: http://purl.org/nidash/nidm# + prov: http://www.w3.org/ns/prov# + reproschema: http://schema.repronim.org/ + schema: http://schema.org/ + skos: http://www.w3.org/2004/02/skos/core# + linkml: https://w3id.org/linkml/ +default_range: string +slots: + about: + comments: + - The subject matter of the Field. + slot_uri: schema:about + addProperties: + title: addProperties + comments: + - An array of objects to describe the various properties added to assessments + and fields. + slot_uri: reproschema:addProperties + multivalued: true + any_of: + - range: AdditionalProperty + additionalNotesObj: + title: additional notes + comments: + - 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. + slot_uri: reproschema:additionalNotesObj + multivalued: true + any_of: + - range: AdditionalNoteObj + allow: + title: allow + comments: + - 'An array of items indicating properties allowed on an activity or protocol ' + slot_uri: reproschema:allow + multivalued: true + any_of: + - range: Thing + altLabel: + title: alternate label + comments: + - The alternate label. + slot_uri: skos:altLabel + associatedMedia: + title: associatedMedia + comments: + - A media object that encodes this CreativeWork. This property is a synonym for + encoding. + slot_uri: schema:associatedMedia + audio: + title: audio + comments: + - TDOO + slot_uri: schema:audio + range: uriorcurie + inlined: true + choices: + title: choices + comments: + - An array to list the available options for response of the Field item. + exact_mappings: + - schema:itemListElement + slot_uri: reproschema:choices + multivalued: true + any_of: + - range: uri + - range: Choice + citation: + slot_uri: schema:citation + column: + title: column + comments: + - An element to define the column name where the note was taken from. + slot_uri: reproschema:column + multivalued: true + any_of: + - range: string + - range: langString + compute: + title: computation + comments: + - '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. ' + slot_uri: reproschema:compute + multivalued: true + any_of: + - range: ComputeSpecification + contentUrl: + slot_uri: schema:contentUrl + range: uriorcurie + cronTable: + title: cronTable + comments: + - TODO not described in reproschema + slot_uri: reproschema:cronTable + datumType: + title: datumType + comments: + - Indicates what type of datum the response is (e.g. range,count,scalar etc.) + for the Field item. + slot_uri: reproschema:datumType + any_of: + - range: string + - range: uri + description: + slot_uri: schema:description + endedAtTime: + range: datetime + slot_uri: prov:endedAtTime + generated: + slot_uri: prov:generated + image: + title: image + comments: + - An image of the item. This can be a URL + or a fully described ImageObject. + slot_uri: schema:image + range: uriorcurie + inLanguage: + slot_uri: schema:inLanguage + multivalued: true + any_of: + - range: string + - range: langString + inputType: + title: inputType + comments: + - An element to describe the input type of a Field item. + slot_uri: reproschema:inputType + isAbout: + title: isAbout + comments: + - A pointer to the node describing the item. + slot_uri: reproschema:isAbout + any_of: + - range: Activity + - range: Field + isPartOf: + slot_uri: schema:isPartOf + any_of: + - range: Activity + isVis: + title: visibility + comments: + - An element to describe (by boolean or conditional statement) visibility conditions + of items in an assessment. + slot_uri: reproschema:isVis + any_of: + - range: boolean + - range: string + jsExpression: + title: JavaScript Expression + comments: + - A JavaScript expression for computations. + - A JavaScript expression to compute a score from other variables. + slot_uri: reproschema:jsExpression + any_of: + - range: boolean + - range: string + landingPage: + title: Landing page content + comments: + - An element (by URL) to point to the protocol readme or landing page. + slot_uri: reproschema:landingPage + any_of: + - range: uri + - range: string + - range: LandingPage + limit: + title: limit + comments: + - An element to limit the duration (uses ISO 8601) this activity is allowed to + be completed by once activity is available. + slot_uri: reproschema:limit + maxRetakes: + title: maxRetakes + comments: + - Defines number of times the item is allowed to be redone. + slot_uri: reproschema:maxRetakes + any_of: + - range: decimal + maxValue: + any_of: + - range: float + - range: integer + slot_uri: schema:maxValue + message: + title: Message + comments: + - 'The message to be conditionally displayed for an item. ' + slot_uri: reproschema:message + multivalued: true + any_of: + - range: string + - range: langString + messages: + title: messages + comments: + - An array of objects to define conditional messages in an activity or protocol. + slot_uri: reproschema:messages + multivalued: true + any_of: + - range: MessageSpecification + minValue: + slot_uri: schema:minValue + any_of: + - range: float + - range: integer + multipleChoice: + title: Multiple choice response expectation + comments: + - Indicates (by bool) if response for the Field item has one or more answer. + slot_uri: reproschema:multipleChoice + any_of: + - range: boolean + name: + multivalued: true + any_of: + - range: string + - range: langString + slot_uri: schema:name + order: + title: Order + comments: + - An ordered list to describe the order in which the items of an assessment or + protocol appear in the user interface. + slot_uri: reproschema:order + multivalued: true + any_of: + - range: uri + - range: Activity + - range: Field + overrideProperties: + title: overrideProperties + comments: + - An array of objects to override the various properties added to assessments + and fields. + slot_uri: reproschema:overrideProperties + multivalued: true + any_of: + - range: OverrideProperty + preamble: + title: Preamble + comments: + - The preamble for an assessment + slot_uri: reproschema:preamble + multivalued: true + any_of: + - range: string + - range: langString + prefLabel: + title: preferred label + comments: + - The preferred label. + slot_uri: skos:prefLabel + multivalued: true + any_of: + - range: string + - range: langString + question: + slot_uri: schema:question + multivalued: true + any_of: + - range: string + - range: langString + randomMaxDelay: + title: randomMaxDelay + comments: + - Present activity/item within some random offset of activity available time up + to the maximum specified by this ISO 8601 duration + slot_uri: reproschema:randomMaxDelay + readonlyValue: + slot_uri: schema:readonlyValue + range: boolean +# requiredValue: +# range: boolean +# slot_uri: schema:requiredValue + responseOptions: + title: Response options + comments: + - An element (object or by URL)to describe the properties of response of the Field + item. + slot_uri: reproschema:responseOptions + any_of: + - range: uri + - range: ResponseOption + schedule: + title: Schedule + comments: + - An element to set make activity available/repeat info using ISO 8601 repeating + interval format. + slot_uri: reproschema:schedule + any_of: + - range: Schedule + - range: string + schemaVersion: + slot_uri: schema:schemaVersion + shuffle: + title: Shuffle + comments: + - An element (bool) to determine if the list of items is shuffled or in order. + slot_uri: reproschema:shuffle + any_of: + - range: boolean + source: + title: source + comments: + - An element to define the source (eg. RedCap, NDA) where the note was taken from. + slot_uri: reproschema:source + multivalued: true + any_of: + - range: string + - range: langString + statusOptions: + title: Status options + comments: + - "Provides information on whether or not a field item wants to be accompanied\ + \ by the additional status option(s) defined in \u201CstatusOptions\u201D" + slot_uri: reproschema:statusOptions + startedAtTime: + range: datetime + slot_uri: prov:startedAtTime + subject_id: + slot_uri: nidm:subject_id #TODO check this @type:rdf:Property + ui: + title: UI + comments: + - it was originally @nest in jsonld, but decided for a new class for now + slot_uri: reproschema:ui + range: UI + unitOptions: + title: unitOptions + comments: + - A list of objects to represent a human displayable name alongside the more formal + value for units. + slot_uri: reproschema:unitOptions + multivalued: true + any_of: + - range: UnitOption + url: + slot_uri: schema:url + used: + slot_uri: prov:used + multivalued: true + value: + title: value + comments: + - The value for each option in choices or in additionalNotesObj + exact_mappings: + - schema:value + slot_uri: reproschema:value + multivalued: true + any_of: + - range: boolean + - range: decimal + - range: StructuredValue + - range: string + - range: langString + - range: uri +# value_from_schema: +# slot_uri: schema:value + valueType: + title: The type of the response + comments: + - The type of the response of an item. For example, string, integer, etc. + slot_uri: reproschema:valueType + multivalued: true + any_of: + - range: string + - range: langString + valueRequired: + slot_uri: schema:valueRequired + range: boolean + variableName: + title: variableName + comments: + - The name used to represent an item. + slot_uri: reproschema:variableName + version: + slot_uri: schema:version + video: + slot_uri: schema:video + range: VideoObject + wasAssociatedWith: + slot_uri: prov:wasAssociatedWith + range: SoftwareAgent + wasAttributedTo: + slot_uri: prov:wasAttributedTo + range: Participant +classes: + Activity: + title: Activity + comments: + - An assessment in a protocol. + is_a: CreativeWork + slots: + - about + - addProperties + - allow + - altLabel + - associatedMedia + - citation + - compute + - cronTable + - description + - image + - messages + - order + - overrideProperties + - preamble + - prefLabel + - schemaVersion + - shuffle + - ui + - version + class_uri: reproschema:Activity + AdditionalNoteObj: + title: Additional Notes Object + comments: + - 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 + slots: + - column + - source + - value + class_uri: reproschema:AdditionalNoteObj + AdditionalProperty: + title: Additional properties + comments: + - An object to describe the various properties added to assessments and fields. + slots: + - allow + - isAbout + - isVis + - limit + - maxRetakes + - prefLabel + - randomMaxDelay + - schedule + - valueRequired + - variableName + class_uri: reproschema:AdditionalProperty + Agent: + class_uri: prov:Agent + AllowExport: + title: Allow export + comments: + - Indicates (by boolean) if data can be exported or not. + class_uri: reproschema:AllowExport + AllowReplay: + title: Allow replay + comments: + - Indicates (by boolean) if items can be replayed or not. + class_uri: reproschema:AllowReplay + AutoAdvance: + title: Auto advance + comments: + - Indicates (by boolean) if assessments in a protocol can auto advance or not. + class_uri: reproschema:AutoAdvance + Choice: + title: Response choice + comments: + - An object to describe a response option. + slots: + - name + - image + - value #TODO it was schema:value +#TODO validator +# slot_usage: +# value_from_schema: +# any_of: #Ask Satra +# - range: Skipped +# - range: DontKnow + class_uri: reproschema:Choice + ComputeSpecification: + title: Compute Specification + comments: + - An object to define computations in an activity or protocol. + slots: + - jsExpression + - variableName + class_uri: reproschema:ComputeSpecification + CreativeWork: + class_uri: schema:CreativeWork + DisableBack: + title: Disable redo + comments: + - Indicates (by boolean) if we can go back to a completed assessment in a protocol. + class_uri: reproschema:DisableBack + DontKnow: + title: Do not know + comments: + - An element to describe the choice when response is not known. + class_uri: reproschema:DontKnow + Field: #TODO: multiple @type in reproschema + title: Field + comments: + - An item in an assessment. + is_a: CreativeWork + slots: + - about + - additionalNotesObj + - altLabel + - associatedMedia + - audio + - description + - image + - inputType + - isPartOf + - preamble + - prefLabel + - question + - readonlyValue + - responseOptions + - schemaVersion + - ui + - version + - video + class_uri: reproschema:Field + LandingPage: + title: Landing Page + comments: + - An object to define the landing page of a protocol. + slots: + - inLanguage + class_uri: reproschema:LandingPage + langString: + class_uri: rdf:langString + MediaObject: + title: Media Object + comments: + - TODO comments + class_uri: schema:MediaObject + slots: + - contentUrl + - inLanguage + slot_usage: + contentUrl: + required: true + MessageSpecification: + title: Message Specification + comments: + - An object to define messages in an activity or protocol. + slots: + - jsExpression + - message + class_uri: reproschema:MessageSpecification + OverrideProperty: + title: Additional properties + comments: + - An object to override the various properties added to assessments and fields. + slots: + - isAbout + - isVis + - limit + - maxRetakes + - prefLabel + - randomMaxDelay + - schedule + - valueRequired + - variableName + class_uri: reproschema:OverrideProperty + Participant: + title: Participant + comments: + - An Agent describing characteristics associated with a participant. + is_a: Agent + slots: + - subject_id + class_uri: reproschema:Participant + Protocol: # TODO multiple types + title: Protocol + comments: + - A representation of a study which comprises one or more assessments. + is_a: CreativeWork + slots: + - about + - addProperties + - allow + - altLabel + - associatedMedia + - compute + - cronTable + - description + - landingPage + - messages + - order + - overrideProperties + - prefLabel + - schemaVersion + - shuffle + - ui + - version + class_uri: reproschema:Protocol + Response: # multiple types + title: Response + comments: + - Describes the response of an item. + is_a: CreativeWork + slots: + - isAbout + - ui + - value #TODO it was schema:value + - wasAttributedTo + slot_usage: + value: + any_of: + - range: Skipped + - range: DontKnow + - range: decimal + - range: boolean + - range: string + - range: uri + - range: StructuredValue + class_uri: reproschema:Response + ResponseActivity: # multiple types + title: ResponseActivity + comments: + - Captures information about some action that took place. It also links to information + (entities) that were used during the activity + is_a: CreativeWork + slots: + - endedAtTime + - generated + - inLanguage + - startedAtTime + - used + - wasAssociatedWith + class_uri: reproschema:ResponseActivity + ResponseOption: + title: Response option + comments: + - An element (object or by URL)to describe the properties of response of the Field + item. + slots: + - choices + - datumType + - maxValue + - minValue + - multipleChoice + - unitOptions + - valueType + class_uri: reproschema:ResponseOption + Schedule: + title: Schedule + comments: + - An object to define the schedule of an activity or protocol. #TODO can't find it in the schema + class_uri: reproschema:Schedule + Skipped: + title: Skipped + comments: + - An element to describe the choice when the item is skipped. + class_uri: reproschema:Skipped + SoftwareAgent: # TODO multiple types + title: Software Agent + comments: + - Captures information about some action that took place. It also links to information + (entities) that were used during the activity + slots: + - version + - url + class_uri: reproschema:SoftwareAgent + StructuredValue: + class_uri: schema:StructuredValue + + Thing: # todo should we switch + class_uri: schema:Thing + TimedOut: + title: Response timed out + comments: + - A boolean element to describe if the response did not occur within the prescribed + time. + class_uri: reproschema:TimedOut + UI: + title: todo + comments: + - todo + slots: + - order + - addProperties + - overrideProperties + - message + - shuffle + - inputType + - readonlyValue + - allow + #- requiredValue # should be valueRequired + - valueRequired + # - delay todo: never used, meaning? type? + # - timer never used + #- inputOptions todo never used + + UnitOption: + title: Unit options + comments: + - An object to represent a human displayable name alongside the more formal value + for units. + slots: + - prefLabel + - value + slot_usage: + value: + any_of: + - range: uri + - range: string + class_uri: reproschema:UnitOption + + VideoObject: + title: Video Object + class_uri: schema:VideoObject + slots: + - contentUrl + - inLanguage + slot_usage: + contentUrl: + required: true From cd233a6f6f24481727006b9aacdebd1aca8bd3fd Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Tue, 13 Feb 2024 08:38:25 -0500 Subject: [PATCH 02/34] =?UTF-8?q?removing=20some=20unnecessary=C2=A0any=5F?= =?UTF-8?q?of;=20regenerate=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contexts/reproschema_new | 11 ++++++++++- linkml-schema/reproschema.yaml | 24 ++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 1245533e3b..f46ee4e82d 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -1,7 +1,7 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2024-02-01T19:27:43", + "generation_date": "2024-02-13T08:28:10", "source": "reproschema.yaml" }, "@context": { @@ -27,9 +27,11 @@ "@id": "reproschema:additionalNotesObj" }, "addProperties": { + "@type": "@id", "@id": "reproschema:addProperties" }, "allow": { + "@type": "@id", "@id": "reproschema:allow" }, "altLabel": { @@ -91,6 +93,7 @@ "@id": "reproschema:isAbout" }, "isPartOf": { + "@type": "@id", "@id": "schema:isPartOf" }, "isVis": { @@ -116,12 +119,14 @@ "@container": "@language" }, "messages": { + "@type": "@id", "@id": "reproschema:messages" }, "minValue": { "@id": "schema:minValue" }, "multipleChoice": { + "@type": "xsd:boolean", "@id": "reproschema:multipleChoice" }, "name": { @@ -132,6 +137,7 @@ "@id": "reproschema:order" }, "overrideProperties": { + "@type": "@id", "@id": "reproschema:overrideProperties" }, "preamble": { @@ -150,6 +156,7 @@ "@id": "reproschema:randomMaxDelay" }, "readonlyValue": { + "@type": "xsd:boolean", "@id": "schema:readonlyValue" }, "responseOptions": { @@ -162,6 +169,7 @@ "@id": "schema:schemaVersion" }, "shuffle": { + "@type": "xsd:boolean", "@id": "reproschema:shuffle" }, "source": { @@ -182,6 +190,7 @@ "@id": "reproschema:ui" }, "unitOptions": { + "@type": "@id", "@id": "reproschema:unitOptions" }, "url": { diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index bccd378554..758e53ee9a 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -27,8 +27,7 @@ slots: and fields. slot_uri: reproschema:addProperties multivalued: true - any_of: - - range: AdditionalProperty + range: AdditionalProperty additionalNotesObj: title: additional notes comments: @@ -44,8 +43,7 @@ slots: - 'An array of items indicating properties allowed on an activity or protocol ' slot_uri: reproschema:allow multivalued: true - any_of: - - range: Thing + range: Thing altLabel: title: alternate label comments: @@ -149,8 +147,7 @@ slots: - range: Field isPartOf: slot_uri: schema:isPartOf - any_of: - - range: Activity + range: Activity isVis: title: visibility comments: @@ -211,8 +208,7 @@ slots: - An array of objects to define conditional messages in an activity or protocol. slot_uri: reproschema:messages multivalued: true - any_of: - - range: MessageSpecification + range: MessageSpecification minValue: slot_uri: schema:minValue any_of: @@ -223,8 +219,7 @@ slots: comments: - Indicates (by bool) if response for the Field item has one or more answer. slot_uri: reproschema:multipleChoice - any_of: - - range: boolean + range: boolean name: multivalued: true any_of: @@ -249,8 +244,7 @@ slots: and fields. slot_uri: reproschema:overrideProperties multivalued: true - any_of: - - range: OverrideProperty + range: OverrideProperty preamble: title: Preamble comments: @@ -312,8 +306,7 @@ slots: comments: - An element (bool) to determine if the list of items is shuffled or in order. slot_uri: reproschema:shuffle - any_of: - - range: boolean + range: boolean source: title: source comments: @@ -347,8 +340,7 @@ slots: value for units. slot_uri: reproschema:unitOptions multivalued: true - any_of: - - range: UnitOption + range: UnitOption url: slot_uri: schema:url used: From 62bc4a841da8c64b46383b614f9f389958e75d5c Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 16 Feb 2024 15:46:31 -0500 Subject: [PATCH 03/34] changing comments to description; fixing types (string vs langString) and adding @language:en to context; bringing back imageUrl; splitting UI class to multiple classes for UI for Activity, Field and Protocol --- contexts/reproschema_new | 34 +- examples/activities/items/item2.jsonld | 2 +- linkml-schema/reproschema-shacl.ttl | 858 ++++++++++++++----------- linkml-schema/reproschema.py | 358 ++++++----- linkml-schema/reproschema.yaml | 238 +++---- 5 files changed, 855 insertions(+), 635 deletions(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index f46ee4e82d..745fa245d6 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -1,7 +1,7 @@ { "comments": { "description": "Auto generated by LinkML jsonld context generator", - "generation_date": "2024-02-13T08:28:10", + "generation_date": "2024-02-16T13:37:16", "source": "reproschema.yaml" }, "@context": { @@ -20,6 +20,8 @@ }, "xsd": "http://www.w3.org/2001/XMLSchema#", "@vocab": "http://example.org/example/", + "@version": 1.1, + "@language": "en", "about": { "@id": "schema:about" }, @@ -53,7 +55,8 @@ "@container": "@language" }, "column": { - "@id": "reproschema:column" + "@id": "reproschema:column", + "@type": "xsd:string" }, "compute": { "@id": "reproschema:compute" @@ -83,13 +86,19 @@ "@type": "@id", "@id": "schema:image" }, + "imageUrl": { + "@type": "@id", + "@id": "reproschema:imageUrl" + }, "inLanguage": { "@id": "schema:inLanguage" }, "inputType": { - "@id": "reproschema:inputType" + "@id": "reproschema:inputType", + "@type": "xsd:string" }, "isAbout": { + "@type": "@id", "@id": "reproschema:isAbout" }, "isPartOf": { @@ -103,6 +112,7 @@ "@id": "reproschema:jsExpression" }, "landingPage": { + "@type": "@id", "@id": "reproschema:landingPage" }, "limit": { @@ -134,6 +144,7 @@ "@container": "@language" }, "order": { + "@type": "@id", "@id": "reproschema:order" }, "overrideProperties": { @@ -160,6 +171,7 @@ "@id": "schema:readonlyValue" }, "responseOptions": { + "@type": "@id", "@id": "reproschema:responseOptions" }, "schedule": { @@ -173,7 +185,8 @@ "@id": "reproschema:shuffle" }, "source": { - "@id": "reproschema:source" + "@id": "reproschema:source", + "@type": "xsd:string" }, "startedAtTime": { "@type": "xsd:dateTime", @@ -194,9 +207,11 @@ "@id": "reproschema:unitOptions" }, "url": { + "@type": "@id", "@id": "schema:url" }, "used": { + "@type": "@id", "@id": "prov:used" }, "value": { @@ -207,6 +222,7 @@ "@id": "schema:valueRequired" }, "valueType": { + "@type": "@id", "@id": "reproschema:valueType" }, "variableName": { @@ -314,8 +330,14 @@ "TimedOut": { "@id": "reproschema:TimedOut" }, - "UI": { - "@id": "http://example.org/example/UI" + "UiActivity": { + "@id": "http://example.org/example/UiActivity" + }, + "UiField": { + "@id": "http://example.org/example/UiField" + }, + "UiProtocol": { + "@id": "http://example.org/example/UiProtocol" }, "UnitOption": { "@id": "reproschema:UnitOption" diff --git a/examples/activities/items/item2.jsonld b/examples/activities/items/item2.jsonld index dbaa7a2704..bfcfedd540 100644 --- a/examples/activities/items/item2.jsonld +++ b/examples/activities/items/item2.jsonld @@ -14,7 +14,7 @@ "@type": "VideoObject", "contentUrl": "http://media.freesound.org/data/0/previews/719__elmomo__12oclock_girona_preview.mp4" }, - "image": "http://example.com/sample-image.jpg", + "imageUrl": "http://example.com/sample-image.jpg", "ui": { "inputType": "float" }, diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl index adac08be4b..6ea114bbe9 100644 --- a/linkml-schema/reproschema-shacl.ttl +++ b/linkml-schema/reproschema-shacl.ttl @@ -15,175 +15,178 @@ schema1:CreativeWork a sh:NodeShape ; schema1:MediaObject a sh:NodeShape ; sh:closed true ; + sh:description "['TODO comments']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Media Object" ; sh:property [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; sh:path schema1:contentUrl ], - [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + [ sh:datatype rdf:langString ; + sh:order 1 ; sh:path schema1:inLanguage ] ; sh:targetClass schema1:MediaObject . reproschema:AllowExport a sh:NodeShape ; sh:closed true ; + sh:description "['Indicates (by boolean) if data can be exported or not.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Allow export" ; sh:targetClass reproschema:AllowExport . reproschema:AllowReplay a sh:NodeShape ; sh:closed true ; + sh:description "['Indicates (by boolean) if items can be replayed or not.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Allow replay" ; sh:targetClass reproschema:AllowReplay . reproschema:AutoAdvance a sh:NodeShape ; sh:closed true ; + sh:description "['Indicates (by boolean) if assessments in a protocol can auto advance or not.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Auto advance" ; sh:targetClass reproschema:AutoAdvance . reproschema:DisableBack a sh:NodeShape ; sh:closed true ; + sh:description "['Indicates (by boolean) if we can go back to a completed assessment in a protocol.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Disable redo" ; sh:targetClass reproschema:DisableBack . reproschema:Protocol a sh:NodeShape ; sh:closed true ; + sh:description "['A representation of a study which comprises one or more assessments.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Protocol" ; - sh:property [ sh:name "computation" ; - sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; - sh:order 5 ; - sh:path reproschema:compute ], + sh:property [ sh:description "['An element (by URL) to point to the protocol readme or landing page.']" ; + sh:maxCount 1 ; + sh:name "Landing page content" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] [ sh:node reproschema:LandingPage ] ) ; + sh:order 6 ; + sh:path reproschema:landingPage ], + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:order 8 ; + sh:path skos:prefLabel ], [ sh:datatype xsd:string ; + sh:description "['The subject matter of the Field.']" ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:about ], [ sh:datatype xsd:string ; + sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:schemaVersion ], - [ sh:name "allow" ; - sh:or ( [ sh:node schema1:Thing ] ) ; + sh:name "associatedMedia" ; sh:order 2 ; - sh:path reproschema:allow ], - [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 12 ; - sh:path skos:prefLabel ], + sh:path schema1:associatedMedia ], [ sh:datatype xsd:string ; + sh:description "['TODO not described in reproschema']" ; sh:maxCount 1 ; sh:name "cronTable" ; - sh:order 6 ; - sh:path reproschema:cronTable ], - [ sh:name "overrideProperties" ; - sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; - sh:order 11 ; - sh:path reproschema:overrideProperties ], - [ sh:name "addProperties" ; - sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; - sh:order 1 ; - sh:path reproschema:addProperties ], - [ sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:or ( [ sh:datatype xsd:boolean ] ) ; - sh:order 14 ; - sh:path reproschema:shuffle ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; sh:order 4 ; - sh:path schema1:associatedMedia ], - [ sh:name "Order" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 10 ; - sh:path reproschema:order ], - [ sh:name "messages" ; - sh:or ( [ sh:node reproschema:MessageSpecification ] ) ; - sh:order 9 ; - sh:path reproschema:messages ], - [ sh:node ; + sh:path reproschema:cronTable ], + [ sh:description "['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. ']" ; + sh:name "computation" ; + sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; + sh:order 3 ; + sh:path reproschema:compute ], + [ sh:datatype rdf:langString ; sh:maxCount 1 ; - sh:name "UI" ; - sh:order 15 ; - sh:path reproschema:ui ], - [ sh:datatype xsd:string ; + + sh:order 5 ; + sh:path schema1:description ], + [ sh:datatype rdf:langString ; sh:maxCount 1 ; - sh:order 16 ; + + sh:order 11 ; sh:path schema1:version ], [ sh:datatype xsd:string ; + sh:description "['The alternate label.']" ; sh:maxCount 1 ; sh:name "alternate label" ; - sh:order 3 ; + sh:order 1 ; sh:path skos:altLabel ], - [ sh:datatype xsd:string ; + [ sh:node reproschema:UiProtocol ; + sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; sh:maxCount 1 ; + sh:name "UI" ; + + sh:order 10 ; + sh:path reproschema:ui ], + [ sh:node reproschema:MessageSpecification ; + sh:description "['An array of objects to define conditional messages in an activity or protocol.']" ; + sh:name "messages" ; + sh:order 7 ; - sh:path schema1:description ], - [ sh:maxCount 1 ; - sh:name "Landing page content" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] [ sh:node reproschema:LandingPage ] ) ; - sh:order 8 ; - sh:path reproschema:landingPage ] ; + sh:path reproschema:messages ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + + sh:order 9 ; + sh:path schema1:schemaVersion ] ; sh:targetClass reproschema:Protocol . reproschema:Response a sh:NodeShape ; sh:closed true ; + sh:description "['Describes the response of an item.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response" ; - sh:property [ sh:node ; + sh:property [ sh:description "['A pointer to the node describing the item.']" ; sh:maxCount 1 ; - sh:name "UI" ; - sh:order 1 ; - sh:path reproschema:ui ], - [ sh:maxCount 1 ; sh:name "isAbout" ; sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; sh:order 0 ; sh:path reproschema:isAbout ], + [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; + sh:name "value" ; + sh:or ( [ sh:node reproschema:Skipped ] [ sh:node reproschema:DontKnow ] [ sh:datatype xsd:decimal ] [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] [ sh:node schema1:StructuredValue ] ) ; + sh:order 1 ; + sh:path reproschema:value ], [ sh:node reproschema:Participant ; sh:maxCount 1 ; - sh:order 3 ; - sh:path prov:wasAttributedTo ], - [ sh:name "value" ; - sh:or ( [ sh:node reproschema:Skipped ] [ sh:node reproschema:DontKnow ] [ sh:datatype xsd:decimal ] [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] [ sh:node schema1:StructuredValue ] ) ; + sh:order 2 ; - sh:path reproschema:value ] ; + sh:path prov:wasAttributedTo ] ; sh:targetClass reproschema:Response . reproschema:ResponseActivity a sh:NodeShape ; sh:closed true ; + sh:description "['Captures information about some action that took place. It also links to information (entities) that were used during the activity']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "ResponseActivity" ; - sh:property [ sh:datatype xsd:string ; - sh:order 4 ; - sh:path prov:used ], + sh:property [ sh:datatype rdf:langString ; + + sh:order 2 ; + sh:path schema1:inLanguage ], [ sh:node reproschema:SoftwareAgent ; sh:maxCount 1 ; + sh:order 5 ; sh:path prov:wasAssociatedWith ], - [ sh:datatype xsd:string ; + [ sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path prov:startedAtTime ], + [ sh:nodeKind sh:IRI ; + sh:order 4 ; + sh:path prov:used ], + [ sh:datatype rdf:langString ; sh:maxCount 1 ; sh:order 1 ; sh:path prov:generated ], - [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 2 ; - sh:path schema1:inLanguage ], [ sh:datatype xsd:dateTime ; sh:maxCount 1 ; sh:order 0 ; - sh:path prov:endedAtTime ], - [ sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path prov:startedAtTime ] ; + sh:path prov:endedAtTime ] ; sh:targetClass reproschema:ResponseActivity . reproschema:TimedOut a sh:NodeShape ; sh:closed true ; + sh:description "['A boolean element to describe if the response did not occur within the prescribed time.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response timed out" ; sh:targetClass reproschema:TimedOut . @@ -197,7 +200,8 @@ schema1:VideoObject a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:name "Video Object" ; - sh:property [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:property [ sh:datatype rdf:langString ; + sh:order 1 ; sh:path schema1:inLanguage ], [ sh:maxCount 1 ; @@ -208,321 +212,430 @@ schema1:VideoObject a sh:NodeShape ; reproschema:AdditionalNoteObj a sh:NodeShape ; sh:closed true ; + sh:description "['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']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional Notes Object" ; - sh:property [ sh:name "column" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:property [ sh:datatype xsd:string ; + sh:description "['An element to define the source (eg. RedCap, NDA) where the note was taken from.']" ; + sh:name "source" ; + sh:order 1 ; + sh:path reproschema:source ], + [ sh:datatype xsd:string ; + sh:description "['An element to define the column name where the note was taken from.']" ; + sh:name "column" ; sh:order 0 ; sh:path reproschema:column ], - [ sh:name "value" ; + [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; + sh:name "value" ; sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; sh:order 2 ; - sh:path reproschema:value ], - [ sh:name "source" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 1 ; - sh:path reproschema:source ] ; + sh:path reproschema:value ] ; sh:targetClass reproschema:AdditionalNoteObj . reproschema:Choice a sh:NodeShape ; sh:closed true ; + sh:description "['An object to describe a response option.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response choice" ; - sh:property [ sh:maxCount 1 ; - sh:name "image" ; - sh:order 1 ; - sh:path schema1:image ], - [ sh:name "value" ; + sh:property [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; + sh:name "value" ; sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; sh:order 2 ; sh:path reproschema:value ], - [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + [ sh:datatype rdf:langString ; + sh:order 0 ; - sh:path schema1:name ] ; + sh:path schema1:name ], + [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; + sh:maxCount 1 ; + sh:name "image" ; + sh:order 1 ; + sh:path schema1:image ] ; sh:targetClass reproschema:Choice . reproschema:DontKnow a sh:NodeShape ; sh:closed true ; + sh:description "['An element to describe the choice when response is not known.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Do not know" ; sh:targetClass reproschema:DontKnow . reproschema:LandingPage a sh:NodeShape ; sh:closed true ; + sh:description "['An object to define the landing page of a protocol.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Landing Page" ; - sh:property [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:property [ sh:datatype rdf:langString ; + sh:order 0 ; sh:path schema1:inLanguage ] ; sh:targetClass reproschema:LandingPage . reproschema:Participant a sh:NodeShape ; sh:closed true ; + sh:description "['An Agent describing characteristics associated with a participant.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Participant" ; - sh:property [ sh:datatype xsd:string ; + sh:property [ sh:datatype rdf:langString ; sh:maxCount 1 ; + sh:order 0 ; sh:path nidm:subject_id ] ; sh:targetClass reproschema:Participant . reproschema:ResponseOption a sh:NodeShape ; sh:closed true ; + sh:description "['An element (object or by URL)to describe the properties of response of the Field item.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response option" ; - sh:property [ sh:maxCount 1 ; + sh:property [ sh:datatype xsd:boolean ; + sh:description "['Indicates (by bool) if response for the Field item has one or more answer.']" ; + sh:maxCount 1 ; + sh:name "Multiple choice response expectation" ; + sh:order 4 ; + sh:path reproschema:multipleChoice ], + [ sh:node reproschema:UnitOption ; + sh:description "['A list of objects to represent a human displayable name alongside the more formal value for units.']" ; + sh:name "unitOptions" ; + + sh:order 5 ; + sh:path reproschema:unitOptions ], + [ sh:description "['An array to list the available options for response of the Field item.']" ; + sh:name "choices" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Choice ] ) ; + sh:order 0 ; + sh:path reproschema:choices ], + [ sh:nodeKind sh:IRI ; + sh:description "['The type of the response of an item. For example, string, integer, etc.']" ; + sh:name "The type of the response" ; + sh:order 6 ; + sh:path reproschema:valueType ], + [ sh:description "['Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item.']" ; + sh:maxCount 1 ; sh:name "datumType" ; sh:or ( [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] ) ; sh:order 1 ; sh:path reproschema:datumType ], - [ sh:name "The type of the response" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 6 ; - sh:path reproschema:valueType ], - [ sh:maxCount 1 ; - sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; - sh:order 3 ; - sh:path schema1:minValue ], - [ sh:name "unitOptions" ; - sh:or ( [ sh:node reproschema:UnitOption ] ) ; - sh:order 5 ; - sh:path reproschema:unitOptions ], [ sh:maxCount 1 ; sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; sh:order 2 ; sh:path schema1:maxValue ], - [ sh:name "choices" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Choice ] ) ; - sh:order 0 ; - sh:path reproschema:choices ], [ sh:maxCount 1 ; - sh:name "Multiple choice response expectation" ; - sh:or ( [ sh:datatype xsd:boolean ] ) ; - sh:order 4 ; - sh:path reproschema:multipleChoice ] ; + sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; + sh:order 3 ; + sh:path schema1:minValue ] ; sh:targetClass reproschema:ResponseOption . reproschema:Skipped a sh:NodeShape ; sh:closed true ; + sh:description "['An element to describe the choice when the item is skipped.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Skipped" ; sh:targetClass reproschema:Skipped . reproschema:SoftwareAgent a sh:NodeShape ; sh:closed true ; + sh:description "['Captures information about some action that took place. It also links to information (entities) that were used during the activity']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Software Agent" ; - sh:property [ sh:datatype xsd:string ; + sh:property [ sh:nodeKind sh:IRI ; sh:maxCount 1 ; sh:order 1 ; sh:path schema1:url ], - [ sh:datatype xsd:string ; + [ sh:datatype rdf:langString ; sh:maxCount 1 ; + sh:order 0 ; sh:path schema1:version ] ; sh:targetClass reproschema:SoftwareAgent . -reproschema:UnitOption a sh:NodeShape ; +reproschema:UiActivity a sh:NodeShape ; sh:closed true ; + sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Unit options" ; - sh:property [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:name "todo" ; + sh:property [ sh:node schema1:Thing ; + sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; + sh:name "allow" ; + + sh:order 4 ; + sh:path reproschema:allow ], + [ sh:description "['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']" ; + sh:name "Order" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; sh:order 0 ; - sh:path skos:prefLabel ], - [ sh:name "value" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] ) ; + sh:path reproschema:order ], + [ sh:node reproschema:OverrideProperty ; + sh:description "['An array of objects to override the various properties added to assessments and fields.']" ; + sh:name "overrideProperties" ; + + sh:order 2 ; + sh:path reproschema:overrideProperties ], + [ sh:node reproschema:AdditionalProperty ; + sh:description "['An array of objects to describe the various properties added to assessments and fields.']" ; + sh:name "addProperties" ; + sh:order 1 ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:UnitOption . + sh:path reproschema:addProperties ], + [ sh:datatype xsd:boolean ; + sh:description "['An element (bool) to determine if the list of items is shuffled or in order.']" ; + sh:maxCount 1 ; + sh:name "Shuffle" ; + sh:order 3 ; + sh:path reproschema:shuffle ] ; + sh:targetClass reproschema:UiActivity . -reproschema:ComputeSpecification a sh:NodeShape ; +reproschema:UiField a sh:NodeShape ; sh:closed true ; + sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Compute Specification" ; - sh:property [ sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; - sh:order 0 ; - sh:path reproschema:jsExpression ], - [ sh:datatype xsd:string ; + sh:name "todo" ; + sh:property [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:name "variableName" ; sh:order 1 ; - sh:path reproschema:variableName ] ; - sh:targetClass reproschema:ComputeSpecification . + sh:path schema1:readonlyValue ], + [ sh:datatype xsd:string ; + sh:description "['An element to describe the input type of a Field item.']" ; + sh:maxCount 1 ; + sh:name "inputType" ; + sh:order 0 ; + sh:path reproschema:inputType ] ; + sh:targetClass reproschema:UiField . -reproschema:MessageSpecification a sh:NodeShape ; +reproschema:UiProtocol a sh:NodeShape ; sh:closed true ; + sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Message Specification" ; - sh:property [ sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:name "todo" ; + sh:property [ sh:node schema1:Thing ; + sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; + sh:name "allow" ; + + sh:order 4 ; + sh:path reproschema:allow ], + [ sh:node reproschema:OverrideProperty ; + sh:description "['An array of objects to override the various properties added to assessments and fields.']" ; + sh:name "overrideProperties" ; + + sh:order 2 ; + sh:path reproschema:overrideProperties ], + [ sh:description "['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']" ; + sh:name "Order" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; sh:order 0 ; - sh:path reproschema:jsExpression ], - [ sh:name "Message" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:path reproschema:order ], + [ sh:node reproschema:AdditionalProperty ; + sh:description "['An array of objects to describe the various properties added to assessments and fields.']" ; + sh:name "addProperties" ; + sh:order 1 ; - sh:path reproschema:message ] ; - sh:targetClass reproschema:MessageSpecification . - -reproschema:Schedule a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Schedule" ; - sh:targetClass reproschema:Schedule . + sh:path reproschema:addProperties ], + [ sh:datatype xsd:boolean ; + sh:description "['An element (bool) to determine if the list of items is shuffled or in order.']" ; + sh:maxCount 1 ; + sh:name "Shuffle" ; + sh:order 3 ; + sh:path reproschema:shuffle ] ; + sh:targetClass reproschema:UiProtocol . -schema1:StructuredValue a sh:NodeShape ; +reproschema:UnitOption a sh:NodeShape ; sh:closed true ; + sh:description "['An object to represent a human displayable name alongside the more formal value for units.']" ; sh:ignoredProperties ( rdf:type ) ; - sh:targetClass schema1:StructuredValue . + sh:name "Unit options" ; + sh:property [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; + sh:name "value" ; + sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype rdf:langString ] ) ; + sh:order 1 ; + sh:path reproschema:value ], + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + + sh:order 0 ; + sh:path skos:prefLabel ] ; + sh:targetClass reproschema:UnitOption . reproschema:AdditionalProperty a sh:NodeShape ; sh:closed true ; + sh:description "['An object to describe the various properties added to assessments and fields.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 5 ; - sh:path skos:prefLabel ], - [ sh:maxCount 1 ; - sh:name "Schedule" ; - sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; - sh:order 7 ; - sh:path reproschema:schedule ], + sh:property [ sh:description "['A pointer to the node describing the item.']" ; + sh:maxCount 1 ; + sh:name "isAbout" ; + sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; + sh:order 1 ; + sh:path reproschema:isAbout ], + [ sh:datatype rdf:langString ; + sh:description "['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']" ; + sh:maxCount 1 ; + sh:name "limit" ; + + sh:order 3 ; + sh:path reproschema:limit ], [ sh:datatype xsd:boolean ; sh:maxCount 1 ; sh:order 8 ; sh:path schema1:valueRequired ], - [ sh:name "allow" ; - sh:or ( [ sh:node schema1:Thing ] ) ; + [ sh:node schema1:Thing ; + sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; + sh:name "allow" ; + sh:order 0 ; sh:path reproschema:allow ], - [ sh:maxCount 1 ; - sh:name "visibility" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; - sh:order 2 ; - sh:path reproschema:isVis ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:name "variableName" ; - sh:order 9 ; - sh:path reproschema:variableName ], - [ sh:datatype xsd:string ; + [ sh:datatype rdf:langString ; + sh:description "['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']" ; sh:maxCount 1 ; sh:name "randomMaxDelay" ; + sh:order 6 ; sh:path reproschema:randomMaxDelay ], - [ sh:maxCount 1 ; - sh:name "isAbout" ; - sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 1 ; - sh:path reproschema:isAbout ], - [ sh:datatype xsd:string ; + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + + sh:order 5 ; + sh:path skos:prefLabel ], + [ sh:description "['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']" ; + sh:maxCount 1 ; + sh:name "Schedule" ; + sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; + sh:order 7 ; + sh:path reproschema:schedule ], + [ sh:datatype rdf:langString ; + sh:description "['The name used to represent an item.']" ; + sh:maxCount 1 ; + sh:name "variableName" ; + + sh:order 9 ; + sh:path reproschema:variableName ], + [ sh:description "['Defines number of times the item is allowed to be redone.']" ; sh:maxCount 1 ; - sh:name "limit" ; - sh:order 3 ; - sh:path reproschema:limit ], - [ sh:maxCount 1 ; sh:name "maxRetakes" ; sh:or ( [ sh:datatype xsd:decimal ] ) ; sh:order 4 ; - sh:path reproschema:maxRetakes ] ; + sh:path reproschema:maxRetakes ], + [ sh:description "['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']" ; + sh:maxCount 1 ; + sh:name "visibility" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 2 ; + sh:path reproschema:isVis ] ; sh:targetClass reproschema:AdditionalProperty . +reproschema:ComputeSpecification a sh:NodeShape ; + sh:closed true ; + sh:description "['An object to define computations in an activity or protocol.']" ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Compute Specification" ; + sh:property [ sh:datatype rdf:langString ; + sh:description "['The name used to represent an item.']" ; + sh:maxCount 1 ; + sh:name "variableName" ; + + sh:order 1 ; + sh:path reproschema:variableName ], + [ sh:description "['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']" ; + sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path reproschema:jsExpression ] ; + sh:targetClass reproschema:ComputeSpecification . + +reproschema:MessageSpecification a sh:NodeShape ; + sh:closed true ; + sh:description "['An object to define messages in an activity or protocol.']" ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Message Specification" ; + sh:property [ sh:description "['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']" ; + sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype rdf:langString ] ) ; + sh:order 0 ; + sh:path reproschema:jsExpression ], + [ sh:datatype rdf:langString ; + sh:description "['The message to be conditionally displayed for an item. ']" ; + sh:name "Message" ; + + sh:order 1 ; + sh:path reproschema:message ] ; + sh:targetClass reproschema:MessageSpecification . + reproschema:OverrideProperty a sh:NodeShape ; sh:closed true ; + sh:description "['An object to override the various properties added to assessments and fields.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:maxCount 1 ; + sh:property [ sh:datatype rdf:langString ; + sh:description "['The name used to represent an item.']" ; + sh:maxCount 1 ; + sh:name "variableName" ; + + sh:order 8 ; + sh:path reproschema:variableName ], + [ sh:description "['Defines number of times the item is allowed to be redone.']" ; + sh:maxCount 1 ; sh:name "maxRetakes" ; sh:or ( [ sh:datatype xsd:decimal ] ) ; sh:order 3 ; sh:path reproschema:maxRetakes ], - [ sh:maxCount 1 ; - sh:name "visibility" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; - sh:order 1 ; - sh:path reproschema:isVis ], - [ sh:datatype xsd:boolean ; + [ sh:datatype rdf:langString ; + sh:description "['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']" ; sh:maxCount 1 ; - sh:order 7 ; - sh:path schema1:valueRequired ], - [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 4 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; + sh:name "limit" ; + + sh:order 2 ; + sh:path reproschema:limit ], + [ sh:datatype rdf:langString ; + sh:description "['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']" ; sh:maxCount 1 ; sh:name "randomMaxDelay" ; + sh:order 5 ; sh:path reproschema:randomMaxDelay ], - [ sh:datatype xsd:string ; + [ sh:description "['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']" ; + sh:maxCount 1 ; + sh:name "visibility" ; + sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; + sh:order 1 ; + sh:path reproschema:isVis ], + [ sh:description "['A pointer to the node describing the item.']" ; sh:maxCount 1 ; - sh:name "limit" ; - sh:order 2 ; - sh:path reproschema:limit ], - [ sh:maxCount 1 ; - sh:name "Schedule" ; - sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; - sh:order 6 ; - sh:path reproschema:schedule ], - [ sh:maxCount 1 ; sh:name "isAbout" ; sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; sh:order 0 ; sh:path reproschema:isAbout ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:name "variableName" ; - sh:order 8 ; - sh:path reproschema:variableName ] ; - sh:targetClass reproschema:OverrideProperty . - - a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "todo" ; - sh:property [ sh:datatype xsd:boolean ; + [ sh:description "['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']" ; sh:maxCount 1 ; + sh:name "Schedule" ; + sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; sh:order 6 ; - sh:path schema1:readonlyValue ], - [ sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:or ( [ sh:datatype xsd:boolean ] ) ; - sh:order 4 ; - sh:path reproschema:shuffle ], - [ sh:name "addProperties" ; - sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; - sh:order 1 ; - sh:path reproschema:addProperties ], + sh:path reproschema:schedule ], [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:order 8 ; - sh:path schema1:valueRequired ], - [ sh:name "Order" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 0 ; - sh:path reproschema:order ], - [ sh:name "overrideProperties" ; - sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; - sh:order 2 ; - sh:path reproschema:overrideProperties ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:name "inputType" ; - sh:order 5 ; - sh:path reproschema:inputType ], - [ sh:name "Message" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 3 ; - sh:path reproschema:message ], - [ sh:name "allow" ; - sh:or ( [ sh:node schema1:Thing ] ) ; sh:order 7 ; - sh:path reproschema:allow ] ; - sh:targetClass . + sh:path schema1:valueRequired ], + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + + sh:order 4 ; + sh:path skos:prefLabel ] ; + sh:targetClass reproschema:OverrideProperty . + +reproschema:Schedule a sh:NodeShape ; + sh:closed true ; + sh:description "['An object to define the schedule of an activity or protocol.']" ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Schedule" ; + sh:targetClass reproschema:Schedule . + +schema1:StructuredValue a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:targetClass schema1:StructuredValue . schema1:Thing a sh:NodeShape ; sh:closed true ; @@ -531,171 +644,186 @@ schema1:Thing a sh:NodeShape ; reproschema:Field a sh:NodeShape ; sh:closed true ; + sh:description "['An item in an assessment.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Field" ; - sh:property [ sh:maxCount 1 ; - sh:or ( [ sh:node reproschema:Activity ] ) ; - sh:order 8 ; - sh:path schema1:isPartOf ], - [ sh:datatype xsd:string ; + sh:property [ sh:node schema1:VideoObject ; sh:maxCount 1 ; - sh:order 12 ; - sh:path schema1:readonlyValue ], + + sh:order 16 ; + sh:path schema1:video ], [ sh:datatype xsd:string ; + sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; sh:maxCount 1 ; sh:name "associatedMedia" ; sh:order 3 ; sh:path schema1:associatedMedia ], - [ sh:maxCount 1 ; + [ sh:description "['An element (object or by URL)to describe the properties of response of the Field item.']" ; + sh:maxCount 1 ; sh:name "Response options" ; sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:ResponseOption ] ) ; - sh:order 13 ; + sh:order 12 ; sh:path reproschema:responseOptions ], - [ sh:maxCount 1 ; + [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; + sh:maxCount 1 ; sh:name "image" ; sh:order 6 ; sh:path schema1:image ], - [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + [ sh:nodeKind sh:IRI ; + sh:description "['An image url.']" ; + sh:maxCount 1 ; + sh:name "imageUrl" ; + sh:order 7 ; + sh:path reproschema:imageUrl ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + + sh:order 13 ; + sh:path schema1:schemaVersion ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + + sh:order 15 ; + sh:path schema1:version ], + [ sh:datatype rdf:langString ; + sh:description "['The preamble for an assessment']" ; + sh:name "Preamble" ; + + sh:order 9 ; + sh:path reproschema:preamble ], + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:order 10 ; sh:path skos:prefLabel ], - [ sh:name "additional notes" ; - sh:or ( [ sh:node reproschema:AdditionalNoteObj ] ) ; - sh:order 1 ; - sh:path reproschema:additionalNotesObj ], - [ sh:maxCount 1 ; + [ sh:description "['TDOO']" ; + sh:maxCount 1 ; sh:name "audio" ; sh:order 4 ; sh:path schema1:audio ], - [ sh:node ; + [ sh:node reproschema:UiField ; + sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; sh:maxCount 1 ; sh:name "UI" ; - sh:order 15 ; + + sh:order 14 ; sh:path reproschema:ui ], [ sh:datatype xsd:string ; + sh:description "['The subject matter of the Field.']" ; sh:maxCount 1 ; - sh:order 16 ; - sh:path schema1:version ], + sh:order 0 ; + sh:path schema1:about ], [ sh:datatype xsd:string ; + sh:description "['The alternate label.']" ; sh:maxCount 1 ; sh:name "alternate label" ; sh:order 2 ; sh:path skos:altLabel ], - [ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + [ sh:datatype rdf:langString ; + sh:order 11 ; sh:path schema1:question ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:node schema1:VideoObject ; - sh:maxCount 1 ; - sh:order 17 ; - sh:path schema1:video ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 14 ; - sh:path schema1:schemaVersion ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:name "inputType" ; - sh:order 7 ; - sh:path reproschema:inputType ], - [ sh:name "Preamble" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 9 ; - sh:path reproschema:preamble ], - [ sh:datatype xsd:string ; + [ sh:datatype rdf:langString ; sh:maxCount 1 ; + sh:order 5 ; - sh:path schema1:description ] ; + sh:path schema1:description ], + [ sh:node reproschema:Activity ; + sh:maxCount 1 ; + + sh:order 8 ; + sh:path schema1:isPartOf ], + [ sh:description "['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.']" ; + sh:name "additional notes" ; + sh:or ( [ sh:node reproschema:AdditionalNoteObj ] ) ; + sh:order 1 ; + sh:path reproschema:additionalNotesObj ] ; sh:targetClass reproschema:Field . reproschema:Activity a sh:NodeShape ; sh:closed true ; + sh:description "['An assessment in a protocol.']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Activity" ; - sh:property [ sh:node ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:order 17 ; - sh:path reproschema:ui ], - [ sh:datatype xsd:string ; + sh:property [ sh:description "['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. ']" ; + sh:name "computation" ; + sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; + sh:order 4 ; + sh:path reproschema:compute ], + [ sh:datatype rdf:langString ; + sh:description "['The preamble for an assessment']" ; + sh:name "Preamble" ; + + sh:order 9 ; + sh:path reproschema:preamble ], + [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; sh:maxCount 1 ; - sh:order 5 ; - sh:path schema1:citation ], - [ sh:name "preferred label" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; - sh:order 14 ; - sh:path skos:prefLabel ], - [ sh:name "Order" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 11 ; - sh:path reproschema:order ], - [ sh:maxCount 1 ; sh:name "image" ; - sh:order 9 ; + sh:order 7 ; sh:path schema1:image ], - [ sh:name "overrideProperties" ; - sh:or ( [ sh:node reproschema:OverrideProperty ] ) ; - sh:order 12 ; - sh:path reproschema:overrideProperties ], [ sh:datatype xsd:string ; + sh:description "['The subject matter of the Field.']" ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:about ], - [ sh:name "computation" ; - sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; - sh:order 6 ; - sh:path reproschema:compute ], - [ sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:or ( [ sh:datatype xsd:boolean ] ) ; - sh:order 16 ; - sh:path reproschema:shuffle ], - [ sh:name "allow" ; - sh:or ( [ sh:node schema1:Thing ] ) ; - sh:order 2 ; - sh:path reproschema:allow ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 18 ; - sh:path schema1:version ], [ sh:datatype xsd:string ; + sh:description "['TODO not described in reproschema']" ; sh:maxCount 1 ; sh:name "cronTable" ; - sh:order 7 ; + sh:order 5 ; sh:path reproschema:cronTable ], - [ sh:datatype xsd:string ; + [ sh:datatype rdf:langString ; sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 4 ; - sh:path schema1:associatedMedia ], - [ sh:name "messages" ; - sh:or ( [ sh:node reproschema:MessageSpecification ] ) ; - sh:order 10 ; - sh:path reproschema:messages ], - [ sh:datatype xsd:string ; + + sh:order 3 ; + sh:path schema1:citation ], + [ sh:datatype rdf:langString ; sh:maxCount 1 ; - sh:order 15 ; - sh:path schema1:schemaVersion ], - [ sh:name "Preamble" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; + sh:order 13 ; - sh:path reproschema:preamble ], + sh:path schema1:version ], [ sh:datatype xsd:string ; + sh:description "['The alternate label.']" ; sh:maxCount 1 ; - sh:order 8 ; + sh:name "alternate label" ; + sh:order 1 ; + sh:path skos:altLabel ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + + sh:order 6 ; sh:path schema1:description ], + [ sh:node reproschema:UiActivity ; + sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; + sh:maxCount 1 ; + sh:name "UI" ; + + sh:order 12 ; + sh:path reproschema:ui ], + [ sh:datatype rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + + sh:order 10 ; + sh:path skos:prefLabel ], + [ sh:node reproschema:MessageSpecification ; + sh:description "['An array of objects to define conditional messages in an activity or protocol.']" ; + sh:name "messages" ; + + sh:order 8 ; + sh:path reproschema:messages ], + [ sh:datatype rdf:langString ; + sh:maxCount 1 ; + + sh:order 11 ; + sh:path schema1:schemaVersion ], [ sh:datatype xsd:string ; + sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 3 ; - sh:path skos:altLabel ], - [ sh:name "addProperties" ; - sh:or ( [ sh:node reproschema:AdditionalProperty ] ) ; - sh:order 1 ; - sh:path reproschema:addProperties ] ; + sh:name "associatedMedia" ; + sh:order 2 ; + sh:path schema1:associatedMedia ] ; sh:targetClass reproschema:Activity . rdf:langString a sh:NodeShape ; diff --git a/linkml-schema/reproschema.py b/linkml-schema/reproschema.py index 9d087baf58..279e070ad1 100644 --- a/linkml-schema/reproschema.py +++ b/linkml-schema/reproschema.py @@ -1,9 +1,10 @@ from __future__ import annotations from datetime import datetime, date +from decimal import Decimal from enum import Enum from typing import List, Dict, Optional, Any, Union -from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator +import pydantic as pyd import re import sys if sys.version_info >= (3, 8): @@ -15,8 +16,8 @@ metamodel_version = "None" version = "None" -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( +class ConfiguredBaseModel(pyd.BaseModel): + model_config = pyd.ConfigDict( validate_assignment=True, validate_default=True, extra = 'forbid', @@ -26,25 +27,29 @@ class ConfiguredBaseModel(BaseModel): class AdditionalNoteObj(ConfiguredBaseModel): - - column: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="column") - source: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="source") - value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") + """ + ['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'] + """ + column: Optional[List[str]] = pyd.Field(default_factory=list, title="column", description="""['An element to define the column name where the note was taken from.']""") + source: Optional[List[str]] = pyd.Field(default_factory=list, title="source", description="""['An element to define the source (eg. RedCap, NDA) where the note was taken from.']""") + value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") class AdditionalProperty(ConfiguredBaseModel): - - allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") - isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") - isVis: Optional[Union[bool, str]] = Field(None, title="visibility") - limit: Optional[str] = Field(None, title="limit") - maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay") - schedule: Optional[Union[Schedule, str]] = Field(None, title="Schedule") - valueRequired: Optional[bool] = Field(None) - variableName: Optional[str] = Field(None, title="variableName") + """ + ['An object to describe the various properties added to assessments and fields.'] + """ + allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") + isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") + isVis: Optional[Union[bool, str]] = pyd.Field(None, title="visibility", description="""['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']""") + limit: Optional[LangString] = pyd.Field(None, title="limit", description="""['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']""") + maxRetakes: Optional[Decimal] = pyd.Field(None, title="maxRetakes", description="""['Defines number of times the item is allowed to be redone.']""") + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + randomMaxDelay: Optional[LangString] = pyd.Field(None, title="randomMaxDelay", description="""['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']""") + schedule: Optional[Union[Schedule, str]] = pyd.Field(None, title="Schedule", description="""['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']""") + valueRequired: Optional[bool] = pyd.Field(None) + variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") @@ -55,35 +60,45 @@ class Agent(ConfiguredBaseModel): class AllowExport(ConfiguredBaseModel): - + """ + ['Indicates (by boolean) if data can be exported or not.'] + """ None class AllowReplay(ConfiguredBaseModel): - + """ + ['Indicates (by boolean) if items can be replayed or not.'] + """ None class AutoAdvance(ConfiguredBaseModel): - + """ + ['Indicates (by boolean) if assessments in a protocol can auto advance or not.'] + """ None class Choice(ConfiguredBaseModel): - - name: Optional[List[Union[LangString, str]]] = Field(default_factory=list) - image: Optional[str] = Field(None, title="image") - value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") + """ + ['An object to describe a response option.'] + """ + name: Optional[List[LangString]] = pyd.Field(default_factory=list) + image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") + value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") class ComputeSpecification(ConfiguredBaseModel): - - jsExpression: Optional[Union[bool, str]] = Field(None, title="JavaScript Expression") - variableName: Optional[str] = Field(None, title="variableName") + """ + ['An object to define computations in an activity or protocol.'] + """ + jsExpression: Optional[Union[LangString, bool]] = pyd.Field(None, title="JavaScript Expression", description="""['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']""") + variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") @@ -94,67 +109,71 @@ class CreativeWork(ConfiguredBaseModel): class Activity(CreativeWork): - - about: Optional[str] = Field(None) - addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") - allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") - altLabel: Optional[str] = Field(None, title="alternate label") - associatedMedia: Optional[str] = Field(None, title="associatedMedia") - citation: Optional[str] = Field(None) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation") - cronTable: Optional[str] = Field(None, title="cronTable") - description: Optional[str] = Field(None) - image: Optional[str] = Field(None, title="image") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages") - order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") - overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") - preamble: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Preamble") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - schemaVersion: Optional[str] = Field(None) - shuffle: Optional[bool] = Field(None, title="Shuffle") - ui: Optional[UI] = Field(None, title="UI") - version: Optional[str] = Field(None) + """ + ['An assessment in a protocol.'] + """ + about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") + altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") + associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") + citation: Optional[LangString] = pyd.Field(None) + compute: Optional[List[ComputeSpecification]] = pyd.Field(default_factory=list, title="computation", description="""['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. ']""") + cronTable: Optional[str] = pyd.Field(None, title="cronTable", description="""['TODO not described in reproschema']""") + description: Optional[LangString] = pyd.Field(None) + image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") + messages: Optional[List[MessageSpecification]] = pyd.Field(default_factory=list, title="messages", description="""['An array of objects to define conditional messages in an activity or protocol.']""") + preamble: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Preamble", description="""['The preamble for an assessment']""") + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + schemaVersion: Optional[LangString] = pyd.Field(None) + ui: Optional[UiActivity] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") + version: Optional[LangString] = pyd.Field(None) class DisableBack(ConfiguredBaseModel): - + """ + ['Indicates (by boolean) if we can go back to a completed assessment in a protocol.'] + """ None class DontKnow(ConfiguredBaseModel): - + """ + ['An element to describe the choice when response is not known.'] + """ None class Field(CreativeWork): - - about: Optional[str] = Field(None) - additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes") - altLabel: Optional[str] = Field(None, title="alternate label") - associatedMedia: Optional[str] = Field(None, title="associatedMedia") - audio: Optional[str] = Field(None, title="audio") - description: Optional[str] = Field(None) - image: Optional[str] = Field(None, title="image") - inputType: Optional[str] = Field(None, title="inputType") - isPartOf: Optional[Activity] = Field(None) - preamble: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Preamble") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - question: Optional[List[Union[LangString, str]]] = Field(default_factory=list) - readonlyValue: Optional[str] = Field(None) - responseOptions: Optional[Union[ResponseOption, str]] = Field(None, title="Response options") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI") - version: Optional[str] = Field(None) - video: Optional[VideoObject] = Field(None) + """ + ['An item in an assessment.'] + """ + about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") + additionalNotesObj: Optional[List[AdditionalNoteObj]] = pyd.Field(default_factory=list, title="additional notes", description="""['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.']""") + altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") + associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") + audio: Optional[str] = pyd.Field(None, title="audio", description="""['TDOO']""") + description: Optional[LangString] = pyd.Field(None) + image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") + imageUrl: Optional[str] = pyd.Field(None, title="imageUrl", description="""['An image url.']""") + isPartOf: Optional[Activity] = pyd.Field(None) + preamble: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Preamble", description="""['The preamble for an assessment']""") + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + question: Optional[List[LangString]] = pyd.Field(default_factory=list) + responseOptions: Optional[Union[ResponseOption, str]] = pyd.Field(None, title="Response options", description="""['An element (object or by URL)to describe the properties of response of the Field item.']""") + schemaVersion: Optional[LangString] = pyd.Field(None) + ui: Optional[UiField] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") + version: Optional[LangString] = pyd.Field(None) + video: Optional[VideoObject] = pyd.Field(None) class LandingPage(ConfiguredBaseModel): - - inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + """ + ['An object to define the landing page of a protocol.'] + """ + inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) @@ -165,109 +184,125 @@ class LangString(ConfiguredBaseModel): class MediaObject(ConfiguredBaseModel): - - contentUrl: str = Field(...) - inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + """ + ['TODO comments'] + """ + contentUrl: str = pyd.Field(...) + inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) class MessageSpecification(ConfiguredBaseModel): - - jsExpression: Optional[Union[bool, str]] = Field(None, title="JavaScript Expression") - message: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Message") + """ + ['An object to define messages in an activity or protocol.'] + """ + jsExpression: Optional[Union[LangString, bool]] = pyd.Field(None, title="JavaScript Expression", description="""['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']""") + message: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Message", description="""['The message to be conditionally displayed for an item. ']""") class OverrideProperty(ConfiguredBaseModel): - - isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") - isVis: Optional[Union[bool, str]] = Field(None, title="visibility") - limit: Optional[str] = Field(None, title="limit") - maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay") - schedule: Optional[Union[Schedule, str]] = Field(None, title="Schedule") - valueRequired: Optional[bool] = Field(None) - variableName: Optional[str] = Field(None, title="variableName") + """ + ['An object to override the various properties added to assessments and fields.'] + """ + isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") + isVis: Optional[Union[bool, str]] = pyd.Field(None, title="visibility", description="""['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']""") + limit: Optional[LangString] = pyd.Field(None, title="limit", description="""['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']""") + maxRetakes: Optional[Decimal] = pyd.Field(None, title="maxRetakes", description="""['Defines number of times the item is allowed to be redone.']""") + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + randomMaxDelay: Optional[LangString] = pyd.Field(None, title="randomMaxDelay", description="""['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']""") + schedule: Optional[Union[Schedule, str]] = pyd.Field(None, title="Schedule", description="""['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']""") + valueRequired: Optional[bool] = pyd.Field(None) + variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") class Participant(Agent): - - subject_id: Optional[str] = Field(None) + """ + ['An Agent describing characteristics associated with a participant.'] + """ + subject_id: Optional[LangString] = pyd.Field(None) class Protocol(CreativeWork): - - about: Optional[str] = Field(None) - addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") - allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") - altLabel: Optional[str] = Field(None, title="alternate label") - associatedMedia: Optional[str] = Field(None, title="associatedMedia") - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation") - cronTable: Optional[str] = Field(None, title="cronTable") - description: Optional[str] = Field(None) - landingPage: Optional[Union[LandingPage, str]] = Field(None, title="Landing page content") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages") - order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") - overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - schemaVersion: Optional[str] = Field(None) - shuffle: Optional[bool] = Field(None, title="Shuffle") - ui: Optional[UI] = Field(None, title="UI") - version: Optional[str] = Field(None) + """ + ['A representation of a study which comprises one or more assessments.'] + """ + about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") + altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") + associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") + compute: Optional[List[ComputeSpecification]] = pyd.Field(default_factory=list, title="computation", description="""['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. ']""") + cronTable: Optional[str] = pyd.Field(None, title="cronTable", description="""['TODO not described in reproschema']""") + description: Optional[LangString] = pyd.Field(None) + landingPage: Optional[Union[LandingPage, str]] = pyd.Field(None, title="Landing page content", description="""['An element (by URL) to point to the protocol readme or landing page.']""") + messages: Optional[List[MessageSpecification]] = pyd.Field(default_factory=list, title="messages", description="""['An array of objects to define conditional messages in an activity or protocol.']""") + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + schemaVersion: Optional[LangString] = pyd.Field(None) + ui: Optional[UiProtocol] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") + version: Optional[LangString] = pyd.Field(None) class Response(CreativeWork): - - isAbout: Optional[Union[Activity, Field]] = Field(None, title="isAbout") - ui: Optional[UI] = Field(None, title="UI") - value: Optional[List[Union[Decimal, DontKnow, Skipped, StructuredValue, bool, str]]] = Field(default_factory=list, title="value") - wasAttributedTo: Optional[Participant] = Field(None) + """ + ['Describes the response of an item.'] + """ + isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") + value: Optional[List[Union[Decimal, DontKnow, Skipped, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") + wasAttributedTo: Optional[Participant] = pyd.Field(None) class ResponseActivity(CreativeWork): - - endedAtTime: Optional[datetime ] = Field(None) - generated: Optional[str] = Field(None) - inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) - startedAtTime: Optional[datetime ] = Field(None) - used: Optional[List[str]] = Field(default_factory=list) - wasAssociatedWith: Optional[SoftwareAgent] = Field(None) + """ + ['Captures information about some action that took place. It also links to information (entities) that were used during the activity'] + """ + endedAtTime: Optional[datetime ] = pyd.Field(None) + generated: Optional[LangString] = pyd.Field(None) + inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) + startedAtTime: Optional[datetime ] = pyd.Field(None) + used: Optional[List[str]] = pyd.Field(default_factory=list) + wasAssociatedWith: Optional[SoftwareAgent] = pyd.Field(None) class ResponseOption(ConfiguredBaseModel): - - choices: Optional[List[Union[Choice, str]]] = Field(default_factory=list, title="choices") - datumType: Optional[str] = Field(None, title="datumType") - maxValue: Optional[Union[float, int]] = Field(None) - minValue: Optional[Union[float, int]] = Field(None) - multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation") - unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions") - valueType: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="The type of the response") + """ + ['An element (object or by URL)to describe the properties of response of the Field item.'] + """ + choices: Optional[List[Union[Choice, str]]] = pyd.Field(default_factory=list, title="choices", description="""['An array to list the available options for response of the Field item.']""") + datumType: Optional[str] = pyd.Field(None, title="datumType", description="""['Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item.']""") + maxValue: Optional[Union[float, int]] = pyd.Field(None) + minValue: Optional[Union[float, int]] = pyd.Field(None) + multipleChoice: Optional[bool] = pyd.Field(None, title="Multiple choice response expectation", description="""['Indicates (by bool) if response for the Field item has one or more answer.']""") + unitOptions: Optional[List[UnitOption]] = pyd.Field(default_factory=list, title="unitOptions", description="""['A list of objects to represent a human displayable name alongside the more formal value for units.']""") + valueType: Optional[List[str]] = pyd.Field(default_factory=list, title="The type of the response", description="""['The type of the response of an item. For example, string, integer, etc.']""") class Schedule(ConfiguredBaseModel): - + """ + ['An object to define the schedule of an activity or protocol.'] + """ None class Skipped(ConfiguredBaseModel): - + """ + ['An element to describe the choice when the item is skipped.'] + """ None class SoftwareAgent(ConfiguredBaseModel): - - version: Optional[str] = Field(None) - url: Optional[str] = Field(None) + """ + ['Captures information about some action that took place. It also links to information (entities) that were used during the activity'] + """ + version: Optional[LangString] = pyd.Field(None) + url: Optional[str] = pyd.Field(None) @@ -284,36 +319,59 @@ class Thing(ConfiguredBaseModel): class TimedOut(ConfiguredBaseModel): - + """ + ['A boolean element to describe if the response did not occur within the prescribed time.'] + """ None -class UI(ConfiguredBaseModel): +class UiActivity(ConfiguredBaseModel): + """ + ['todo'] + """ + order: Optional[List[Union[Activity, Field, str]]] = pyd.Field(default_factory=list, title="Order", description="""['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']""") + addProperties: Optional[List[AdditionalProperty]] = pyd.Field(default_factory=list, title="addProperties", description="""['An array of objects to describe the various properties added to assessments and fields.']""") + overrideProperties: Optional[List[OverrideProperty]] = pyd.Field(default_factory=list, title="overrideProperties", description="""['An array of objects to override the various properties added to assessments and fields.']""") + shuffle: Optional[bool] = pyd.Field(None, title="Shuffle", description="""['An element (bool) to determine if the list of items is shuffled or in order.']""") + allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") + - order: Optional[List[Union[Activity, Field, str]]] = Field(default_factory=list, title="Order") - addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties") - overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties") - message: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="Message") - shuffle: Optional[bool] = Field(None, title="Shuffle") - inputType: Optional[str] = Field(None, title="inputType") - readonlyValue: Optional[str] = Field(None) - allow: Optional[List[Thing]] = Field(default_factory=list, title="allow") - valueRequired: Optional[bool] = Field(None) + +class UiField(ConfiguredBaseModel): + """ + ['todo'] + """ + inputType: Optional[str] = pyd.Field(None, title="inputType", description="""['An element to describe the input type of a Field item.']""") + readonlyValue: Optional[bool] = pyd.Field(None) -class UnitOption(ConfiguredBaseModel): +class UiProtocol(ConfiguredBaseModel): + """ + ['todo'] + """ + order: Optional[List[Union[Activity, Field, str]]] = pyd.Field(default_factory=list, title="Order", description="""['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']""") + addProperties: Optional[List[AdditionalProperty]] = pyd.Field(default_factory=list, title="addProperties", description="""['An array of objects to describe the various properties added to assessments and fields.']""") + overrideProperties: Optional[List[OverrideProperty]] = pyd.Field(default_factory=list, title="overrideProperties", description="""['An array of objects to override the various properties added to assessments and fields.']""") + shuffle: Optional[bool] = pyd.Field(None, title="Shuffle", description="""['An element (bool) to determine if the list of items is shuffled or in order.']""") + allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") - prefLabel: Optional[List[Union[LangString, str]]] = Field(default_factory=list, title="preferred label") - value: Optional[List[str]] = Field(default_factory=list, title="value") + + +class UnitOption(ConfiguredBaseModel): + """ + ['An object to represent a human displayable name alongside the more formal value for units.'] + """ + prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") + value: Optional[List[Union[LangString, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") class VideoObject(ConfiguredBaseModel): - contentUrl: str = Field(...) - inLanguage: Optional[List[Union[LangString, str]]] = Field(default_factory=list) + contentUrl: str = pyd.Field(...) + inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) @@ -349,7 +407,9 @@ class VideoObject(ConfiguredBaseModel): StructuredValue.model_rebuild() Thing.model_rebuild() TimedOut.model_rebuild() -UI.model_rebuild() +UiActivity.model_rebuild() +UiField.model_rebuild() +UiProtocol.model_rebuild() UnitOption.model_rebuild() VideoObject.model_rebuild() diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 758e53ee9a..d00d07ba0f 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -17,12 +17,12 @@ prefixes: default_range: string slots: about: - comments: + description: - The subject matter of the Field. slot_uri: schema:about addProperties: title: addProperties - comments: + description: - An array of objects to describe the various properties added to assessments and fields. slot_uri: reproschema:addProperties @@ -30,7 +30,7 @@ slots: range: AdditionalProperty additionalNotesObj: title: additional notes - comments: + description: - 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. slot_uri: reproschema:additionalNotesObj @@ -39,32 +39,32 @@ slots: - range: AdditionalNoteObj allow: title: allow - comments: + description: - 'An array of items indicating properties allowed on an activity or protocol ' slot_uri: reproschema:allow multivalued: true range: Thing altLabel: title: alternate label - comments: + description: - The alternate label. slot_uri: skos:altLabel associatedMedia: title: associatedMedia - comments: + description: - A media object that encodes this CreativeWork. This property is a synonym for encoding. slot_uri: schema:associatedMedia audio: title: audio - comments: + description: - TDOO slot_uri: schema:audio range: uriorcurie inlined: true choices: title: choices - comments: + description: - An array to list the available options for response of the Field item. exact_mappings: - schema:itemListElement @@ -75,18 +75,17 @@ slots: - range: Choice citation: slot_uri: schema:citation + range: langString column: title: column - comments: + description: - An element to define the column name where the note was taken from. slot_uri: reproschema:column multivalued: true - any_of: - - range: string - - range: langString + range: string compute: title: computation - comments: + description: - '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, @@ -100,12 +99,12 @@ slots: range: uriorcurie cronTable: title: cronTable - comments: + description: - TODO not described in reproschema slot_uri: reproschema:cronTable datumType: title: datumType - comments: + description: - Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item. slot_uri: reproschema:datumType @@ -114,32 +113,38 @@ slots: - range: uri description: slot_uri: schema:description + range: langString endedAtTime: range: datetime slot_uri: prov:endedAtTime generated: slot_uri: prov:generated + range: langString image: title: image - comments: + description: - An image of the item. This can be a URL or a fully described ImageObject. slot_uri: schema:image range: uriorcurie + imageUrl: + title: imageUrl + description: + - An image url. + slot_uri: reproschema:imageUrl + range: uri inLanguage: slot_uri: schema:inLanguage multivalued: true - any_of: - - range: string - - range: langString + range: langString inputType: title: inputType - comments: + description: - An element to describe the input type of a Field item. slot_uri: reproschema:inputType isAbout: title: isAbout - comments: + description: - A pointer to the node describing the item. slot_uri: reproschema:isAbout any_of: @@ -150,7 +155,7 @@ slots: range: Activity isVis: title: visibility - comments: + description: - An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment. slot_uri: reproschema:isVis @@ -159,16 +164,16 @@ slots: - range: string jsExpression: title: JavaScript Expression - comments: + description: - A JavaScript expression for computations. - A JavaScript expression to compute a score from other variables. slot_uri: reproschema:jsExpression any_of: - range: boolean - - range: string + - range: langString landingPage: title: Landing page content - comments: + description: - An element (by URL) to point to the protocol readme or landing page. slot_uri: reproschema:landingPage any_of: @@ -177,13 +182,14 @@ slots: - range: LandingPage limit: title: limit - comments: + description: - An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available. slot_uri: reproschema:limit + range: langString maxRetakes: title: maxRetakes - comments: + description: - Defines number of times the item is allowed to be redone. slot_uri: reproschema:maxRetakes any_of: @@ -195,16 +201,15 @@ slots: slot_uri: schema:maxValue message: title: Message - comments: + description: - 'The message to be conditionally displayed for an item. ' slot_uri: reproschema:message multivalued: true any_of: - - range: string - - range: langString + range: langString messages: title: messages - comments: + description: - An array of objects to define conditional messages in an activity or protocol. slot_uri: reproschema:messages multivalued: true @@ -216,19 +221,17 @@ slots: - range: integer multipleChoice: title: Multiple choice response expectation - comments: + description: - Indicates (by bool) if response for the Field item has one or more answer. slot_uri: reproschema:multipleChoice range: boolean name: multivalued: true - any_of: - - range: string - - range: langString + range: langString slot_uri: schema:name order: title: Order - comments: + description: - An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface. slot_uri: reproschema:order @@ -239,7 +242,7 @@ slots: - range: Field overrideProperties: title: overrideProperties - comments: + description: - An array of objects to override the various properties added to assessments and fields. slot_uri: reproschema:overrideProperties @@ -247,34 +250,29 @@ slots: range: OverrideProperty preamble: title: Preamble - comments: + description: - The preamble for an assessment slot_uri: reproschema:preamble multivalued: true - any_of: - - range: string - - range: langString + range: langString prefLabel: title: preferred label - comments: + description: - The preferred label. slot_uri: skos:prefLabel multivalued: true - any_of: - - range: string - - range: langString + range: langString question: slot_uri: schema:question multivalued: true - any_of: - - range: string - - range: langString + range: langString randomMaxDelay: title: randomMaxDelay - comments: + description: - Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration slot_uri: reproschema:randomMaxDelay + range: langString readonlyValue: slot_uri: schema:readonlyValue range: boolean @@ -283,7 +281,7 @@ slots: # slot_uri: schema:requiredValue responseOptions: title: Response options - comments: + description: - An element (object or by URL)to describe the properties of response of the Field item. slot_uri: reproschema:responseOptions @@ -292,7 +290,7 @@ slots: - range: ResponseOption schedule: title: Schedule - comments: + description: - An element to set make activity available/repeat info using ISO 8601 repeating interval format. slot_uri: reproschema:schedule @@ -301,24 +299,23 @@ slots: - range: string schemaVersion: slot_uri: schema:schemaVersion + range: langString shuffle: title: Shuffle - comments: + description: - An element (bool) to determine if the list of items is shuffled or in order. slot_uri: reproschema:shuffle range: boolean source: title: source - comments: + description: - An element to define the source (eg. RedCap, NDA) where the note was taken from. slot_uri: reproschema:source multivalued: true - any_of: - - range: string - - range: langString + range: string statusOptions: title: Status options - comments: + description: - "Provides information on whether or not a field item wants to be accompanied\ \ by the additional status option(s) defined in \u201CstatusOptions\u201D" slot_uri: reproschema:statusOptions @@ -327,15 +324,19 @@ slots: slot_uri: prov:startedAtTime subject_id: slot_uri: nidm:subject_id #TODO check this @type:rdf:Property + range: langString ui: title: UI - comments: + description: - it was originally @nest in jsonld, but decided for a new class for now slot_uri: reproschema:ui - range: UI + any_of: + - range: UiActivity + - range: UiField + - range: UiProtocol unitOptions: title: unitOptions - comments: + description: - A list of objects to represent a human displayable name alongside the more formal value for units. slot_uri: reproschema:unitOptions @@ -343,12 +344,13 @@ slots: range: UnitOption url: slot_uri: schema:url + range: uri used: slot_uri: prov:used multivalued: true value: title: value - comments: + description: - The value for each option in choices or in additionalNotesObj exact_mappings: - schema:value @@ -365,23 +367,23 @@ slots: # slot_uri: schema:value valueType: title: The type of the response - comments: + description: - The type of the response of an item. For example, string, integer, etc. slot_uri: reproschema:valueType multivalued: true - any_of: - - range: string - - range: langString + range: uri valueRequired: slot_uri: schema:valueRequired range: boolean variableName: title: variableName - comments: + description: - The name used to represent an item. slot_uri: reproschema:variableName + range: langString version: slot_uri: schema:version + range: langString video: slot_uri: schema:video range: VideoObject @@ -394,13 +396,11 @@ slots: classes: Activity: title: Activity - comments: + description: - An assessment in a protocol. is_a: CreativeWork slots: - about - - addProperties - - allow - altLabel - associatedMedia - citation @@ -409,18 +409,18 @@ classes: - description - image - messages - - order - - overrideProperties - preamble - prefLabel - schemaVersion - - shuffle - ui - version + slot_usage: + ui: + range: UiActivity class_uri: reproschema:Activity AdditionalNoteObj: title: Additional Notes Object - comments: + description: - 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 slots: @@ -430,7 +430,7 @@ classes: class_uri: reproschema:AdditionalNoteObj AdditionalProperty: title: Additional properties - comments: + description: - An object to describe the various properties added to assessments and fields. slots: - allow @@ -448,22 +448,22 @@ classes: class_uri: prov:Agent AllowExport: title: Allow export - comments: + description: - Indicates (by boolean) if data can be exported or not. class_uri: reproschema:AllowExport AllowReplay: title: Allow replay - comments: + description: - Indicates (by boolean) if items can be replayed or not. class_uri: reproschema:AllowReplay AutoAdvance: title: Auto advance - comments: + description: - Indicates (by boolean) if assessments in a protocol can auto advance or not. class_uri: reproschema:AutoAdvance Choice: title: Response choice - comments: + description: - An object to describe a response option. slots: - name @@ -478,7 +478,7 @@ classes: class_uri: reproschema:Choice ComputeSpecification: title: Compute Specification - comments: + description: - An object to define computations in an activity or protocol. slots: - jsExpression @@ -488,17 +488,17 @@ classes: class_uri: schema:CreativeWork DisableBack: title: Disable redo - comments: + description: - Indicates (by boolean) if we can go back to a completed assessment in a protocol. class_uri: reproschema:DisableBack DontKnow: title: Do not know - comments: + description: - An element to describe the choice when response is not known. class_uri: reproschema:DontKnow Field: #TODO: multiple @type in reproschema title: Field - comments: + description: - An item in an assessment. is_a: CreativeWork slots: @@ -509,21 +509,23 @@ classes: - audio - description - image - - inputType + - imageUrl - isPartOf - preamble - prefLabel - question - - readonlyValue - responseOptions - schemaVersion - ui - version - video + slot_usage: + ui: + range: UiField class_uri: reproschema:Field LandingPage: title: Landing Page - comments: + description: - An object to define the landing page of a protocol. slots: - inLanguage @@ -532,7 +534,7 @@ classes: class_uri: rdf:langString MediaObject: title: Media Object - comments: + description: - TODO comments class_uri: schema:MediaObject slots: @@ -543,7 +545,7 @@ classes: required: true MessageSpecification: title: Message Specification - comments: + description: - An object to define messages in an activity or protocol. slots: - jsExpression @@ -551,7 +553,7 @@ classes: class_uri: reproschema:MessageSpecification OverrideProperty: title: Additional properties - comments: + description: - An object to override the various properties added to assessments and fields. slots: - isAbout @@ -566,7 +568,7 @@ classes: class_uri: reproschema:OverrideProperty Participant: title: Participant - comments: + description: - An Agent describing characteristics associated with a participant. is_a: Agent slots: @@ -574,13 +576,11 @@ classes: class_uri: reproschema:Participant Protocol: # TODO multiple types title: Protocol - comments: + description: - A representation of a study which comprises one or more assessments. is_a: CreativeWork slots: - about - - addProperties - - allow - altLabel - associatedMedia - compute @@ -588,22 +588,21 @@ classes: - description - landingPage - messages - - order - - overrideProperties - prefLabel - schemaVersion - - shuffle - ui - version + slot_usage: + ui: + range: UiProtocol class_uri: reproschema:Protocol Response: # multiple types title: Response - comments: + description: - Describes the response of an item. is_a: CreativeWork slots: - isAbout - - ui - value #TODO it was schema:value - wasAttributedTo slot_usage: @@ -619,7 +618,7 @@ classes: class_uri: reproschema:Response ResponseActivity: # multiple types title: ResponseActivity - comments: + description: - Captures information about some action that took place. It also links to information (entities) that were used during the activity is_a: CreativeWork @@ -633,7 +632,7 @@ classes: class_uri: reproschema:ResponseActivity ResponseOption: title: Response option - comments: + description: - An element (object or by URL)to describe the properties of response of the Field item. slots: @@ -647,17 +646,17 @@ classes: class_uri: reproschema:ResponseOption Schedule: title: Schedule - comments: + description: - An object to define the schedule of an activity or protocol. #TODO can't find it in the schema class_uri: reproschema:Schedule Skipped: title: Skipped - comments: + description: - An element to describe the choice when the item is skipped. class_uri: reproschema:Skipped SoftwareAgent: # TODO multiple types title: Software Agent - comments: + description: - Captures information about some action that took place. It also links to information (entities) that were used during the activity slots: @@ -671,32 +670,43 @@ classes: class_uri: schema:Thing TimedOut: title: Response timed out - comments: + description: - A boolean element to describe if the response did not occur within the prescribed time. class_uri: reproschema:TimedOut - UI: + UiActivity: title: todo - comments: + description: - todo slots: - order - addProperties - overrideProperties - - message - shuffle + - allow + class_uri: reproschema:UiActivity + UiField: + title: todo + description: + - todo + slots: - inputType - readonlyValue + class_uri: reproschema:UiField + UiProtocol: + title: todo + description: + - todo + slots: + - order + - addProperties + - overrideProperties + - shuffle - allow - #- requiredValue # should be valueRequired - - valueRequired - # - delay todo: never used, meaning? type? - # - timer never used - #- inputOptions todo never used - + class_uri: reproschema:UiProtocol UnitOption: title: Unit options - comments: + description: - An object to represent a human displayable name alongside the more formal value for units. slots: @@ -706,7 +716,7 @@ classes: value: any_of: - range: uri - - range: string + - range: langString class_uri: reproschema:UnitOption VideoObject: From 7013c1ca4acbfe2f6631ce260dda7b4749a95f84 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 16:20:19 -0500 Subject: [PATCH 04/34] Updated linkml schema and corresponding updates to context --- contexts/reproschema_new | 47 ++-- linkml-schema/reproschema.yaml | 400 ++++++++++++++------------------- 2 files changed, 198 insertions(+), 249 deletions(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 745fa245d6..f95721a612 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -22,6 +22,9 @@ "@vocab": "http://example.org/example/", "@version": 1.1, "@language": "en", + "id": "@id", + "category": "@type", + "ui": "@nest", "about": { "@id": "schema:about" }, @@ -29,12 +32,15 @@ "@id": "reproschema:additionalNotesObj" }, "addProperties": { - "@type": "@id", - "@id": "reproschema:addProperties" + "@id": "reproschema:addProperties", + "@container": "@set", + "@nest": "ui" }, "allow": { "@type": "@id", - "@id": "reproschema:allow" + "@id": "reproschema:allow", + "@container": "@set", + "@nest": "ui" }, "altLabel": { "@id": "skos:altLabel", @@ -59,7 +65,8 @@ "@type": "xsd:string" }, "compute": { - "@id": "reproschema:compute" + "@id": "reproschema:compute", + "@container": "@list" }, "contentUrl": { "@type": "@id", @@ -95,7 +102,8 @@ }, "inputType": { "@id": "reproschema:inputType", - "@type": "xsd:string" + "@type": "xsd:string", + "@nest": "ui" }, "isAbout": { "@type": "@id", @@ -116,7 +124,8 @@ "@id": "reproschema:landingPage" }, "limit": { - "@id": "reproschema:limit" + "@id": "reproschema:limit", + "@language": null }, "maxRetakes": { "@id": "reproschema:maxRetakes" @@ -129,7 +138,7 @@ "@container": "@language" }, "messages": { - "@type": "@id", + "@container": "@set", "@id": "reproschema:messages" }, "minValue": { @@ -145,11 +154,14 @@ }, "order": { "@type": "@id", - "@id": "reproschema:order" + "@id": "reproschema:order", + "@container": "@list", + "@nest": "ui" }, "overrideProperties": { - "@type": "@id", - "@id": "reproschema:overrideProperties" + "@id": "reproschema:overrideProperties", + "@container": "@set", + "@nest": "ui" }, "preamble": { "@id": "reproschema:preamble", @@ -164,7 +176,8 @@ "@container": "@language" }, "randomMaxDelay": { - "@id": "reproschema:randomMaxDelay" + "@id": "reproschema:randomMaxDelay", + "@language": null }, "readonlyValue": { "@type": "xsd:boolean", @@ -175,14 +188,16 @@ "@id": "reproschema:responseOptions" }, "schedule": { - "@id": "reproschema:schedule" + "@id": "reproschema:schedule", + "@language": null }, "schemaVersion": { "@id": "schema:schemaVersion" }, "shuffle": { "@type": "xsd:boolean", - "@id": "reproschema:shuffle" + "@id": "reproschema:shuffle", + "@nest": "ui" }, "source": { "@id": "reproschema:source", @@ -198,10 +213,6 @@ "subject_id": { "@id": "nidm:subject_id" }, - "ui": { - "@type": "@id", - "@id": "reproschema:ui" - }, "unitOptions": { "@type": "@id", "@id": "reproschema:unitOptions" @@ -279,7 +290,7 @@ "DontKnow": { "@id": "reproschema:DontKnow" }, - "Field": { + "Item": { "@id": "reproschema:Field" }, "LandingPage": { diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index d00d07ba0f..64a6d260be 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -1,5 +1,5 @@ name: reproschema -id: http://example.org/example # todo: change this +id: http://schema.repronim.org/ # todo: change this imports: - linkml:types prefixes: @@ -17,21 +17,19 @@ prefixes: default_range: string slots: about: - description: - - The subject matter of the Field. + description: The subject matter of the Field. slot_uri: schema:about addProperties: title: addProperties - description: - - An array of objects to describe the various properties added to assessments - and fields. + description: An array of objects to describe the various properties added to assessments + and Items. slot_uri: reproschema:addProperties multivalued: true range: AdditionalProperty additionalNotesObj: title: additional notes description: - - A set of objects to define notes in a field. For example, most Redcap and NDA + 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. slot_uri: reproschema:additionalNotesObj multivalued: true @@ -39,33 +37,32 @@ slots: - range: AdditionalNoteObj allow: title: allow - description: - - 'An array of items indicating properties allowed on an activity or protocol ' + description: An array of items indicating properties allowed on an activity or protocol. slot_uri: reproschema:allow multivalued: true - range: Thing + range: AllowedType altLabel: title: alternate label - description: - - The alternate label. + description: The alternate label. slot_uri: skos:altLabel associatedMedia: title: associatedMedia - description: - - A media object that encodes this CreativeWork. This property is a synonym for - encoding. + description: A media object that encodes this CreativeWork. This property is a synonym for encoding. slot_uri: schema:associatedMedia audio: title: audio - description: - - TDOO + description: TODO slot_uri: schema:audio - range: uriorcurie + any_of: + - range: uri + - range: AudioObject inlined: true + category: + slot_uri: rdf:type + range: uriorcurie choices: title: choices - description: - - An array to list the available options for response of the Field item. + description: An array to list the available options for response of the Item. exact_mappings: - schema:itemListElement slot_uri: reproschema:choices @@ -75,89 +72,88 @@ slots: - range: Choice citation: slot_uri: schema:citation + multivalued: true range: langString + inlined: true column: title: column - description: - - An element to define the column name where the note was taken from. + description: An element to define the column name where the note was taken from. slot_uri: reproschema:column - multivalued: true range: string compute: title: computation description: - - '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 + An array of objects indicating computations in an activity or protocol and + maps it to the corresponding 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. ' + one may want to do conversion from one unit to another. slot_uri: reproschema:compute multivalued: true - any_of: - - range: ComputeSpecification + range: ComputeSpecification + inlined: true contentUrl: slot_uri: schema:contentUrl range: uriorcurie cronTable: title: cronTable - description: - - TODO not described in reproschema + description: TODO not described in reproschema slot_uri: reproschema:cronTable datumType: title: datumType - description: - - Indicates what type of datum the response is (e.g. range,count,scalar etc.) - for the Field item. + description: Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item. slot_uri: reproschema:datumType any_of: - range: string - range: uri description: slot_uri: schema:description + multivalued: true range: langString + inlined: true endedAtTime: range: datetime slot_uri: prov:endedAtTime generated: slot_uri: prov:generated - range: langString + range: uri + id: + slot_uri: schema:id + range: uri image: title: image description: - - An image of the item. This can be a URL + An image of the item. This can be a URL or a fully described ImageObject. slot_uri: schema:image - range: uriorcurie + range: ImageObject imageUrl: title: imageUrl - description: - - An image url. + description: An image url. slot_uri: reproschema:imageUrl range: uri inLanguage: slot_uri: schema:inLanguage - multivalued: true - range: langString + range: string inputType: title: inputType - description: - - An element to describe the input type of a Field item. + description: An element to describe the input type of a Item. slot_uri: reproschema:inputType isAbout: title: isAbout - description: - - A pointer to the node describing the item. + description: A pointer to the node describing the item. slot_uri: reproschema:isAbout any_of: + - range: uri - range: Activity - - range: Field + - range: Item + inlined: true isPartOf: slot_uri: schema:isPartOf range: Activity isVis: title: visibility description: - - An element to describe (by boolean or conditional statement) visibility conditions - of items in an assessment. + An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment. slot_uri: reproschema:isVis any_of: - range: boolean @@ -165,52 +161,57 @@ slots: jsExpression: title: JavaScript Expression description: - - A JavaScript expression for computations. - - A JavaScript expression to compute a score from other variables. + A JavaScript expression for computations. + A JavaScript expression to compute a score from other variables. slot_uri: reproschema:jsExpression - any_of: - - range: boolean - - range: langString + range: string landingPage: title: Landing page content - description: - - An element (by URL) to point to the protocol readme or landing page. + description: An element (by URL) to point to the protocol readme or landing page. slot_uri: reproschema:landingPage any_of: - range: uri - range: string - range: LandingPage + langstring_prefix: + description: + The language prefix component of a langString. + key: true + range: string + required: true + langstring_value: + description: + The value component of a langString. + range: string + required: true limit: title: limit description: - - An element to limit the duration (uses ISO 8601) this activity is allowed to + An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available. slot_uri: reproschema:limit - range: langString + range: string maxRetakes: title: maxRetakes - description: - - Defines number of times the item is allowed to be redone. + description: Defines number of times the item is allowed to be redone. slot_uri: reproschema:maxRetakes any_of: - range: decimal maxValue: any_of: - - range: float - - range: integer + - range: float + - range: integer slot_uri: schema:maxValue message: title: Message - description: - - 'The message to be conditionally displayed for an item. ' + description: The message to be conditionally displayed for an item. slot_uri: reproschema:message multivalued: true - any_of: range: langString + inlined: true messages: title: messages - description: - - An array of objects to define conditional messages in an activity or protocol. + description: An array of objects to define conditional messages in an activity or protocol. slot_uri: reproschema:messages multivalued: true range: MessageSpecification @@ -221,40 +222,38 @@ slots: - range: integer multipleChoice: title: Multiple choice response expectation - description: - - Indicates (by bool) if response for the Field item has one or more answer. + description: Indicates (by bool) if response for the Item has one or more answer. slot_uri: reproschema:multipleChoice range: boolean name: + slot_uri: schema:name multivalued: true range: langString - slot_uri: schema:name + inlined: true order: title: Order description: - - An ordered list to describe the order in which the items of an assessment or + An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface. slot_uri: reproschema:order multivalued: true any_of: - range: uri - range: Activity - - range: Field + - range: Item overrideProperties: title: overrideProperties - description: - - An array of objects to override the various properties added to assessments - and fields. + description: An array of objects to override the various properties added to assessments and fields. slot_uri: reproschema:overrideProperties multivalued: true range: OverrideProperty preamble: title: Preamble - description: - - The preamble for an assessment + description: The preamble for an assessment slot_uri: reproschema:preamble multivalued: true range: langString + inlined: true prefLabel: title: preferred label description: @@ -262,17 +261,19 @@ slots: slot_uri: skos:prefLabel multivalued: true range: langString + inlined: true question: slot_uri: schema:question multivalued: true range: langString + inlined: true randomMaxDelay: title: randomMaxDelay description: - - Present activity/item within some random offset of activity available time up + Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration slot_uri: reproschema:randomMaxDelay - range: langString + range: string readonlyValue: slot_uri: schema:readonlyValue range: boolean @@ -281,63 +282,51 @@ slots: # slot_uri: schema:requiredValue responseOptions: title: Response options - description: - - An element (object or by URL)to describe the properties of response of the Field - item. + description: An element (object or by URL)to describe the properties of response of the Item. slot_uri: reproschema:responseOptions any_of: - range: uri - range: ResponseOption schedule: title: Schedule - description: - - An element to set make activity available/repeat info using ISO 8601 repeating - interval format. + description: An element to set make activity available/repeat info using ISO 8601 repeating interval format. slot_uri: reproschema:schedule - any_of: - - range: Schedule - - range: string + range: string schemaVersion: slot_uri: schema:schemaVersion - range: langString + range: string shuffle: title: Shuffle - description: - - An element (bool) to determine if the list of items is shuffled or in order. + description: An element (bool) to determine if the list of items is shuffled or in order. slot_uri: reproschema:shuffle range: boolean source: title: source - description: - - An element to define the source (eg. RedCap, NDA) where the note was taken from. + description: An element to define the source (eg. RedCap, NDA) where the note was taken from. slot_uri: reproschema:source - multivalued: true range: string statusOptions: title: Status options description: - - "Provides information on whether or not a field item wants to be accompanied\ - \ by the additional status option(s) defined in \u201CstatusOptions\u201D" + Provides information on whether or not an Item wants to be accompanied + by the additional status option(s) defined in "statusOptions" slot_uri: reproschema:statusOptions startedAtTime: range: datetime slot_uri: prov:startedAtTime subject_id: slot_uri: nidm:subject_id #TODO check this @type:rdf:Property - range: langString + range: string ui: title: UI description: - - it was originally @nest in jsonld, but decided for a new class for now + An element to control UI specifications. Originally @nest in jsonld, but using a class in the model. slot_uri: reproschema:ui - any_of: - - range: UiActivity - - range: UiField - - range: UiProtocol + range: UI unitOptions: title: unitOptions description: - - A list of objects to represent a human displayable name alongside the more formal + A list of objects to represent a human displayable name alongside the more formal value for units. slot_uri: reproschema:unitOptions multivalued: true @@ -350,40 +339,32 @@ slots: multivalued: true value: title: value - description: - - The value for each option in choices or in additionalNotesObj - exact_mappings: - - schema:value - slot_uri: reproschema:value - multivalued: true + description: The value for each option in choices or in additionalNotesObj + slot_uri: schema:value any_of: - range: boolean - range: decimal - range: StructuredValue - - range: string - range: langString - range: uri -# value_from_schema: -# slot_uri: schema:value + - range: string + inlined: true valueType: title: The type of the response - description: - - The type of the response of an item. For example, string, integer, etc. + description: The type of the response of an item. For example, string, integer, etc. slot_uri: reproschema:valueType - multivalued: true - range: uri + range: string valueRequired: slot_uri: schema:valueRequired range: boolean variableName: title: variableName - description: - - The name used to represent an item. + description: The name used to represent an item. slot_uri: reproschema:variableName range: langString version: slot_uri: schema:version - range: langString + range: string video: slot_uri: schema:video range: VideoObject @@ -396,8 +377,7 @@ slots: classes: Activity: title: Activity - description: - - An assessment in a protocol. + description: An assessment in a protocol. is_a: CreativeWork slots: - about @@ -416,12 +396,12 @@ classes: - version slot_usage: ui: - range: UiActivity + range: UI class_uri: reproschema:Activity AdditionalNoteObj: title: Additional Notes Object description: - - A set of objects to define notes in a field. For example, most Redcap and NDA + A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema slots: - column @@ -430,8 +410,7 @@ classes: class_uri: reproschema:AdditionalNoteObj AdditionalProperty: title: Additional properties - description: - - An object to describe the various properties added to assessments and fields. + description: An object to describe the various properties added to assessments and Items. slots: - allow - isAbout @@ -443,63 +422,39 @@ classes: - schedule - valueRequired - variableName + - ui class_uri: reproschema:AdditionalProperty + AudioObject: + is_a: MediaObject + class_uri: schema:AudioObject Agent: class_uri: prov:Agent - AllowExport: - title: Allow export - description: - - Indicates (by boolean) if data can be exported or not. - class_uri: reproschema:AllowExport - AllowReplay: - title: Allow replay - description: - - Indicates (by boolean) if items can be replayed or not. - class_uri: reproschema:AllowReplay - AutoAdvance: - title: Auto advance - description: - - Indicates (by boolean) if assessments in a protocol can auto advance or not. - class_uri: reproschema:AutoAdvance Choice: title: Response choice - description: - - An object to describe a response option. + description: An object to describe a response option. slots: - name - image - - value #TODO it was schema:value -#TODO validator -# slot_usage: -# value_from_schema: -# any_of: #Ask Satra -# - range: Skipped -# - range: DontKnow + - value class_uri: reproschema:Choice ComputeSpecification: title: Compute Specification - description: - - An object to define computations in an activity or protocol. + description: An object to define computations in an activity or protocol. slots: - jsExpression - variableName class_uri: reproschema:ComputeSpecification CreativeWork: + slots: + - id + - category class_uri: schema:CreativeWork - DisableBack: - title: Disable redo - description: - - Indicates (by boolean) if we can go back to a completed assessment in a protocol. - class_uri: reproschema:DisableBack - DontKnow: - title: Do not know - description: - - An element to describe the choice when response is not known. - class_uri: reproschema:DontKnow - Field: #TODO: multiple @type in reproschema - title: Field - description: - - An item in an assessment. + ImageObject: + is_a: MediaObject + class_uri: schema:ImageObject + Item: #TODO: multiple @type in reproschema + title: Item in an activity + description: An item in an assessment. is_a: CreativeWork slots: - about @@ -519,23 +474,24 @@ classes: - ui - version - video - slot_usage: - ui: - range: UiField class_uri: reproschema:Field LandingPage: title: Landing Page - description: - - An object to define the landing page of a protocol. + description: An object to define the landing page of a protocol. slots: - inLanguage + - id class_uri: reproschema:LandingPage langString: + description: RDF langString tuple + slots: + - langstring_prefix + - langstring_value class_uri: rdf:langString MediaObject: title: Media Object - description: - - TODO comments + description: Add description #TODO + is_a: CreativeWork class_uri: schema:MediaObject slots: - contentUrl @@ -545,16 +501,14 @@ classes: required: true MessageSpecification: title: Message Specification - description: - - An object to define messages in an activity or protocol. + description: An object to define messages in an activity or protocol. slots: - jsExpression - message class_uri: reproschema:MessageSpecification OverrideProperty: title: Additional properties - description: - - An object to override the various properties added to assessments and fields. + description: An object to override the various properties added to assessments and Items. slots: - isAbout - isVis @@ -568,16 +522,14 @@ classes: class_uri: reproschema:OverrideProperty Participant: title: Participant - description: - - An Agent describing characteristics associated with a participant. + description: An Agent describing characteristics associated with a participant. is_a: Agent slots: - subject_id class_uri: reproschema:Participant Protocol: # TODO multiple types title: Protocol - description: - - A representation of a study which comprises one or more assessments. + description: A representation of a study which comprises one or more assessments. is_a: CreativeWork slots: - about @@ -594,12 +546,11 @@ classes: - version slot_usage: ui: - range: UiProtocol + range: UI class_uri: reproschema:Protocol Response: # multiple types title: Response - description: - - Describes the response of an item. + description: Describes the response of an item. is_a: CreativeWork slots: - isAbout @@ -608,8 +559,7 @@ classes: slot_usage: value: any_of: - - range: Skipped - - range: DontKnow + - range: MissingType - range: decimal - range: boolean - range: string @@ -619,7 +569,7 @@ classes: ResponseActivity: # multiple types title: ResponseActivity description: - - Captures information about some action that took place. It also links to information + Captures information about some action that took place. It also links to information (entities) that were used during the activity is_a: CreativeWork slots: @@ -632,9 +582,7 @@ classes: class_uri: reproschema:ResponseActivity ResponseOption: title: Response option - description: - - An element (object or by URL)to describe the properties of response of the Field - item. + description: An element (object or by URL)to describe the properties of response of the Item. slots: - choices - datumType @@ -644,37 +592,25 @@ classes: - unitOptions - valueType class_uri: reproschema:ResponseOption - Schedule: - title: Schedule - description: - - An object to define the schedule of an activity or protocol. #TODO can't find it in the schema - class_uri: reproschema:Schedule - Skipped: - title: Skipped - description: - - An element to describe the choice when the item is skipped. - class_uri: reproschema:Skipped SoftwareAgent: # TODO multiple types title: Software Agent description: - - Captures information about some action that took place. It also links to information + Captures information about some action that took place. It also links to information (entities) that were used during the activity slots: - version - url class_uri: reproschema:SoftwareAgent StructuredValue: + is_a: CreativeWork class_uri: schema:StructuredValue - Thing: # todo should we switch class_uri: schema:Thing TimedOut: title: Response timed out - description: - - A boolean element to describe if the response did not occur within the prescribed - time. + description: A boolean element to describe if the response did not occur within the prescribed time. class_uri: reproschema:TimedOut - UiActivity: + UI: title: todo description: - todo @@ -684,31 +620,12 @@ classes: - overrideProperties - shuffle - allow - class_uri: reproschema:UiActivity - UiField: - title: todo - description: - - todo - slots: - inputType - readonlyValue - class_uri: reproschema:UiField - UiProtocol: - title: todo - description: - - todo - slots: - - order - - addProperties - - overrideProperties - - shuffle - - allow - class_uri: reproschema:UiProtocol + class_uri: reproschema:UI UnitOption: title: Unit options - description: - - An object to represent a human displayable name alongside the more formal value - for units. + description: An object to represent a human displayable name alongside the more formal value for units. slots: - prefLabel - value @@ -718,13 +635,34 @@ classes: - range: uri - range: langString class_uri: reproschema:UnitOption - VideoObject: title: Video Object + is_a: MediaObject class_uri: schema:VideoObject - slots: - - contentUrl - - inLanguage - slot_usage: - contentUrl: - required: true + +enums: + AllowedType: + permissible_values: + AllowExport: + description: Indicates (by boolean) if data can be exported or not. + meaning: reproschema:AllowExport + AllowReplay: + description: Indicates (by boolean) if items can be replayed or not. + meaning: reproschema:AllowReplay + AutoAdvance: + description: Indicates (by boolean) if assessments in a protocol can auto advance or not. + meaning: reproschema:AutoAdvance + DisableBack: + description: Indicates (by boolean) if we can go back to a completed assessment in a protocol. + meaning: reproschema:DisableBack + MissingType: + permissible_values: + Skipped: + description: An element to describe the choice when the item is skipped. + meaning: reproschema:Skipped + DontKnow: + description: An element to describe the choice when response is not known. + meaning: reproschema:DontKnow + Unknown: + description: An element to describe the choice when the reason for missing response is unknown. + meaning: reproschema:Unknown From 10fefc5a1aed9ca5bde4404ca89ad8e05ada02eb Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 16:33:36 -0500 Subject: [PATCH 05/34] Move TimedOut to an enumeration for missing --- linkml-schema/reproschema.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 64a6d260be..f4902cb876 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -606,10 +606,6 @@ classes: class_uri: schema:StructuredValue Thing: # todo should we switch class_uri: schema:Thing - TimedOut: - title: Response timed out - description: A boolean element to describe if the response did not occur within the prescribed time. - class_uri: reproschema:TimedOut UI: title: todo description: @@ -666,3 +662,6 @@ enums: Unknown: description: An element to describe the choice when the reason for missing response is unknown. meaning: reproschema:Unknown + TimedOut: + description: A boolean element to describe if the response did not occur within the prescribed time. + meaning: reproschema:TimedOut From 3be0933074c842159f935dc60aa33e1ccbd1e8a6 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 16:39:24 -0500 Subject: [PATCH 06/34] update autogenerated files --- linkml-schema/reproschema-shacl.ttl | 1237 ++++++++++++++------------- linkml-schema/reproschema.py | 426 +++++---- 2 files changed, 833 insertions(+), 830 deletions(-) diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl index 6ea114bbe9..3adcf542e4 100644 --- a/linkml-schema/reproschema-shacl.ttl +++ b/linkml-schema/reproschema-shacl.ttl @@ -8,827 +8,854 @@ @prefix skos: . @prefix xsd: . +schema1:AudioObject a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ] ; + sh:targetClass schema1:AudioObject . + schema1:CreativeWork a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:maxCount 1 ; + sh:order 1 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:id ] ; sh:targetClass schema1:CreativeWork . schema1:MediaObject a sh:NodeShape ; sh:closed true ; - sh:description "['TODO comments']" ; + sh:description "Add description" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Media Object" ; sh:property [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; sh:path schema1:contentUrl ], - [ sh:datatype rdf:langString ; - - sh:order 1 ; - sh:path schema1:inLanguage ] ; + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ] ; sh:targetClass schema1:MediaObject . -reproschema:AllowExport a sh:NodeShape ; +schema1:StructuredValue a sh:NodeShape ; sh:closed true ; - sh:description "['Indicates (by boolean) if data can be exported or not.']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Allow export" ; - sh:targetClass reproschema:AllowExport . + sh:property [ sh:maxCount 1 ; + sh:order 1 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:id ] ; + sh:targetClass schema1:StructuredValue . -reproschema:AllowReplay a sh:NodeShape ; +schema1:Thing a sh:NodeShape ; sh:closed true ; - sh:description "['Indicates (by boolean) if items can be replayed or not.']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Allow replay" ; - sh:targetClass reproschema:AllowReplay . + sh:targetClass schema1:Thing . -reproschema:AutoAdvance a sh:NodeShape ; +reproschema:AdditionalNoteObj a sh:NodeShape ; sh:closed true ; - sh:description "['Indicates (by boolean) if assessments in a protocol can auto advance or not.']" ; + sh:description "A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Auto advance" ; - sh:targetClass reproschema:AutoAdvance . + sh:name "Additional Notes Object" ; + sh:property [ sh:datatype xsd:string ; + sh:description "An element to define the source (eg. RedCap, NDA) where the note was taken from." ; + sh:maxCount 1 ; + sh:name "source" ; + sh:order 1 ; + sh:path reproschema:source ], + [ sh:datatype xsd:string ; + sh:description "The value for each option in choices or in additionalNotesObj" ; + sh:maxCount 1 ; + sh:name "value" ; + sh:order 2 ; + sh:path schema1:value ], + [ sh:datatype xsd:string ; + sh:description "An element to define the column name where the note was taken from." ; + sh:maxCount 1 ; + sh:name "column" ; + sh:order 0 ; + sh:path reproschema:column ] ; + sh:targetClass reproschema:AdditionalNoteObj . -reproschema:DisableBack a sh:NodeShape ; +reproschema:Choice a sh:NodeShape ; sh:closed true ; - sh:description "['Indicates (by boolean) if we can go back to a completed assessment in a protocol.']" ; + sh:description "An object to describe a response option." ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Disable redo" ; - sh:targetClass reproschema:DisableBack . + sh:name "Response choice" ; + sh:property [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path schema1:image ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 0 ; + sh:path schema1:name ], + [ sh:datatype xsd:string ; + sh:description "The value for each option in choices or in additionalNotesObj" ; + sh:maxCount 1 ; + sh:name "value" ; + sh:order 2 ; + sh:path schema1:value ] ; + sh:targetClass reproschema:Choice . -reproschema:Protocol a sh:NodeShape ; +reproschema:Field a sh:NodeShape ; sh:closed true ; - sh:description "['A representation of a study which comprises one or more assessments.']" ; + sh:description "An item in an assessment." ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Protocol" ; - sh:property [ sh:description "['An element (by URL) to point to the protocol readme or landing page.']" ; + sh:name "Item in an activity" ; + sh:property [ sh:datatype xsd:string ; + sh:description "The alternate label." ; sh:maxCount 1 ; - sh:name "Landing page content" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype xsd:string ] [ sh:node reproschema:LandingPage ] ) ; - sh:order 6 ; - sh:path reproschema:landingPage ], - [ sh:datatype rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:order 8 ; - sh:path skos:prefLabel ], + sh:name "alternate label" ; + sh:order 2 ; + sh:path skos:altLabel ], [ sh:datatype xsd:string ; - sh:description "['The subject matter of the Field.']" ; + sh:description "An element (object or by URL)to describe the properties of response of the Item." ; sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], + sh:name "Response options" ; + sh:order 12 ; + sh:path reproschema:responseOptions ], + [ sh:datatype xsd:string ; + sh:description "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." ; + sh:name "additional notes" ; + sh:order 1 ; + sh:path reproschema:additionalNotesObj ], + [ sh:class rdf:langString ; + sh:description "The preamble for an assessment" ; + sh:name "Preamble" ; + sh:nodeKind sh:BlankNode ; + sh:order 9 ; + sh:path reproschema:preamble ], + [ sh:maxCount 1 ; + sh:order 18 ; + sh:path rdf:type ], [ sh:datatype xsd:string ; - sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; sh:name "associatedMedia" ; - sh:order 2 ; + sh:order 3 ; sh:path schema1:associatedMedia ], [ sh:datatype xsd:string ; - sh:description "['TODO not described in reproschema']" ; + sh:description "TODO" ; sh:maxCount 1 ; - sh:name "cronTable" ; + sh:name "audio" ; sh:order 4 ; - sh:path reproschema:cronTable ], - [ sh:description "['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. ']" ; - sh:name "computation" ; - sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; - sh:order 3 ; - sh:path reproschema:compute ], - [ sh:datatype rdf:langString ; + sh:path schema1:audio ], + [ sh:class schema1:VideoObject ; sh:maxCount 1 ; - - sh:order 5 ; - sh:path schema1:description ], - [ sh:datatype rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 16 ; + sh:path schema1:video ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; - - sh:order 11 ; + sh:order 13 ; + sh:path schema1:schemaVersion ], + [ sh:class reproschema:Activity ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path schema1:isPartOf ], + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 6 ; + sh:path schema1:image ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 17 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 15 ; sh:path schema1:version ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 14 ; + sh:path reproschema:ui ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 11 ; + sh:path schema1:question ], + [ sh:datatype xsd:anyURI ; + sh:description "An image url." ; + sh:maxCount 1 ; + sh:name "imageUrl" ; + sh:order 7 ; + sh:path reproschema:imageUrl ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path schema1:description ], [ sh:datatype xsd:string ; - sh:description "['The alternate label.']" ; + sh:description "The subject matter of the Field." ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ] ; + sh:targetClass reproschema:Field . + +reproschema:LandingPage a sh:NodeShape ; + sh:closed true ; + sh:description "An object to define the landing page of a protocol." ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Landing Page" ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:inLanguage ], + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:name "alternate label" ; sh:order 1 ; - sh:path skos:altLabel ], - [ sh:node reproschema:UiProtocol ; - sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; + sh:path schema1:id ] ; + sh:targetClass reproschema:LandingPage . + +reproschema:Protocol a sh:NodeShape ; + sh:closed true ; + sh:description "A representation of a study which comprises one or more assessments." ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Protocol" ; + sh:property [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path schema1:description ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; sh:name "UI" ; - + sh:nodeKind sh:BlankNode ; sh:order 10 ; sh:path reproschema:ui ], - [ sh:node reproschema:MessageSpecification ; - sh:description "['An array of objects to define conditional messages in an activity or protocol.']" ; + [ sh:datatype xsd:string ; + sh:description "The subject matter of the Field." ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:description "The alternate label." ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 1 ; + sh:path skos:altLabel ], + [ sh:maxCount 1 ; + sh:order 13 ; + sh:path rdf:type ], + [ sh:datatype xsd:string ; + sh:description "TODO not described in reproschema" ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 4 ; + sh:path reproschema:cronTable ], + [ sh:datatype xsd:string ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; + sh:maxCount 1 ; + sh:name "associatedMedia" ; + sh:order 2 ; + sh:path schema1:associatedMedia ], + [ sh:datatype xsd:string ; + sh:description "An element (by URL) to point to the protocol readme or landing page." ; + sh:maxCount 1 ; + sh:name "Landing page content" ; + sh:order 6 ; + sh:path reproschema:landingPage ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 11 ; + sh:path schema1:version ], + [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; sh:name "messages" ; - + sh:nodeKind sh:BlankNode ; sh:order 7 ; sh:path reproschema:messages ], - [ sh:datatype rdf:langString ; + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 12 ; + sh:path schema1:id ], + [ sh:class reproschema:ComputeSpecification ; + sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; + sh:name "computation" ; + sh:nodeKind sh:BlankNode ; + sh:order 3 ; + sh:path reproschema:compute ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:order 9 ; sh:path schema1:schemaVersion ] ; sh:targetClass reproschema:Protocol . reproschema:Response a sh:NodeShape ; sh:closed true ; - sh:description "['Describes the response of an item.']" ; + sh:description "Describes the response of an item." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response" ; - sh:property [ sh:description "['A pointer to the node describing the item.']" ; + sh:property [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path schema1:id ], + [ sh:class reproschema:Participant ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 2 ; + sh:path prov:wasAttributedTo ], + [ sh:datatype xsd:string ; + sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; - sh:name "isAbout" ; - sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 0 ; - sh:path reproschema:isAbout ], - [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; sh:name "value" ; - sh:or ( [ sh:node reproschema:Skipped ] [ sh:node reproschema:DontKnow ] [ sh:datatype xsd:decimal ] [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] [ sh:node schema1:StructuredValue ] ) ; sh:order 1 ; - sh:path reproschema:value ], - [ sh:node reproschema:Participant ; + sh:path schema1:value ], + [ sh:maxCount 1 ; + sh:order 4 ; + sh:path rdf:type ], + [ sh:datatype xsd:string ; + sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; - - sh:order 2 ; - sh:path prov:wasAttributedTo ] ; + sh:name "isAbout" ; + sh:order 0 ; + sh:path reproschema:isAbout ] ; sh:targetClass reproschema:Response . reproschema:ResponseActivity a sh:NodeShape ; sh:closed true ; - sh:description "['Captures information about some action that took place. It also links to information (entities) that were used during the activity']" ; + sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; sh:name "ResponseActivity" ; - sh:property [ sh:datatype rdf:langString ; - - sh:order 2 ; - sh:path schema1:inLanguage ], - [ sh:node reproschema:SoftwareAgent ; + sh:property [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - - sh:order 5 ; - sh:path prov:wasAssociatedWith ], + sh:order 1 ; + sh:path prov:generated ], [ sh:datatype xsd:dateTime ; sh:maxCount 1 ; sh:order 3 ; sh:path prov:startedAtTime ], - [ sh:nodeKind sh:IRI ; + [ sh:maxCount 1 ; + sh:order 7 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 6 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; sh:order 4 ; sh:path prov:used ], - [ sh:datatype rdf:langString ; + [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:order 1 ; - sh:path prov:generated ], + sh:order 2 ; + sh:path schema1:inLanguage ], [ sh:datatype xsd:dateTime ; sh:maxCount 1 ; sh:order 0 ; - sh:path prov:endedAtTime ] ; + sh:path prov:endedAtTime ], + [ sh:class reproschema:SoftwareAgent ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path prov:wasAssociatedWith ] ; sh:targetClass reproschema:ResponseActivity . -reproschema:TimedOut a sh:NodeShape ; - sh:closed true ; - sh:description "['A boolean element to describe if the response did not occur within the prescribed time.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response timed out" ; - sh:targetClass reproschema:TimedOut . - -prov:Agent a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass prov:Agent . - -schema1:VideoObject a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Video Object" ; - sh:property [ sh:datatype rdf:langString ; - - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ] ; - sh:targetClass schema1:VideoObject . - -reproschema:AdditionalNoteObj a sh:NodeShape ; +reproschema:ResponseOption a sh:NodeShape ; sh:closed true ; - sh:description "['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']" ; + sh:description "An element (object or by URL)to describe the properties of response of the Item." ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Additional Notes Object" ; + sh:name "Response option" ; sh:property [ sh:datatype xsd:string ; - sh:description "['An element to define the source (eg. RedCap, NDA) where the note was taken from.']" ; - sh:name "source" ; - sh:order 1 ; - sh:path reproschema:source ], - [ sh:datatype xsd:string ; - sh:description "['An element to define the column name where the note was taken from.']" ; - sh:name "column" ; - sh:order 0 ; - sh:path reproschema:column ], - [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; - sh:name "value" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; - sh:order 2 ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:AdditionalNoteObj . - -reproschema:Choice a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to describe a response option.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response choice" ; - sh:property [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; - sh:name "value" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:decimal ] [ sh:node schema1:StructuredValue ] [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] [ sh:datatype xsd:anyURI ] ) ; - sh:order 2 ; - sh:path reproschema:value ], - [ sh:datatype rdf:langString ; - - sh:order 0 ; - sh:path schema1:name ], - [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; sh:maxCount 1 ; - sh:name "image" ; - sh:order 1 ; - sh:path schema1:image ] ; - sh:targetClass reproschema:Choice . - -reproschema:DontKnow a sh:NodeShape ; - sh:closed true ; - sh:description "['An element to describe the choice when response is not known.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Do not know" ; - sh:targetClass reproschema:DontKnow . - -reproschema:LandingPage a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to define the landing page of a protocol.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Landing Page" ; - sh:property [ sh:datatype rdf:langString ; - - sh:order 0 ; - sh:path schema1:inLanguage ] ; - sh:targetClass reproschema:LandingPage . - -reproschema:Participant a sh:NodeShape ; - sh:closed true ; - sh:description "['An Agent describing characteristics associated with a participant.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Participant" ; - sh:property [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - - sh:order 0 ; - sh:path nidm:subject_id ] ; - sh:targetClass reproschema:Participant . - -reproschema:ResponseOption a sh:NodeShape ; - sh:closed true ; - sh:description "['An element (object or by URL)to describe the properties of response of the Field item.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response option" ; - sh:property [ sh:datatype xsd:boolean ; - sh:description "['Indicates (by bool) if response for the Field item has one or more answer.']" ; - sh:maxCount 1 ; - sh:name "Multiple choice response expectation" ; - sh:order 4 ; - sh:path reproschema:multipleChoice ], - [ sh:node reproschema:UnitOption ; - sh:description "['A list of objects to represent a human displayable name alongside the more formal value for units.']" ; + sh:order 3 ; + sh:path schema1:minValue ], + [ sh:class reproschema:UnitOption ; + sh:description "A list of objects to represent a human displayable name alongside the more formal value for units." ; sh:name "unitOptions" ; - + sh:nodeKind sh:BlankNode ; sh:order 5 ; sh:path reproschema:unitOptions ], - [ sh:description "['An array to list the available options for response of the Field item.']" ; - sh:name "choices" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Choice ] ) ; - sh:order 0 ; - sh:path reproschema:choices ], - [ sh:nodeKind sh:IRI ; - sh:description "['The type of the response of an item. For example, string, integer, etc.']" ; + [ sh:datatype xsd:string ; + sh:description "The type of the response of an item. For example, string, integer, etc." ; + sh:maxCount 1 ; sh:name "The type of the response" ; sh:order 6 ; sh:path reproschema:valueType ], - [ sh:description "['Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item.']" ; + [ sh:datatype xsd:string ; + sh:description "An array to list the available options for response of the Item." ; + sh:name "choices" ; + sh:order 0 ; + sh:path reproschema:choices ], + [ sh:datatype xsd:string ; + sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; sh:maxCount 1 ; sh:name "datumType" ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype xsd:anyURI ] ) ; sh:order 1 ; sh:path reproschema:datumType ], - [ sh:maxCount 1 ; - sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; + [ sh:datatype xsd:string ; + sh:maxCount 1 ; sh:order 2 ; sh:path schema1:maxValue ], - [ sh:maxCount 1 ; - sh:or ( [ sh:datatype xsd:float ] [ sh:datatype xsd:integer ] ) ; - sh:order 3 ; - sh:path schema1:minValue ] ; + [ sh:datatype xsd:boolean ; + sh:description "Indicates (by bool) if response for the Item has one or more answer." ; + sh:maxCount 1 ; + sh:name "Multiple choice response expectation" ; + sh:order 4 ; + sh:path reproschema:multipleChoice ] ; sh:targetClass reproschema:ResponseOption . -reproschema:Skipped a sh:NodeShape ; +prov:Agent a sh:NodeShape ; sh:closed true ; - sh:description "['An element to describe the choice when the item is skipped.']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Skipped" ; - sh:targetClass reproschema:Skipped . + sh:targetClass prov:Agent . -reproschema:SoftwareAgent a sh:NodeShape ; +schema1:VideoObject a sh:NodeShape ; sh:closed true ; - sh:description "['Captures information about some action that took place. It also links to information (entities) that were used during the activity']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Software Agent" ; - sh:property [ sh:nodeKind sh:IRI ; + sh:name "Video Object" ; + sh:property [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 1 ; - sh:path schema1:url ], - [ sh:datatype rdf:langString ; + sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - + sh:order 2 ; + sh:path schema1:id ], + [ sh:maxCount 1 ; + sh:minCount 1 ; sh:order 0 ; - sh:path schema1:version ] ; - sh:targetClass reproschema:SoftwareAgent . + sh:path schema1:contentUrl ] ; + sh:targetClass schema1:VideoObject . -reproschema:UiActivity a sh:NodeShape ; +reproschema:Activity a sh:NodeShape ; sh:closed true ; - sh:description "['todo']" ; + sh:description "An assessment in a protocol." ; sh:ignoredProperties ( rdf:type ) ; - sh:name "todo" ; - sh:property [ sh:node schema1:Thing ; - sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; - sh:name "allow" ; - - sh:order 4 ; - sh:path reproschema:allow ], - [ sh:description "['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']" ; - sh:name "Order" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 0 ; - sh:path reproschema:order ], - [ sh:node reproschema:OverrideProperty ; - sh:description "['An array of objects to override the various properties added to assessments and fields.']" ; - sh:name "overrideProperties" ; - - sh:order 2 ; - sh:path reproschema:overrideProperties ], - [ sh:node reproschema:AdditionalProperty ; - sh:description "['An array of objects to describe the various properties added to assessments and fields.']" ; - sh:name "addProperties" ; - - sh:order 1 ; - sh:path reproschema:addProperties ], - [ sh:datatype xsd:boolean ; - sh:description "['An element (bool) to determine if the list of items is shuffled or in order.']" ; + sh:name "Activity" ; + sh:property [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:order 3 ; - sh:path reproschema:shuffle ] ; - sh:targetClass reproschema:UiActivity . - -reproschema:UiField a sh:NodeShape ; - sh:closed true ; - sh:description "['todo']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "todo" ; - sh:property [ sh:datatype xsd:boolean ; + sh:order 14 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:readonlyValue ], + sh:order 13 ; + sh:path schema1:version ], [ sh:datatype xsd:string ; - sh:description "['An element to describe the input type of a Field item.']" ; + sh:description "The subject matter of the Field." ; sh:maxCount 1 ; - sh:name "inputType" ; sh:order 0 ; - sh:path reproschema:inputType ] ; - sh:targetClass reproschema:UiField . - -reproschema:UiProtocol a sh:NodeShape ; - sh:closed true ; - sh:description "['todo']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "todo" ; - sh:property [ sh:node schema1:Thing ; - sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; - sh:name "allow" ; - + sh:path schema1:about ], + [ sh:class reproschema:ComputeSpecification ; + sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; + sh:name "computation" ; + sh:nodeKind sh:BlankNode ; sh:order 4 ; - sh:path reproschema:allow ], - [ sh:node reproschema:OverrideProperty ; - sh:description "['An array of objects to override the various properties added to assessments and fields.']" ; - sh:name "overrideProperties" ; - - sh:order 2 ; - sh:path reproschema:overrideProperties ], - [ sh:description "['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']" ; - sh:name "Order" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 0 ; - sh:path reproschema:order ], - [ sh:node reproschema:AdditionalProperty ; - sh:description "['An array of objects to describe the various properties added to assessments and fields.']" ; - sh:name "addProperties" ; - - sh:order 1 ; - sh:path reproschema:addProperties ], - [ sh:datatype xsd:boolean ; - sh:description "['An element (bool) to determine if the list of items is shuffled or in order.']" ; + sh:path reproschema:compute ], + [ sh:datatype xsd:string ; + sh:description "The alternate label." ; sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:order 3 ; - sh:path reproschema:shuffle ] ; - sh:targetClass reproschema:UiProtocol . - -reproschema:UnitOption a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to represent a human displayable name alongside the more formal value for units.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Unit options" ; - sh:property [ sh:description "['The value for each option in choices or in additionalNotesObj']" ; - sh:name "value" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:datatype rdf:langString ] ) ; + sh:name "alternate label" ; sh:order 1 ; - sh:path reproschema:value ], - [ sh:datatype rdf:langString ; + sh:path skos:altLabel ], + [ sh:class rdf:langString ; + sh:description "The preamble for an assessment" ; + sh:name "Preamble" ; + sh:nodeKind sh:BlankNode ; + sh:order 9 ; + sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; + sh:maxCount 1 ; + sh:name "associatedMedia" ; + sh:order 2 ; + sh:path schema1:associatedMedia ], + [ sh:datatype xsd:string ; + sh:description "TODO not described in reproschema" ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 5 ; + sh:path reproschema:cronTable ], + [ sh:class rdf:langString ; sh:description "['The preferred label.']" ; sh:name "preferred label" ; - - sh:order 0 ; - sh:path skos:prefLabel ] ; - sh:targetClass reproschema:UnitOption . + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path skos:prefLabel ], + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 7 ; + sh:path schema1:image ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 6 ; + sh:path schema1:description ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 11 ; + sh:path schema1:schemaVersion ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 3 ; + sh:path schema1:citation ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 12 ; + sh:path reproschema:ui ], + [ sh:maxCount 1 ; + sh:order 15 ; + sh:path rdf:type ], + [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; + sh:name "messages" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path reproschema:messages ] ; + sh:targetClass reproschema:Activity . reproschema:AdditionalProperty a sh:NodeShape ; sh:closed true ; - sh:description "['An object to describe the various properties added to assessments and fields.']" ; + sh:description "An object to describe the various properties added to assessments and Items." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:description "['A pointer to the node describing the item.']" ; + sh:property [ sh:class rdf:langString ; + sh:description "The name used to represent an item." ; sh:maxCount 1 ; - sh:name "isAbout" ; - sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; - sh:order 1 ; - sh:path reproschema:isAbout ], - [ sh:datatype rdf:langString ; - sh:description "['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']" ; + sh:name "variableName" ; + sh:nodeKind sh:BlankNode ; + sh:order 9 ; + sh:path reproschema:variableName ], + [ sh:datatype xsd:string ; + sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; sh:name "limit" ; - sh:order 3 ; sh:path reproschema:limit ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 8 ; - sh:path schema1:valueRequired ], - [ sh:node schema1:Thing ; - sh:description "['An array of items indicating properties allowed on an activity or protocol ']" ; + [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; + sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; sh:name "allow" ; - sh:order 0 ; sh:path reproschema:allow ], - [ sh:datatype rdf:langString ; - sh:description "['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']" ; - sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - - sh:order 6 ; - sh:path reproschema:randomMaxDelay ], - [ sh:datatype rdf:langString ; + [ sh:class rdf:langString ; sh:description "['The preferred label.']" ; sh:name "preferred label" ; - + sh:nodeKind sh:BlankNode ; sh:order 5 ; sh:path skos:prefLabel ], - [ sh:description "['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']" ; + [ sh:datatype xsd:string ; + sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 6 ; + sh:path reproschema:randomMaxDelay ], + [ sh:datatype xsd:string ; + sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; sh:maxCount 1 ; sh:name "Schedule" ; - sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; sh:order 7 ; sh:path reproschema:schedule ], - [ sh:datatype rdf:langString ; - sh:description "['The name used to represent an item.']" ; - sh:maxCount 1 ; - sh:name "variableName" ; - - sh:order 9 ; - sh:path reproschema:variableName ], - [ sh:description "['Defines number of times the item is allowed to be redone.']" ; + [ sh:datatype xsd:string ; + sh:description "Defines number of times the item is allowed to be redone." ; sh:maxCount 1 ; sh:name "maxRetakes" ; - sh:or ( [ sh:datatype xsd:decimal ] ) ; sh:order 4 ; sh:path reproschema:maxRetakes ], - [ sh:description "['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']" ; + [ sh:datatype xsd:string ; + sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; sh:maxCount 1 ; sh:name "visibility" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; sh:order 2 ; - sh:path reproschema:isVis ] ; - sh:targetClass reproschema:AdditionalProperty . - -reproschema:ComputeSpecification a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to define computations in an activity or protocol.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Compute Specification" ; - sh:property [ sh:datatype rdf:langString ; - sh:description "['The name used to represent an item.']" ; + sh:path reproschema:isVis ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; - sh:name "variableName" ; - - sh:order 1 ; - sh:path reproschema:variableName ], - [ sh:description "['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']" ; + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path reproschema:ui ], + [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype rdf:langString ] ) ; - sh:order 0 ; - sh:path reproschema:jsExpression ] ; - sh:targetClass reproschema:ComputeSpecification . - -reproschema:MessageSpecification a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to define messages in an activity or protocol.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Message Specification" ; - sh:property [ sh:description "['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']" ; + sh:order 8 ; + sh:path schema1:valueRequired ], + [ sh:datatype xsd:string ; + sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype rdf:langString ] ) ; - sh:order 0 ; - sh:path reproschema:jsExpression ], - [ sh:datatype rdf:langString ; - sh:description "['The message to be conditionally displayed for an item. ']" ; - sh:name "Message" ; - + sh:name "isAbout" ; sh:order 1 ; - sh:path reproschema:message ] ; - sh:targetClass reproschema:MessageSpecification . + sh:path reproschema:isAbout ] ; + sh:targetClass reproschema:AdditionalProperty . reproschema:OverrideProperty a sh:NodeShape ; sh:closed true ; - sh:description "['An object to override the various properties added to assessments and fields.']" ; + sh:description "An object to override the various properties added to assessments and Items." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:datatype rdf:langString ; - sh:description "['The name used to represent an item.']" ; - sh:maxCount 1 ; - sh:name "variableName" ; - - sh:order 8 ; - sh:path reproschema:variableName ], - [ sh:description "['Defines number of times the item is allowed to be redone.']" ; - sh:maxCount 1 ; - sh:name "maxRetakes" ; - sh:or ( [ sh:datatype xsd:decimal ] ) ; - sh:order 3 ; - sh:path reproschema:maxRetakes ], - [ sh:datatype rdf:langString ; - sh:description "['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']" ; + sh:property [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 4 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; sh:name "limit" ; - sh:order 2 ; sh:path reproschema:limit ], - [ sh:datatype rdf:langString ; - sh:description "['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']" ; + [ sh:datatype xsd:string ; + sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; sh:maxCount 1 ; sh:name "randomMaxDelay" ; - sh:order 5 ; sh:path reproschema:randomMaxDelay ], - [ sh:description "['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']" ; + [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:name "visibility" ; - sh:or ( [ sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ) ; - sh:order 1 ; - sh:path reproschema:isVis ], - [ sh:description "['A pointer to the node describing the item.']" ; + sh:order 7 ; + sh:path schema1:valueRequired ], + [ sh:datatype xsd:string ; + sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; sh:name "isAbout" ; - sh:or ( [ sh:node reproschema:Activity ] [ sh:node reproschema:Field ] ) ; sh:order 0 ; sh:path reproschema:isAbout ], - [ sh:description "['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']" ; + [ sh:class rdf:langString ; + sh:description "The name used to represent an item." ; + sh:maxCount 1 ; + sh:name "variableName" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path reproschema:variableName ], + [ sh:datatype xsd:string ; + sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; sh:maxCount 1 ; sh:name "Schedule" ; - sh:or ( [ sh:node reproschema:Schedule ] [ sh:datatype xsd:string ] ) ; sh:order 6 ; sh:path reproschema:schedule ], - [ sh:datatype xsd:boolean ; + [ sh:datatype xsd:string ; + sh:description "Defines number of times the item is allowed to be redone." ; sh:maxCount 1 ; - sh:order 7 ; - sh:path schema1:valueRequired ], - [ sh:datatype rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - - sh:order 4 ; - sh:path skos:prefLabel ] ; + sh:name "maxRetakes" ; + sh:order 3 ; + sh:path reproschema:maxRetakes ], + [ sh:datatype xsd:string ; + sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; + sh:maxCount 1 ; + sh:name "visibility" ; + sh:order 1 ; + sh:path reproschema:isVis ] ; sh:targetClass reproschema:OverrideProperty . -reproschema:Schedule a sh:NodeShape ; - sh:closed true ; - sh:description "['An object to define the schedule of an activity or protocol.']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Schedule" ; - sh:targetClass reproschema:Schedule . - -schema1:StructuredValue a sh:NodeShape ; +reproschema:Participant a sh:NodeShape ; sh:closed true ; + sh:description "An Agent describing characteristics associated with a participant." ; sh:ignoredProperties ( rdf:type ) ; - sh:targetClass schema1:StructuredValue . + sh:name "Participant" ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path nidm:subject_id ] ; + sh:targetClass reproschema:Participant . -schema1:Thing a sh:NodeShape ; +reproschema:SoftwareAgent a sh:NodeShape ; sh:closed true ; + sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; - sh:targetClass schema1:Thing . + sh:name "Software Agent" ; + sh:property [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:version ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:url ] ; + sh:targetClass reproschema:SoftwareAgent . -reproschema:Field a sh:NodeShape ; +reproschema:UnitOption a sh:NodeShape ; sh:closed true ; - sh:description "['An item in an assessment.']" ; + sh:description "An object to represent a human displayable name alongside the more formal value for units." ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Field" ; - sh:property [ sh:node schema1:VideoObject ; - sh:maxCount 1 ; - - sh:order 16 ; - sh:path schema1:video ], - [ sh:datatype xsd:string ; - sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 3 ; - sh:path schema1:associatedMedia ], - [ sh:description "['An element (object or by URL)to describe the properties of response of the Field item.']" ; - sh:maxCount 1 ; - sh:name "Response options" ; - sh:or ( [ sh:datatype xsd:anyURI ] [ sh:node reproschema:ResponseOption ] ) ; - sh:order 12 ; - sh:path reproschema:responseOptions ], - [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; - sh:maxCount 1 ; - sh:name "image" ; - sh:order 6 ; - sh:path schema1:image ], - [ sh:nodeKind sh:IRI ; - sh:description "['An image url.']" ; - sh:maxCount 1 ; - sh:name "imageUrl" ; - sh:order 7 ; - sh:path reproschema:imageUrl ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - - sh:order 13 ; - sh:path schema1:schemaVersion ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - - sh:order 15 ; - sh:path schema1:version ], - [ sh:datatype rdf:langString ; - sh:description "['The preamble for an assessment']" ; - sh:name "Preamble" ; - - sh:order 9 ; - sh:path reproschema:preamble ], - [ sh:datatype rdf:langString ; + sh:name "Unit options" ; + sh:property [ sh:class rdf:langString ; sh:description "['The preferred label.']" ; sh:name "preferred label" ; - - sh:order 10 ; + sh:nodeKind sh:BlankNode ; + sh:order 0 ; sh:path skos:prefLabel ], - [ sh:description "['TDOO']" ; - sh:maxCount 1 ; - sh:name "audio" ; - sh:order 4 ; - sh:path schema1:audio ], - [ sh:node reproschema:UiField ; - sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; - sh:maxCount 1 ; - sh:name "UI" ; - - sh:order 14 ; - sh:path reproschema:ui ], [ sh:datatype xsd:string ; - sh:description "['The subject matter of the Field.']" ; + sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; + sh:name "value" ; + sh:order 1 ; + sh:path schema1:value ] ; + sh:targetClass reproschema:UnitOption . + +reproschema:ComputeSpecification a sh:NodeShape ; + sh:closed true ; + sh:description "An object to define computations in an activity or protocol." ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Compute Specification" ; + sh:property [ sh:datatype xsd:string ; + sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; + sh:maxCount 1 ; + sh:name "JavaScript Expression" ; sh:order 0 ; - sh:path schema1:about ], - [ sh:datatype xsd:string ; - sh:description "['The alternate label.']" ; + sh:path reproschema:jsExpression ], + [ sh:class rdf:langString ; + sh:description "The name used to represent an item." ; sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 2 ; - sh:path skos:altLabel ], - [ sh:datatype rdf:langString ; - - sh:order 11 ; - sh:path schema1:question ], - [ sh:datatype rdf:langString ; + sh:name "variableName" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path reproschema:variableName ] ; + sh:targetClass reproschema:ComputeSpecification . + +reproschema:MessageSpecification a sh:NodeShape ; + sh:closed true ; + sh:description "An object to define messages in an activity or protocol." ; + sh:ignoredProperties ( rdf:type ) ; + sh:name "Message Specification" ; + sh:property [ sh:class rdf:langString ; + sh:description "The message to be conditionally displayed for an item." ; + sh:name "Message" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path reproschema:message ], + [ sh:datatype xsd:string ; + sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; sh:maxCount 1 ; - - sh:order 5 ; - sh:path schema1:description ], - [ sh:node reproschema:Activity ; + sh:name "JavaScript Expression" ; + sh:order 0 ; + sh:path reproschema:jsExpression ] ; + sh:targetClass reproschema:MessageSpecification . + +schema1:ImageObject a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype xsd:string ; sh:maxCount 1 ; - - sh:order 8 ; - sh:path schema1:isPartOf ], - [ sh:description "['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.']" ; - sh:name "additional notes" ; - sh:or ( [ sh:node reproschema:AdditionalNoteObj ] ) ; sh:order 1 ; - sh:path reproschema:additionalNotesObj ] ; - sh:targetClass reproschema:Field . + sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ], + [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ] ; + sh:targetClass schema1:ImageObject . -reproschema:Activity a sh:NodeShape ; +reproschema:UI a sh:NodeShape ; sh:closed true ; - sh:description "['An assessment in a protocol.']" ; + sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; - sh:name "Activity" ; - sh:property [ sh:description "['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. ']" ; - sh:name "computation" ; - sh:or ( [ sh:node reproschema:ComputeSpecification ] ) ; + sh:name "todo" ; + sh:property [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; + sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; + sh:name "allow" ; sh:order 4 ; - sh:path reproschema:compute ], - [ sh:datatype rdf:langString ; - sh:description "['The preamble for an assessment']" ; - sh:name "Preamble" ; - - sh:order 9 ; - sh:path reproschema:preamble ], - [ sh:description "['An image of the item. This can be a URL or a fully described ImageObject.']" ; - sh:maxCount 1 ; - sh:name "image" ; - sh:order 7 ; - sh:path schema1:image ], + sh:path reproschema:allow ], [ sh:datatype xsd:string ; - sh:description "['The subject matter of the Field.']" ; - sh:maxCount 1 ; + sh:description "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." ; + sh:name "Order" ; sh:order 0 ; - sh:path schema1:about ], + sh:path reproschema:order ], + [ sh:class reproschema:OverrideProperty ; + sh:description "An array of objects to override the various properties added to assessments and fields." ; + sh:name "overrideProperties" ; + sh:nodeKind sh:BlankNode ; + sh:order 2 ; + sh:path reproschema:overrideProperties ], [ sh:datatype xsd:string ; - sh:description "['TODO not described in reproschema']" ; + sh:description "An element to describe the input type of a Item." ; sh:maxCount 1 ; - sh:name "cronTable" ; + sh:name "inputType" ; sh:order 5 ; - sh:path reproschema:cronTable ], - [ sh:datatype rdf:langString ; + sh:path reproschema:inputType ], + [ sh:datatype xsd:boolean ; + sh:description "An element (bool) to determine if the list of items is shuffled or in order." ; sh:maxCount 1 ; - + sh:name "Shuffle" ; sh:order 3 ; - sh:path schema1:citation ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - - sh:order 13 ; - sh:path schema1:version ], - [ sh:datatype xsd:string ; - sh:description "['The alternate label.']" ; - sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 1 ; - sh:path skos:altLabel ], - [ sh:datatype rdf:langString ; + sh:path reproschema:shuffle ], + [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:description ], - [ sh:node reproschema:UiActivity ; - sh:description "['it was originally @nest in jsonld, but decided for a new class for now']" ; - sh:maxCount 1 ; - sh:name "UI" ; - - sh:order 12 ; - sh:path reproschema:ui ], - [ sh:datatype rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - - sh:order 10 ; - sh:path skos:prefLabel ], - [ sh:node reproschema:MessageSpecification ; - sh:description "['An array of objects to define conditional messages in an activity or protocol.']" ; - sh:name "messages" ; - - sh:order 8 ; - sh:path reproschema:messages ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - - sh:order 11 ; - sh:path schema1:schemaVersion ], - [ sh:datatype xsd:string ; - sh:description "['A media object that encodes this CreativeWork. This property is a synonym for encoding.']" ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 2 ; - sh:path schema1:associatedMedia ] ; - sh:targetClass reproschema:Activity . + sh:path schema1:readonlyValue ], + [ sh:class reproschema:AdditionalProperty ; + sh:description "An array of objects to describe the various properties added to assessments and Items." ; + sh:name "addProperties" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path reproschema:addProperties ] ; + sh:targetClass reproschema:UI . rdf:langString a sh:NodeShape ; sh:closed true ; + sh:description "RDF langString tuple" ; sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:datatype xsd:string ; + sh:description "The value component of a langString." ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 1 ; + sh:path ], + [ sh:datatype xsd:string ; + sh:description "The language prefix component of a langString." ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path ] ; sh:targetClass rdf:langString . diff --git a/linkml-schema/reproschema.py b/linkml-schema/reproschema.py index 279e070ad1..c845385df0 100644 --- a/linkml-schema/reproschema.py +++ b/linkml-schema/reproschema.py @@ -1,10 +1,10 @@ from __future__ import annotations from datetime import datetime, date -from decimal import Decimal from enum import Enum +from decimal import Decimal from typing import List, Dict, Optional, Any, Union -import pydantic as pyd +from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator import re import sys if sys.version_info >= (3, 8): @@ -16,299 +16,308 @@ metamodel_version = "None" version = "None" -class ConfiguredBaseModel(pyd.BaseModel): - model_config = pyd.ConfigDict( +class ConfiguredBaseModel(BaseModel): + model_config = ConfigDict( validate_assignment=True, validate_default=True, extra = 'forbid', arbitrary_types_allowed=True, use_enum_values = True) + pass + -class AdditionalNoteObj(ConfiguredBaseModel): - """ - ['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'] - """ - column: Optional[List[str]] = pyd.Field(default_factory=list, title="column", description="""['An element to define the column name where the note was taken from.']""") - source: Optional[List[str]] = pyd.Field(default_factory=list, title="source", description="""['An element to define the source (eg. RedCap, NDA) where the note was taken from.']""") - value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") - +class AllowedType(str, Enum): - -class AdditionalProperty(ConfiguredBaseModel): - """ - ['An object to describe the various properties added to assessments and fields.'] - """ - allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") - isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") - isVis: Optional[Union[bool, str]] = pyd.Field(None, title="visibility", description="""['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']""") - limit: Optional[LangString] = pyd.Field(None, title="limit", description="""['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']""") - maxRetakes: Optional[Decimal] = pyd.Field(None, title="maxRetakes", description="""['Defines number of times the item is allowed to be redone.']""") - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - randomMaxDelay: Optional[LangString] = pyd.Field(None, title="randomMaxDelay", description="""['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']""") - schedule: Optional[Union[Schedule, str]] = pyd.Field(None, title="Schedule", description="""['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']""") - valueRequired: Optional[bool] = pyd.Field(None) - variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") + # Indicates (by boolean) if data can be exported or not. + AllowExport = "AllowExport" + # Indicates (by boolean) if items can be replayed or not. + AllowReplay = "AllowReplay" + # Indicates (by boolean) if assessments in a protocol can auto advance or not. + AutoAdvance = "AutoAdvance" + # Indicates (by boolean) if we can go back to a completed assessment in a protocol. + DisableBack = "DisableBack" -class Agent(ConfiguredBaseModel): +class MissingType(str, Enum): - None + # An element to describe the choice when the item is skipped. + Skipped = "Skipped" + # An element to describe the choice when response is not known. + DontKnow = "DontKnow" + # An element to describe the choice when the reason for missing response is unknown. + Unknown = "Unknown" + # A boolean element to describe if the response did not occur within the prescribed time. + TimedOut = "TimedOut" -class AllowExport(ConfiguredBaseModel): +class AdditionalNoteObj(ConfiguredBaseModel): """ - ['Indicates (by boolean) if data can be exported or not.'] + A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema """ - None + column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") + source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") + value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") -class AllowReplay(ConfiguredBaseModel): +class AdditionalProperty(ConfiguredBaseModel): """ - ['Indicates (by boolean) if items can be replayed or not.'] + An object to describe the various properties added to assessments and Items. """ - None + allow: Optional[List[AllowedType]] = Field(default_factory=list, title="allow", description="""An array of items indicating properties allowed on an activity or protocol.""") + isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") + isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") + limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") + maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") + schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") + valueRequired: Optional[bool] = Field(None) + variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") -class AutoAdvance(ConfiguredBaseModel): - """ - ['Indicates (by boolean) if assessments in a protocol can auto advance or not.'] - """ +class Agent(ConfiguredBaseModel): + None class Choice(ConfiguredBaseModel): """ - ['An object to describe a response option.'] + An object to describe a response option. """ - name: Optional[List[LangString]] = pyd.Field(default_factory=list) - image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") - value: Optional[List[Union[Decimal, LangString, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") class ComputeSpecification(ConfiguredBaseModel): """ - ['An object to define computations in an activity or protocol.'] + An object to define computations in an activity or protocol. """ - jsExpression: Optional[Union[LangString, bool]] = pyd.Field(None, title="JavaScript Expression", description="""['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']""") - variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") + jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") + variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") class CreativeWork(ConfiguredBaseModel): - None + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) class Activity(CreativeWork): """ - ['An assessment in a protocol.'] - """ - about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") - altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") - associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") - citation: Optional[LangString] = pyd.Field(None) - compute: Optional[List[ComputeSpecification]] = pyd.Field(default_factory=list, title="computation", description="""['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. ']""") - cronTable: Optional[str] = pyd.Field(None, title="cronTable", description="""['TODO not described in reproschema']""") - description: Optional[LangString] = pyd.Field(None) - image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") - messages: Optional[List[MessageSpecification]] = pyd.Field(default_factory=list, title="messages", description="""['An array of objects to define conditional messages in an activity or protocol.']""") - preamble: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Preamble", description="""['The preamble for an assessment']""") - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - schemaVersion: Optional[LangString] = pyd.Field(None) - ui: Optional[UiActivity] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") - version: Optional[LangString] = pyd.Field(None) + An assessment in a protocol. + """ + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + citation: Optional[Dict[str, str]] = Field(default_factory=dict) + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") + preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) + + + +class Item(CreativeWork): + """ + An item in an assessment. + """ + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes", description="""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.""") + altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + audio: Optional[Union[AudioObject, str]] = Field(None, title="audio", description="""TODO""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + imageUrl: Optional[str] = Field(None, title="imageUrl", description="""An image url.""") + isPartOf: Optional[Activity] = Field(None) + preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + question: Optional[Dict[str, str]] = Field(default_factory=dict) + responseOptions: Optional[Union[ResponseOption, str]] = Field(None, title="Response options", description="""An element (object or by URL)to describe the properties of response of the Item.""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + video: Optional[VideoObject] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) -class DisableBack(ConfiguredBaseModel): - """ - ['Indicates (by boolean) if we can go back to a completed assessment in a protocol.'] - """ - None - - - -class DontKnow(ConfiguredBaseModel): +class LandingPage(ConfiguredBaseModel): """ - ['An element to describe the choice when response is not known.'] + An object to define the landing page of a protocol. """ - None + inLanguage: Optional[str] = Field(None) + id: Optional[str] = Field(None) -class Field(CreativeWork): +class LangString(ConfiguredBaseModel): """ - ['An item in an assessment.'] + RDF langString tuple """ - about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") - additionalNotesObj: Optional[List[AdditionalNoteObj]] = pyd.Field(default_factory=list, title="additional notes", description="""['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.']""") - altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") - associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") - audio: Optional[str] = pyd.Field(None, title="audio", description="""['TDOO']""") - description: Optional[LangString] = pyd.Field(None) - image: Optional[str] = pyd.Field(None, title="image", description="""['An image of the item. This can be a URL or a fully described ImageObject.']""") - imageUrl: Optional[str] = pyd.Field(None, title="imageUrl", description="""['An image url.']""") - isPartOf: Optional[Activity] = pyd.Field(None) - preamble: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Preamble", description="""['The preamble for an assessment']""") - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - question: Optional[List[LangString]] = pyd.Field(default_factory=list) - responseOptions: Optional[Union[ResponseOption, str]] = pyd.Field(None, title="Response options", description="""['An element (object or by URL)to describe the properties of response of the Field item.']""") - schemaVersion: Optional[LangString] = pyd.Field(None) - ui: Optional[UiField] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") - version: Optional[LangString] = pyd.Field(None) - video: Optional[VideoObject] = pyd.Field(None) + langstring_prefix: str = Field(..., description="""The language prefix component of a langString.""") + langstring_value: str = Field(..., description="""The value component of a langString.""") -class LandingPage(ConfiguredBaseModel): +class MediaObject(CreativeWork): """ - ['An object to define the landing page of a protocol.'] + Add description """ - inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) + contentUrl: str = Field(...) + inLanguage: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) -class LangString(ConfiguredBaseModel): +class AudioObject(MediaObject): - None + contentUrl: str = Field(...) + inLanguage: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) -class MediaObject(ConfiguredBaseModel): - """ - ['TODO comments'] - """ - contentUrl: str = pyd.Field(...) - inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) +class ImageObject(MediaObject): + + contentUrl: str = Field(...) + inLanguage: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) class MessageSpecification(ConfiguredBaseModel): """ - ['An object to define messages in an activity or protocol.'] + An object to define messages in an activity or protocol. """ - jsExpression: Optional[Union[LangString, bool]] = pyd.Field(None, title="JavaScript Expression", description="""['A JavaScript expression for computations.', 'A JavaScript expression to compute a score from other variables.']""") - message: Optional[List[LangString]] = pyd.Field(default_factory=list, title="Message", description="""['The message to be conditionally displayed for an item. ']""") + jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") + message: Optional[Dict[str, str]] = Field(default_factory=dict, title="Message", description="""The message to be conditionally displayed for an item.""") class OverrideProperty(ConfiguredBaseModel): """ - ['An object to override the various properties added to assessments and fields.'] + An object to override the various properties added to assessments and Items. """ - isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") - isVis: Optional[Union[bool, str]] = pyd.Field(None, title="visibility", description="""['An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.']""") - limit: Optional[LangString] = pyd.Field(None, title="limit", description="""['An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.']""") - maxRetakes: Optional[Decimal] = pyd.Field(None, title="maxRetakes", description="""['Defines number of times the item is allowed to be redone.']""") - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - randomMaxDelay: Optional[LangString] = pyd.Field(None, title="randomMaxDelay", description="""['Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration']""") - schedule: Optional[Union[Schedule, str]] = pyd.Field(None, title="Schedule", description="""['An element to set make activity available/repeat info using ISO 8601 repeating interval format.']""") - valueRequired: Optional[bool] = pyd.Field(None) - variableName: Optional[LangString] = pyd.Field(None, title="variableName", description="""['The name used to represent an item.']""") + isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") + isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") + limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") + maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") + schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") + valueRequired: Optional[bool] = Field(None) + variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") class Participant(Agent): """ - ['An Agent describing characteristics associated with a participant.'] + An Agent describing characteristics associated with a participant. """ - subject_id: Optional[LangString] = pyd.Field(None) + subject_id: Optional[str] = Field(None) class Protocol(CreativeWork): """ - ['A representation of a study which comprises one or more assessments.'] + A representation of a study which comprises one or more assessments. """ - about: Optional[str] = pyd.Field(None, description="""['The subject matter of the Field.']""") - altLabel: Optional[str] = pyd.Field(None, title="alternate label", description="""['The alternate label.']""") - associatedMedia: Optional[str] = pyd.Field(None, title="associatedMedia", description="""['A media object that encodes this CreativeWork. This property is a synonym for encoding.']""") - compute: Optional[List[ComputeSpecification]] = pyd.Field(default_factory=list, title="computation", description="""['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. ']""") - cronTable: Optional[str] = pyd.Field(None, title="cronTable", description="""['TODO not described in reproschema']""") - description: Optional[LangString] = pyd.Field(None) - landingPage: Optional[Union[LandingPage, str]] = pyd.Field(None, title="Landing page content", description="""['An element (by URL) to point to the protocol readme or landing page.']""") - messages: Optional[List[MessageSpecification]] = pyd.Field(default_factory=list, title="messages", description="""['An array of objects to define conditional messages in an activity or protocol.']""") - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - schemaVersion: Optional[LangString] = pyd.Field(None) - ui: Optional[UiProtocol] = pyd.Field(None, title="UI", description="""['it was originally @nest in jsonld, but decided for a new class for now']""") - version: Optional[LangString] = pyd.Field(None) + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + landingPage: Optional[Union[LandingPage, str]] = Field(None, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) class Response(CreativeWork): """ - ['Describes the response of an item.'] + Describes the response of an item. """ - isAbout: Optional[Union[Activity, Field]] = pyd.Field(None, title="isAbout", description="""['A pointer to the node describing the item.']""") - value: Optional[List[Union[Decimal, DontKnow, Skipped, StructuredValue, bool, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") - wasAttributedTo: Optional[Participant] = pyd.Field(None) + isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") + value: Optional[Union[Decimal, MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + wasAttributedTo: Optional[Participant] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) class ResponseActivity(CreativeWork): """ - ['Captures information about some action that took place. It also links to information (entities) that were used during the activity'] + Captures information about some action that took place. It also links to information (entities) that were used during the activity """ - endedAtTime: Optional[datetime ] = pyd.Field(None) - generated: Optional[LangString] = pyd.Field(None) - inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) - startedAtTime: Optional[datetime ] = pyd.Field(None) - used: Optional[List[str]] = pyd.Field(default_factory=list) - wasAssociatedWith: Optional[SoftwareAgent] = pyd.Field(None) + endedAtTime: Optional[datetime ] = Field(None) + generated: Optional[str] = Field(None) + inLanguage: Optional[str] = Field(None) + startedAtTime: Optional[datetime ] = Field(None) + used: Optional[List[str]] = Field(default_factory=list) + wasAssociatedWith: Optional[SoftwareAgent] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) class ResponseOption(ConfiguredBaseModel): """ - ['An element (object or by URL)to describe the properties of response of the Field item.'] + An element (object or by URL)to describe the properties of response of the Item. """ - choices: Optional[List[Union[Choice, str]]] = pyd.Field(default_factory=list, title="choices", description="""['An array to list the available options for response of the Field item.']""") - datumType: Optional[str] = pyd.Field(None, title="datumType", description="""['Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item.']""") - maxValue: Optional[Union[float, int]] = pyd.Field(None) - minValue: Optional[Union[float, int]] = pyd.Field(None) - multipleChoice: Optional[bool] = pyd.Field(None, title="Multiple choice response expectation", description="""['Indicates (by bool) if response for the Field item has one or more answer.']""") - unitOptions: Optional[List[UnitOption]] = pyd.Field(default_factory=list, title="unitOptions", description="""['A list of objects to represent a human displayable name alongside the more formal value for units.']""") - valueType: Optional[List[str]] = pyd.Field(default_factory=list, title="The type of the response", description="""['The type of the response of an item. For example, string, integer, etc.']""") - - - -class Schedule(ConfiguredBaseModel): - """ - ['An object to define the schedule of an activity or protocol.'] - """ - None - - - -class Skipped(ConfiguredBaseModel): - """ - ['An element to describe the choice when the item is skipped.'] - """ - None + choices: Optional[List[Union[Choice, str]]] = Field(default_factory=list, title="choices", description="""An array to list the available options for response of the Item.""") + datumType: Optional[str] = Field(None, title="datumType", description="""Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item.""") + maxValue: Optional[Union[float, int]] = Field(None) + minValue: Optional[Union[float, int]] = Field(None) + multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") + unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") + valueType: Optional[str] = Field(None, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") class SoftwareAgent(ConfiguredBaseModel): """ - ['Captures information about some action that took place. It also links to information (entities) that were used during the activity'] + Captures information about some action that took place. It also links to information (entities) that were used during the activity """ - version: Optional[LangString] = pyd.Field(None) - url: Optional[str] = pyd.Field(None) + version: Optional[str] = Field(None) + url: Optional[str] = Field(None) -class StructuredValue(ConfiguredBaseModel): +class StructuredValue(CreativeWork): - None + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) @@ -318,60 +327,35 @@ class Thing(ConfiguredBaseModel): -class TimedOut(ConfiguredBaseModel): - """ - ['A boolean element to describe if the response did not occur within the prescribed time.'] - """ - None - - - -class UiActivity(ConfiguredBaseModel): - """ - ['todo'] - """ - order: Optional[List[Union[Activity, Field, str]]] = pyd.Field(default_factory=list, title="Order", description="""['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']""") - addProperties: Optional[List[AdditionalProperty]] = pyd.Field(default_factory=list, title="addProperties", description="""['An array of objects to describe the various properties added to assessments and fields.']""") - overrideProperties: Optional[List[OverrideProperty]] = pyd.Field(default_factory=list, title="overrideProperties", description="""['An array of objects to override the various properties added to assessments and fields.']""") - shuffle: Optional[bool] = pyd.Field(None, title="Shuffle", description="""['An element (bool) to determine if the list of items is shuffled or in order.']""") - allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") - - - -class UiField(ConfiguredBaseModel): - """ - ['todo'] - """ - inputType: Optional[str] = pyd.Field(None, title="inputType", description="""['An element to describe the input type of a Field item.']""") - readonlyValue: Optional[bool] = pyd.Field(None) - - - -class UiProtocol(ConfiguredBaseModel): +class UI(ConfiguredBaseModel): """ ['todo'] """ - order: Optional[List[Union[Activity, Field, str]]] = pyd.Field(default_factory=list, title="Order", description="""['An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.']""") - addProperties: Optional[List[AdditionalProperty]] = pyd.Field(default_factory=list, title="addProperties", description="""['An array of objects to describe the various properties added to assessments and fields.']""") - overrideProperties: Optional[List[OverrideProperty]] = pyd.Field(default_factory=list, title="overrideProperties", description="""['An array of objects to override the various properties added to assessments and fields.']""") - shuffle: Optional[bool] = pyd.Field(None, title="Shuffle", description="""['An element (bool) to determine if the list of items is shuffled or in order.']""") - allow: Optional[List[Thing]] = pyd.Field(default_factory=list, title="allow", description="""['An array of items indicating properties allowed on an activity or protocol ']""") + order: Optional[List[Union[Activity, Item, str]]] = Field(default_factory=list, title="Order", description="""An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.""") + addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties", description="""An array of objects to describe the various properties added to assessments and Items.""") + overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties", description="""An array of objects to override the various properties added to assessments and fields.""") + shuffle: Optional[bool] = Field(None, title="Shuffle", description="""An element (bool) to determine if the list of items is shuffled or in order.""") + allow: Optional[List[AllowedType]] = Field(default_factory=list, title="allow", description="""An array of items indicating properties allowed on an activity or protocol.""") + inputType: Optional[str] = Field(None, title="inputType", description="""An element to describe the input type of a Item.""") + readonlyValue: Optional[bool] = Field(None) class UnitOption(ConfiguredBaseModel): """ - ['An object to represent a human displayable name alongside the more formal value for units.'] + An object to represent a human displayable name alongside the more formal value for units. """ - prefLabel: Optional[List[LangString]] = pyd.Field(default_factory=list, title="preferred label", description="""['The preferred label.']""") - value: Optional[List[Union[LangString, str]]] = pyd.Field(default_factory=list, title="value", description="""['The value for each option in choices or in additionalNotesObj']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + value: Optional[Union[LangString, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") -class VideoObject(ConfiguredBaseModel): +class VideoObject(MediaObject): - contentUrl: str = pyd.Field(...) - inLanguage: Optional[List[LangString]] = pyd.Field(default_factory=list) + contentUrl: str = Field(...) + inLanguage: Optional[str] = Field(None) + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) @@ -381,19 +365,16 @@ class VideoObject(ConfiguredBaseModel): AdditionalNoteObj.model_rebuild() AdditionalProperty.model_rebuild() Agent.model_rebuild() -AllowExport.model_rebuild() -AllowReplay.model_rebuild() -AutoAdvance.model_rebuild() Choice.model_rebuild() ComputeSpecification.model_rebuild() CreativeWork.model_rebuild() Activity.model_rebuild() -DisableBack.model_rebuild() -DontKnow.model_rebuild() -Field.model_rebuild() +Item.model_rebuild() LandingPage.model_rebuild() LangString.model_rebuild() MediaObject.model_rebuild() +AudioObject.model_rebuild() +ImageObject.model_rebuild() MessageSpecification.model_rebuild() OverrideProperty.model_rebuild() Participant.model_rebuild() @@ -401,15 +382,10 @@ class VideoObject(ConfiguredBaseModel): Response.model_rebuild() ResponseActivity.model_rebuild() ResponseOption.model_rebuild() -Schedule.model_rebuild() -Skipped.model_rebuild() SoftwareAgent.model_rebuild() StructuredValue.model_rebuild() Thing.model_rebuild() -TimedOut.model_rebuild() -UiActivity.model_rebuild() -UiField.model_rebuild() -UiProtocol.model_rebuild() +UI.model_rebuild() UnitOption.model_rebuild() VideoObject.model_rebuild() From aabafc38d00c29160ee9858fd3d654cdb3b4fe07 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 16:40:46 -0500 Subject: [PATCH 07/34] Add generated shacl --- linkml-schema/reproschema-shacl.ttl | 674 ++++++++++++++-------------- 1 file changed, 337 insertions(+), 337 deletions(-) diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl index 3adcf542e4..fd74c8b7c1 100644 --- a/linkml-schema/reproschema-shacl.ttl +++ b/linkml-schema/reproschema-shacl.ttl @@ -11,7 +11,11 @@ schema1:AudioObject a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 1 ; sh:path schema1:inLanguage ], @@ -21,11 +25,7 @@ schema1:AudioObject a sh:NodeShape ; [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ] ; + sh:path schema1:contentUrl ] ; sh:targetClass schema1:AudioObject . schema1:CreativeWork a sh:NodeShape ; @@ -45,21 +45,21 @@ schema1:MediaObject a sh:NodeShape ; sh:description "Add description" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Media Object" ; - sh:property [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ], + sh:property [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ], [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 1 ; sh:path schema1:inLanguage ], + [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ] ; + sh:path schema1:contentUrl ] ; sh:targetClass schema1:MediaObject . schema1:StructuredValue a sh:NodeShape ; @@ -85,12 +85,6 @@ reproschema:AdditionalNoteObj a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional Notes Object" ; sh:property [ sh:datatype xsd:string ; - sh:description "An element to define the source (eg. RedCap, NDA) where the note was taken from." ; - sh:maxCount 1 ; - sh:name "source" ; - sh:order 1 ; - sh:path reproschema:source ], - [ sh:datatype xsd:string ; sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; sh:name "value" ; @@ -101,7 +95,13 @@ reproschema:AdditionalNoteObj a sh:NodeShape ; sh:maxCount 1 ; sh:name "column" ; sh:order 0 ; - sh:path reproschema:column ] ; + sh:path reproschema:column ], + [ sh:datatype xsd:string ; + sh:description "An element to define the source (eg. RedCap, NDA) where the note was taken from." ; + sh:maxCount 1 ; + sh:name "source" ; + sh:order 1 ; + sh:path reproschema:source ] ; sh:targetClass reproschema:AdditionalNoteObj . reproschema:Choice a sh:NodeShape ; @@ -109,14 +109,7 @@ reproschema:Choice a sh:NodeShape ; sh:description "An object to describe a response option." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response choice" ; - sh:property [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path schema1:image ], - [ sh:class rdf:langString ; + sh:property [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; sh:order 0 ; sh:path schema1:name ], @@ -125,7 +118,14 @@ reproschema:Choice a sh:NodeShape ; sh:maxCount 1 ; sh:name "value" ; sh:order 2 ; - sh:path schema1:value ] ; + sh:path schema1:value ], + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path schema1:image ] ; sh:targetClass reproschema:Choice . reproschema:Field a sh:NodeShape ; @@ -134,78 +134,92 @@ reproschema:Field a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Item in an activity" ; sh:property [ sh:datatype xsd:string ; + sh:description "The subject matter of the Field." ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:datatype xsd:string ; sh:description "The alternate label." ; sh:maxCount 1 ; sh:name "alternate label" ; sh:order 2 ; sh:path skos:altLabel ], [ sh:datatype xsd:string ; - sh:description "An element (object or by URL)to describe the properties of response of the Item." ; sh:maxCount 1 ; - sh:name "Response options" ; - sh:order 12 ; - sh:path reproschema:responseOptions ], - [ sh:datatype xsd:string ; - sh:description "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." ; - sh:name "additional notes" ; - sh:order 1 ; - sh:path reproschema:additionalNotesObj ], + sh:order 15 ; + sh:path schema1:version ], + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 6 ; + sh:path schema1:image ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path skos:prefLabel ], [ sh:class rdf:langString ; sh:description "The preamble for an assessment" ; sh:name "Preamble" ; sh:nodeKind sh:BlankNode ; sh:order 9 ; sh:path reproschema:preamble ], + [ sh:datatype xsd:string ; + sh:description "An element (object or by URL)to describe the properties of response of the Item." ; + sh:maxCount 1 ; + sh:name "Response options" ; + sh:order 12 ; + sh:path reproschema:responseOptions ], + [ sh:datatype xsd:anyURI ; + sh:description "An image url." ; + sh:maxCount 1 ; + sh:name "imageUrl" ; + sh:order 7 ; + sh:path reproschema:imageUrl ], [ sh:maxCount 1 ; sh:order 18 ; sh:path rdf:type ], + [ sh:class schema1:VideoObject ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 16 ; + sh:path schema1:video ], [ sh:datatype xsd:string ; sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; sh:name "associatedMedia" ; sh:order 3 ; sh:path schema1:associatedMedia ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 17 ; + sh:path schema1:id ], + [ sh:class reproschema:Activity ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path schema1:isPartOf ], [ sh:datatype xsd:string ; sh:description "TODO" ; sh:maxCount 1 ; sh:name "audio" ; sh:order 4 ; sh:path schema1:audio ], - [ sh:class schema1:VideoObject ; - sh:maxCount 1 ; + [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 16 ; - sh:path schema1:video ], + sh:order 11 ; + sh:path schema1:question ], [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path skos:prefLabel ], + sh:order 5 ; + sh:path schema1:description ], [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 13 ; sh:path schema1:schemaVersion ], - [ sh:class reproschema:Activity ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path schema1:isPartOf ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:image ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 17 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 15 ; - sh:path schema1:version ], [ sh:class reproschema:UI ; sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; @@ -213,25 +227,11 @@ reproschema:Field a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 14 ; sh:path reproschema:ui ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 11 ; - sh:path schema1:question ], - [ sh:datatype xsd:anyURI ; - sh:description "An image url." ; - sh:maxCount 1 ; - sh:name "imageUrl" ; - sh:order 7 ; - sh:path reproschema:imageUrl ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path schema1:description ], [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ] ; + sh:description "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." ; + sh:name "additional notes" ; + sh:order 1 ; + sh:path reproschema:additionalNotesObj ] ; sh:targetClass reproschema:Field . reproschema:LandingPage a sh:NodeShape ; @@ -239,14 +239,14 @@ reproschema:LandingPage a sh:NodeShape ; sh:description "An object to define the landing page of a protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Landing Page" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:inLanguage ], - [ sh:datatype xsd:anyURI ; + sh:property [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 1 ; - sh:path schema1:id ] ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:inLanguage ] ; sh:targetClass reproschema:LandingPage . reproschema:Protocol a sh:NodeShape ; @@ -254,43 +254,35 @@ reproschema:Protocol a sh:NodeShape ; sh:description "A representation of a study which comprises one or more assessments." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Protocol" ; - sh:property [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path schema1:description ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:property [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:name "UI" ; + sh:order 9 ; + sh:path schema1:schemaVersion ], + [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; + sh:name "messages" ; sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path reproschema:ui ], + sh:order 7 ; + sh:path reproschema:messages ], [ sh:datatype xsd:string ; sh:description "The subject matter of the Field." ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:about ], [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path skos:prefLabel ], + sh:order 5 ; + sh:path schema1:description ], [ sh:datatype xsd:string ; - sh:description "The alternate label." ; + sh:description "An element (by URL) to point to the protocol readme or landing page." ; sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 1 ; - sh:path skos:altLabel ], - [ sh:maxCount 1 ; - sh:order 13 ; - sh:path rdf:type ], - [ sh:datatype xsd:string ; - sh:description "TODO not described in reproschema" ; + sh:name "Landing page content" ; + sh:order 6 ; + sh:path reproschema:landingPage ], + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:name "cronTable" ; - sh:order 4 ; - sh:path reproschema:cronTable ], + sh:order 12 ; + sh:path schema1:id ], [ sh:datatype xsd:string ; sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; @@ -298,35 +290,43 @@ reproschema:Protocol a sh:NodeShape ; sh:order 2 ; sh:path schema1:associatedMedia ], [ sh:datatype xsd:string ; - sh:description "An element (by URL) to point to the protocol readme or landing page." ; - sh:maxCount 1 ; - sh:name "Landing page content" ; - sh:order 6 ; - sh:path reproschema:landingPage ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 11 ; - sh:path schema1:version ], - [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path reproschema:messages ], - [ sh:datatype xsd:anyURI ; + sh:description "The alternate label." ; sh:maxCount 1 ; - sh:order 12 ; - sh:path schema1:id ], + sh:name "alternate label" ; + sh:order 1 ; + sh:path skos:altLabel ], [ sh:class reproschema:ComputeSpecification ; sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; sh:name "computation" ; sh:nodeKind sh:BlankNode ; sh:order 3 ; sh:path reproschema:compute ], + [ sh:maxCount 1 ; + sh:order 13 ; + sh:path rdf:type ], [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:order 9 ; - sh:path schema1:schemaVersion ] ; + sh:order 11 ; + sh:path schema1:version ], + [ sh:datatype xsd:string ; + sh:description "TODO not described in reproschema" ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 4 ; + sh:path reproschema:cronTable ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path skos:prefLabel ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path reproschema:ui ] ; sh:targetClass reproschema:Protocol . reproschema:Response a sh:NodeShape ; @@ -334,30 +334,30 @@ reproschema:Response a sh:NodeShape ; sh:description "Describes the response of an item." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:id ], - [ sh:class reproschema:Participant ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 2 ; - sh:path prov:wasAttributedTo ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; sh:name "value" ; sh:order 1 ; sh:path schema1:value ], - [ sh:maxCount 1 ; - sh:order 4 ; - sh:path rdf:type ], [ sh:datatype xsd:string ; sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; sh:name "isAbout" ; sh:order 0 ; - sh:path reproschema:isAbout ] ; + sh:path reproschema:isAbout ], + [ sh:class reproschema:Participant ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 2 ; + sh:path prov:wasAttributedTo ], + [ sh:maxCount 1 ; + sh:order 4 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path schema1:id ] ; sh:targetClass reproschema:Response . reproschema:ResponseActivity a sh:NodeShape ; @@ -365,24 +365,25 @@ reproschema:ResponseActivity a sh:NodeShape ; sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; sh:name "ResponseActivity" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path prov:generated ], - [ sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path prov:startedAtTime ], - [ sh:maxCount 1 ; + sh:property [ sh:maxCount 1 ; sh:order 7 ; sh:path rdf:type ], + [ sh:class reproschema:SoftwareAgent ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path prov:wasAssociatedWith ], [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:id ], + sh:order 1 ; + sh:path prov:generated ], [ sh:datatype xsd:string ; sh:order 4 ; sh:path prov:used ], + [ sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path prov:startedAtTime ], [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 2 ; @@ -391,11 +392,10 @@ reproschema:ResponseActivity a sh:NodeShape ; sh:maxCount 1 ; sh:order 0 ; sh:path prov:endedAtTime ], - [ sh:class reproschema:SoftwareAgent ; + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path prov:wasAssociatedWith ] ; + sh:order 6 ; + sh:path schema1:id ] ; sh:targetClass reproschema:ResponseActivity . reproschema:ResponseOption a sh:NodeShape ; @@ -404,15 +404,26 @@ reproschema:ResponseOption a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response option" ; sh:property [ sh:datatype xsd:string ; + sh:description "An array to list the available options for response of the Item." ; + sh:name "choices" ; + sh:order 0 ; + sh:path reproschema:choices ], + [ sh:datatype xsd:string ; + sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:minValue ], + sh:name "datumType" ; + sh:order 1 ; + sh:path reproschema:datumType ], [ sh:class reproschema:UnitOption ; sh:description "A list of objects to represent a human displayable name alongside the more formal value for units." ; sh:name "unitOptions" ; sh:nodeKind sh:BlankNode ; sh:order 5 ; sh:path reproschema:unitOptions ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:maxValue ], [ sh:datatype xsd:string ; sh:description "The type of the response of an item. For example, string, integer, etc." ; sh:maxCount 1 ; @@ -420,20 +431,9 @@ reproschema:ResponseOption a sh:NodeShape ; sh:order 6 ; sh:path reproschema:valueType ], [ sh:datatype xsd:string ; - sh:description "An array to list the available options for response of the Item." ; - sh:name "choices" ; - sh:order 0 ; - sh:path reproschema:choices ], - [ sh:datatype xsd:string ; - sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; sh:maxCount 1 ; - sh:name "datumType" ; - sh:order 1 ; - sh:path reproschema:datumType ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:maxValue ], + sh:order 3 ; + sh:path schema1:minValue ], [ sh:datatype xsd:boolean ; sh:description "Indicates (by bool) if response for the Item has one or more answer." ; sh:maxCount 1 ; @@ -451,17 +451,17 @@ schema1:VideoObject a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:name "Video Object" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:maxCount 1 ; + sh:property [ sh:maxCount 1 ; sh:order 3 ; sh:path rdf:type ], [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 2 ; sh:path schema1:id ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:inLanguage ], [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; @@ -473,49 +473,45 @@ reproschema:Activity a sh:NodeShape ; sh:description "An assessment in a protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Activity" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 14 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:version ], - [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], + sh:property [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; + sh:name "messages" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path reproschema:messages ], [ sh:class reproschema:ComputeSpecification ; sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; sh:name "computation" ; sh:nodeKind sh:BlankNode ; sh:order 4 ; sh:path reproschema:compute ], - [ sh:datatype xsd:string ; - sh:description "The alternate label." ; + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 1 ; - sh:path skos:altLabel ], + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 12 ; + sh:path reproschema:ui ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 14 ; + sh:path schema1:id ], [ sh:class rdf:langString ; sh:description "The preamble for an assessment" ; sh:name "Preamble" ; sh:nodeKind sh:BlankNode ; sh:order 9 ; sh:path reproschema:preamble ], - [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 2 ; - sh:path schema1:associatedMedia ], [ sh:datatype xsd:string ; sh:description "TODO not described in reproschema" ; sh:maxCount 1 ; sh:name "cronTable" ; sh:order 5 ; sh:path reproschema:cronTable ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 6 ; + sh:path schema1:description ], [ sh:class rdf:langString ; sh:description "['The preferred label.']" ; sh:name "preferred label" ; @@ -529,34 +525,38 @@ reproschema:Activity a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 7 ; sh:path schema1:image ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:description ], [ sh:datatype xsd:string ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; - sh:order 11 ; - sh:path schema1:schemaVersion ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 3 ; - sh:path schema1:citation ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:name "associatedMedia" ; + sh:order 2 ; + sh:path schema1:associatedMedia ], + [ sh:datatype xsd:string ; + sh:description "The subject matter of the Field." ; sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 12 ; - sh:path reproschema:ui ], + sh:order 0 ; + sh:path schema1:about ], + [ sh:datatype xsd:string ; + sh:description "The alternate label." ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 1 ; + sh:path skos:altLabel ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 13 ; + sh:path schema1:version ], [ sh:maxCount 1 ; sh:order 15 ; sh:path rdf:type ], - [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 11 ; + sh:path schema1:schemaVersion ], + [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path reproschema:messages ] ; + sh:order 3 ; + sh:path schema1:citation ] ; sh:targetClass reproschema:Activity . reproschema:AdditionalProperty a sh:NodeShape ; @@ -564,54 +564,46 @@ reproschema:AdditionalProperty a sh:NodeShape ; sh:description "An object to describe the various properties added to assessments and Items." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:class rdf:langString ; - sh:description "The name used to represent an item." ; + sh:property [ sh:datatype xsd:string ; + sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; sh:maxCount 1 ; - sh:name "variableName" ; - sh:nodeKind sh:BlankNode ; - sh:order 9 ; - sh:path reproschema:variableName ], + sh:name "Schedule" ; + sh:order 7 ; + sh:path reproschema:schedule ], + [ sh:datatype xsd:string ; + sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; + sh:maxCount 1 ; + sh:name "visibility" ; + sh:order 2 ; + sh:path reproschema:isVis ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:valueRequired ], [ sh:datatype xsd:string ; sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; sh:name "limit" ; sh:order 3 ; sh:path reproschema:limit ], - [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; - sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; - sh:name "allow" ; - sh:order 0 ; - sh:path reproschema:allow ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path skos:prefLabel ], [ sh:datatype xsd:string ; sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; sh:maxCount 1 ; sh:name "randomMaxDelay" ; sh:order 6 ; sh:path reproschema:randomMaxDelay ], - [ sh:datatype xsd:string ; - sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; - sh:maxCount 1 ; - sh:name "Schedule" ; - sh:order 7 ; - sh:path reproschema:schedule ], [ sh:datatype xsd:string ; sh:description "Defines number of times the item is allowed to be redone." ; sh:maxCount 1 ; sh:name "maxRetakes" ; sh:order 4 ; sh:path reproschema:maxRetakes ], - [ sh:datatype xsd:string ; - sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; - sh:maxCount 1 ; - sh:name "visibility" ; - sh:order 2 ; - sh:path reproschema:isVis ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path skos:prefLabel ], [ sh:class reproschema:UI ; sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; @@ -619,10 +611,18 @@ reproschema:AdditionalProperty a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 10 ; sh:path reproschema:ui ], - [ sh:datatype xsd:boolean ; + [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; + sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; + sh:name "allow" ; + sh:order 0 ; + sh:path reproschema:allow ], + [ sh:class rdf:langString ; + sh:description "The name used to represent an item." ; sh:maxCount 1 ; - sh:order 8 ; - sh:path schema1:valueRequired ], + sh:name "variableName" ; + sh:nodeKind sh:BlankNode ; + sh:order 9 ; + sh:path reproschema:variableName ], [ sh:datatype xsd:string ; sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; @@ -636,34 +636,12 @@ reproschema:OverrideProperty a sh:NodeShape ; sh:description "An object to override the various properties added to assessments and Items." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 4 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; - sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; - sh:maxCount 1 ; - sh:name "limit" ; - sh:order 2 ; - sh:path reproschema:limit ], - [ sh:datatype xsd:string ; - sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; - sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - sh:order 5 ; - sh:path reproschema:randomMaxDelay ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 7 ; - sh:path schema1:valueRequired ], - [ sh:datatype xsd:string ; - sh:description "A pointer to the node describing the item." ; + sh:property [ sh:datatype xsd:string ; + sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; sh:maxCount 1 ; - sh:name "isAbout" ; - sh:order 0 ; - sh:path reproschema:isAbout ], + sh:name "visibility" ; + sh:order 1 ; + sh:path reproschema:isVis ], [ sh:class rdf:langString ; sh:description "The name used to represent an item." ; sh:maxCount 1 ; @@ -684,11 +662,33 @@ reproschema:OverrideProperty a sh:NodeShape ; sh:order 3 ; sh:path reproschema:maxRetakes ], [ sh:datatype xsd:string ; - sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; + sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; - sh:name "visibility" ; - sh:order 1 ; - sh:path reproschema:isVis ] ; + sh:name "limit" ; + sh:order 2 ; + sh:path reproschema:limit ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 7 ; + sh:path schema1:valueRequired ], + [ sh:datatype xsd:string ; + sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 5 ; + sh:path reproschema:randomMaxDelay ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 4 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:description "A pointer to the node describing the item." ; + sh:maxCount 1 ; + sh:name "isAbout" ; + sh:order 0 ; + sh:path reproschema:isAbout ] ; sh:targetClass reproschema:OverrideProperty . reproschema:Participant a sh:NodeShape ; @@ -707,14 +707,14 @@ reproschema:SoftwareAgent a sh:NodeShape ; sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Software Agent" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:version ], - [ sh:datatype xsd:anyURI ; + sh:property [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 1 ; - sh:path schema1:url ] ; + sh:path schema1:url ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:version ] ; sh:targetClass reproschema:SoftwareAgent . reproschema:UnitOption a sh:NodeShape ; @@ -761,38 +761,38 @@ reproschema:MessageSpecification a sh:NodeShape ; sh:description "An object to define messages in an activity or protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Message Specification" ; - sh:property [ sh:class rdf:langString ; - sh:description "The message to be conditionally displayed for an item." ; - sh:name "Message" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:message ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; sh:maxCount 1 ; sh:name "JavaScript Expression" ; sh:order 0 ; - sh:path reproschema:jsExpression ] ; + sh:path reproschema:jsExpression ], + [ sh:class rdf:langString ; + sh:description "The message to be conditionally displayed for an item." ; + sh:name "Message" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path reproschema:message ] ; sh:targetClass reproschema:MessageSpecification . schema1:ImageObject a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; + sh:property [ sh:maxCount 1 ; + sh:order 3 ; + sh:path rdf:type ], + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], + sh:order 2 ; + sh:path schema1:id ], [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; sh:path schema1:contentUrl ], - [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ], - [ sh:datatype xsd:anyURI ; + [ sh:datatype xsd:string ; sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ] ; + sh:order 1 ; + sh:path schema1:inLanguage ] ; sh:targetClass schema1:ImageObject . reproschema:UI a sh:NodeShape ; @@ -800,44 +800,44 @@ reproschema:UI a sh:NodeShape ; sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "todo" ; - sh:property [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; - sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; - sh:name "allow" ; - sh:order 4 ; - sh:path reproschema:allow ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:description "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." ; sh:name "Order" ; sh:order 0 ; sh:path reproschema:order ], - [ sh:class reproschema:OverrideProperty ; - sh:description "An array of objects to override the various properties added to assessments and fields." ; - sh:name "overrideProperties" ; + [ sh:class reproschema:AdditionalProperty ; + sh:description "An array of objects to describe the various properties added to assessments and Items." ; + sh:name "addProperties" ; sh:nodeKind sh:BlankNode ; - sh:order 2 ; - sh:path reproschema:overrideProperties ], + sh:order 1 ; + sh:path reproschema:addProperties ], [ sh:datatype xsd:string ; sh:description "An element to describe the input type of a Item." ; sh:maxCount 1 ; sh:name "inputType" ; sh:order 5 ; sh:path reproschema:inputType ], + [ sh:class reproschema:OverrideProperty ; + sh:description "An array of objects to override the various properties added to assessments and fields." ; + sh:name "overrideProperties" ; + sh:nodeKind sh:BlankNode ; + sh:order 2 ; + sh:path reproschema:overrideProperties ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 6 ; + sh:path schema1:readonlyValue ], [ sh:datatype xsd:boolean ; sh:description "An element (bool) to determine if the list of items is shuffled or in order." ; sh:maxCount 1 ; sh:name "Shuffle" ; sh:order 3 ; sh:path reproschema:shuffle ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:readonlyValue ], - [ sh:class reproschema:AdditionalProperty ; - sh:description "An array of objects to describe the various properties added to assessments and Items." ; - sh:name "addProperties" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:addProperties ] ; + [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; + sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; + sh:name "allow" ; + sh:order 4 ; + sh:path reproschema:allow ] ; sh:targetClass reproschema:UI . rdf:langString a sh:NodeShape ; From 379d329f0a7e6a2b3bcea5e2fd29ed9bba76f80e Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 17:02:49 -0500 Subject: [PATCH 08/34] more fixes --- contexts/reproschema_new | 12 +- linkml-schema/reproschema-shacl.ttl | 715 ++++++++++++++-------------- linkml-schema/reproschema.py | 23 +- linkml-schema/reproschema.yaml | 2 + 4 files changed, 377 insertions(+), 375 deletions(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index f95721a612..af296b4ebb 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -98,7 +98,8 @@ "@id": "reproschema:imageUrl" }, "inLanguage": { - "@id": "schema:inLanguage" + "@id": "schema:inLanguage", + "@language": null }, "inputType": { "@id": "reproschema:inputType", @@ -121,7 +122,8 @@ }, "landingPage": { "@type": "@id", - "@id": "reproschema:landingPage" + "@id": "reproschema:landingPage", + "@container": "@set" }, "limit": { "@id": "reproschema:limit", @@ -192,7 +194,8 @@ "@language": null }, "schemaVersion": { - "@id": "schema:schemaVersion" + "@id": "schema:schemaVersion", + "@language": null }, "shuffle": { "@type": "xsd:boolean", @@ -240,7 +243,8 @@ "@id": "reproschema:variableName" }, "version": { - "@id": "schema:version" + "@id": "schema:version", + "@language": null }, "video": { "@type": "@id", diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl index fd74c8b7c1..93a1472d1d 100644 --- a/linkml-schema/reproschema-shacl.ttl +++ b/linkml-schema/reproschema-shacl.ttl @@ -15,17 +15,17 @@ schema1:AudioObject a sh:NodeShape ; sh:maxCount 1 ; sh:order 2 ; sh:path schema1:id ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ], [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 1 ; sh:path schema1:inLanguage ], [ sh:maxCount 1 ; sh:order 3 ; - sh:path rdf:type ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ] ; + sh:path rdf:type ] ; sh:targetClass schema1:AudioObject . schema1:CreativeWork a sh:NodeShape ; @@ -45,21 +45,21 @@ schema1:MediaObject a sh:NodeShape ; sh:description "Add description" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Media Object" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:maxCount 1 ; + sh:property [ sh:maxCount 1 ; sh:order 3 ; sh:path rdf:type ], [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; - sh:path schema1:contentUrl ] ; + sh:path schema1:contentUrl ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:inLanguage ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:id ] ; sh:targetClass schema1:MediaObject . schema1:StructuredValue a sh:NodeShape ; @@ -90,18 +90,18 @@ reproschema:AdditionalNoteObj a sh:NodeShape ; sh:name "value" ; sh:order 2 ; sh:path schema1:value ], - [ sh:datatype xsd:string ; - sh:description "An element to define the column name where the note was taken from." ; - sh:maxCount 1 ; - sh:name "column" ; - sh:order 0 ; - sh:path reproschema:column ], [ sh:datatype xsd:string ; sh:description "An element to define the source (eg. RedCap, NDA) where the note was taken from." ; sh:maxCount 1 ; sh:name "source" ; sh:order 1 ; - sh:path reproschema:source ] ; + sh:path reproschema:source ], + [ sh:datatype xsd:string ; + sh:description "An element to define the column name where the note was taken from." ; + sh:maxCount 1 ; + sh:name "column" ; + sh:order 0 ; + sh:path reproschema:column ] ; sh:targetClass reproschema:AdditionalNoteObj . reproschema:Choice a sh:NodeShape ; @@ -109,23 +109,23 @@ reproschema:Choice a sh:NodeShape ; sh:description "An object to describe a response option." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response choice" ; - sh:property [ sh:class rdf:langString ; + sh:property [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; sh:nodeKind sh:BlankNode ; - sh:order 0 ; - sh:path schema1:name ], + sh:order 1 ; + sh:path schema1:image ], [ sh:datatype xsd:string ; sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; sh:name "value" ; sh:order 2 ; sh:path schema1:value ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; + [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path schema1:image ] ; + sh:order 0 ; + sh:path schema1:name ] ; sh:targetClass reproschema:Choice . reproschema:Field a sh:NodeShape ; @@ -134,92 +134,79 @@ reproschema:Field a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Item in an activity" ; sh:property [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:datatype xsd:string ; - sh:description "The alternate label." ; + sh:description "TODO" ; sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 2 ; - sh:path skos:altLabel ], + sh:name "audio" ; + sh:order 4 ; + sh:path schema1:audio ], [ sh:datatype xsd:string ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; - sh:order 15 ; - sh:path schema1:version ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:name "associatedMedia" ; + sh:order 3 ; + sh:path schema1:associatedMedia ], + [ sh:class schema1:VideoObject ; sh:maxCount 1 ; - sh:name "image" ; sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:image ], + sh:order 16 ; + sh:path schema1:video ], [ sh:class rdf:langString ; sh:description "['The preferred label.']" ; sh:name "preferred label" ; sh:nodeKind sh:BlankNode ; sh:order 10 ; sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:description "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." ; + sh:name "additional notes" ; + sh:order 1 ; + sh:path reproschema:additionalNotesObj ], + [ sh:datatype xsd:string ; + sh:description "The subject matter of the Field." ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 17 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; + sh:description "The alternate label." ; + sh:maxCount 1 ; + sh:name "alternate label" ; + sh:order 2 ; + sh:path skos:altLabel ], [ sh:class rdf:langString ; sh:description "The preamble for an assessment" ; sh:name "Preamble" ; sh:nodeKind sh:BlankNode ; sh:order 9 ; sh:path reproschema:preamble ], - [ sh:datatype xsd:string ; - sh:description "An element (object or by URL)to describe the properties of response of the Item." ; - sh:maxCount 1 ; - sh:name "Response options" ; - sh:order 12 ; - sh:path reproschema:responseOptions ], - [ sh:datatype xsd:anyURI ; - sh:description "An image url." ; - sh:maxCount 1 ; - sh:name "imageUrl" ; - sh:order 7 ; - sh:path reproschema:imageUrl ], [ sh:maxCount 1 ; sh:order 18 ; sh:path rdf:type ], - [ sh:class schema1:VideoObject ; - sh:maxCount 1 ; + [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 16 ; - sh:path schema1:video ], + sh:order 11 ; + sh:path schema1:question ], [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 3 ; - sh:path schema1:associatedMedia ], - [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:order 17 ; - sh:path schema1:id ], - [ sh:class reproschema:Activity ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path schema1:isPartOf ], + sh:order 13 ; + sh:path schema1:schemaVersion ], [ sh:datatype xsd:string ; - sh:description "TODO" ; sh:maxCount 1 ; - sh:name "audio" ; - sh:order 4 ; - sh:path schema1:audio ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 11 ; - sh:path schema1:question ], + sh:order 15 ; + sh:path schema1:version ], [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; sh:order 5 ; sh:path schema1:description ], [ sh:datatype xsd:string ; + sh:description "An element (object or by URL)to describe the properties of response of the Item." ; sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:schemaVersion ], + sh:name "Response options" ; + sh:order 12 ; + sh:path reproschema:responseOptions ], [ sh:class reproschema:UI ; sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; @@ -227,11 +214,24 @@ reproschema:Field a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 14 ; sh:path reproschema:ui ], - [ sh:datatype xsd:string ; - sh:description "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." ; - sh:name "additional notes" ; - sh:order 1 ; - sh:path reproschema:additionalNotesObj ] ; + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 6 ; + sh:path schema1:image ], + [ sh:datatype xsd:anyURI ; + sh:description "An image url." ; + sh:maxCount 1 ; + sh:name "imageUrl" ; + sh:order 7 ; + sh:path reproschema:imageUrl ], + [ sh:class reproschema:Activity ; + sh:maxCount 1 ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path schema1:isPartOf ] ; sh:targetClass reproschema:Field . reproschema:LandingPage a sh:NodeShape ; @@ -239,14 +239,14 @@ reproschema:LandingPage a sh:NodeShape ; sh:description "An object to define the landing page of a protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Landing Page" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 0 ; - sh:path schema1:inLanguage ] ; + sh:path schema1:inLanguage ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:id ] ; sh:targetClass reproschema:LandingPage . reproschema:Protocol a sh:NodeShape ; @@ -255,35 +255,6 @@ reproschema:Protocol a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Protocol" ; sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 9 ; - sh:path schema1:schemaVersion ], - [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path reproschema:messages ], - [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path schema1:description ], - [ sh:datatype xsd:string ; - sh:description "An element (by URL) to point to the protocol readme or landing page." ; - sh:maxCount 1 ; - sh:name "Landing page content" ; - sh:order 6 ; - sh:path reproschema:landingPage ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 12 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; sh:name "associatedMedia" ; @@ -295,38 +266,66 @@ reproschema:Protocol a sh:NodeShape ; sh:name "alternate label" ; sh:order 1 ; sh:path skos:altLabel ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path skos:prefLabel ], [ sh:class reproschema:ComputeSpecification ; sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; sh:name "computation" ; sh:nodeKind sh:BlankNode ; sh:order 3 ; sh:path reproschema:compute ], - [ sh:maxCount 1 ; - sh:order 13 ; - sh:path rdf:type ], - [ sh:datatype xsd:string ; + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; - sh:order 11 ; - sh:path schema1:version ], + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path reproschema:ui ], [ sh:datatype xsd:string ; sh:description "TODO not described in reproschema" ; sh:maxCount 1 ; sh:name "cronTable" ; sh:order 4 ; sh:path reproschema:cronTable ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; + [ sh:datatype xsd:string ; + sh:description "The subject matter of the Field." ; + sh:maxCount 1 ; + sh:order 0 ; + sh:path schema1:about ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 9 ; + sh:path schema1:schemaVersion ], + [ sh:maxCount 1 ; + sh:order 13 ; + sh:path rdf:type ], + [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; + sh:name "messages" ; sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path skos:prefLabel ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:order 7 ; + sh:path reproschema:messages ], + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:name "UI" ; + sh:order 12 ; + sh:path schema1:id ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 11 ; + sh:path schema1:version ], + [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path reproschema:ui ] ; + sh:order 5 ; + sh:path schema1:description ], + [ sh:datatype xsd:string ; + sh:description "An element (by URL) to point to the protocol readme or landing page." ; + sh:name "Landing page content" ; + sh:order 6 ; + sh:path reproschema:landingPage ] ; sh:targetClass reproschema:Protocol . reproschema:Response a sh:NodeShape ; @@ -334,23 +333,23 @@ reproschema:Response a sh:NodeShape ; sh:description "Describes the response of an item." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response" ; - sh:property [ sh:datatype xsd:string ; - sh:description "The value for each option in choices or in additionalNotesObj" ; + sh:property [ sh:class reproschema:Participant ; sh:maxCount 1 ; - sh:name "value" ; - sh:order 1 ; - sh:path schema1:value ], + sh:nodeKind sh:BlankNode ; + sh:order 2 ; + sh:path prov:wasAttributedTo ], [ sh:datatype xsd:string ; sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; sh:name "isAbout" ; sh:order 0 ; sh:path reproschema:isAbout ], - [ sh:class reproschema:Participant ; + [ sh:datatype xsd:string ; + sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 2 ; - sh:path prov:wasAttributedTo ], + sh:name "value" ; + sh:order 1 ; + sh:path schema1:value ], [ sh:maxCount 1 ; sh:order 4 ; sh:path rdf:type ], @@ -365,14 +364,19 @@ reproschema:ResponseActivity a sh:NodeShape ; sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; sh:name "ResponseActivity" ; - sh:property [ sh:maxCount 1 ; - sh:order 7 ; - sh:path rdf:type ], + sh:property [ sh:datatype xsd:dateTime ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path prov:startedAtTime ], [ sh:class reproschema:SoftwareAgent ; sh:maxCount 1 ; sh:nodeKind sh:BlankNode ; sh:order 5 ; sh:path prov:wasAssociatedWith ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 2 ; + sh:path schema1:inLanguage ], [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 1 ; @@ -380,22 +384,17 @@ reproschema:ResponseActivity a sh:NodeShape ; [ sh:datatype xsd:string ; sh:order 4 ; sh:path prov:used ], - [ sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path prov:startedAtTime ], - [ sh:datatype xsd:string ; + [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:inLanguage ], + sh:order 6 ; + sh:path schema1:id ], + [ sh:maxCount 1 ; + sh:order 7 ; + sh:path rdf:type ], [ sh:datatype xsd:dateTime ; sh:maxCount 1 ; sh:order 0 ; - sh:path prov:endedAtTime ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:id ] ; + sh:path prov:endedAtTime ] ; sh:targetClass reproschema:ResponseActivity . reproschema:ResponseOption a sh:NodeShape ; @@ -404,23 +403,6 @@ reproschema:ResponseOption a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Response option" ; sh:property [ sh:datatype xsd:string ; - sh:description "An array to list the available options for response of the Item." ; - sh:name "choices" ; - sh:order 0 ; - sh:path reproschema:choices ], - [ sh:datatype xsd:string ; - sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; - sh:maxCount 1 ; - sh:name "datumType" ; - sh:order 1 ; - sh:path reproschema:datumType ], - [ sh:class reproschema:UnitOption ; - sh:description "A list of objects to represent a human displayable name alongside the more formal value for units." ; - sh:name "unitOptions" ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path reproschema:unitOptions ], - [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 2 ; sh:path schema1:maxValue ], @@ -430,16 +412,33 @@ reproschema:ResponseOption a sh:NodeShape ; sh:name "The type of the response" ; sh:order 6 ; sh:path reproschema:valueType ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:minValue ], + [ sh:class reproschema:UnitOption ; + sh:description "A list of objects to represent a human displayable name alongside the more formal value for units." ; + sh:name "unitOptions" ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path reproschema:unitOptions ], [ sh:datatype xsd:boolean ; sh:description "Indicates (by bool) if response for the Item has one or more answer." ; sh:maxCount 1 ; sh:name "Multiple choice response expectation" ; sh:order 4 ; - sh:path reproschema:multipleChoice ] ; + sh:path reproschema:multipleChoice ], + [ sh:datatype xsd:string ; + sh:description "An array to list the available options for response of the Item." ; + sh:name "choices" ; + sh:order 0 ; + sh:path reproschema:choices ], + [ sh:datatype xsd:string ; + sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; + sh:maxCount 1 ; + sh:name "datumType" ; + sh:order 1 ; + sh:path reproschema:datumType ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 3 ; + sh:path schema1:minValue ] ; sh:targetClass reproschema:ResponseOption . prov:Agent a sh:NodeShape ; @@ -454,6 +453,10 @@ schema1:VideoObject a sh:NodeShape ; sh:property [ sh:maxCount 1 ; sh:order 3 ; sh:path rdf:type ], + [ sh:maxCount 1 ; + sh:minCount 1 ; + sh:order 0 ; + sh:path schema1:contentUrl ], [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 2 ; @@ -461,11 +464,7 @@ schema1:VideoObject a sh:NodeShape ; [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ] ; + sh:path schema1:inLanguage ] ; sh:targetClass schema1:VideoObject . reproschema:Activity a sh:NodeShape ; @@ -473,90 +472,90 @@ reproschema:Activity a sh:NodeShape ; sh:description "An assessment in a protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Activity" ; - sh:property [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path reproschema:messages ], - [ sh:class reproschema:ComputeSpecification ; - sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; - sh:name "computation" ; - sh:nodeKind sh:BlankNode ; - sh:order 4 ; - sh:path reproschema:compute ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 12 ; - sh:path reproschema:ui ], - [ sh:datatype xsd:anyURI ; + sh:property [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 14 ; sh:path schema1:id ], - [ sh:class rdf:langString ; - sh:description "The preamble for an assessment" ; - sh:name "Preamble" ; - sh:nodeKind sh:BlankNode ; - sh:order 9 ; - sh:path reproschema:preamble ], [ sh:datatype xsd:string ; - sh:description "TODO not described in reproschema" ; sh:maxCount 1 ; - sh:name "cronTable" ; - sh:order 5 ; - sh:path reproschema:cronTable ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:description ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path skos:prefLabel ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path schema1:image ], - [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 2 ; - sh:path schema1:associatedMedia ], + sh:order 13 ; + sh:path schema1:version ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 10 ; + sh:path skos:prefLabel ], + [ sh:maxCount 1 ; + sh:order 15 ; + sh:path rdf:type ], [ sh:datatype xsd:string ; sh:description "The subject matter of the Field." ; sh:maxCount 1 ; sh:order 0 ; sh:path schema1:about ], + [ sh:class reproschema:MessageSpecification ; + sh:description "An array of objects to define conditional messages in an activity or protocol." ; + sh:name "messages" ; + sh:nodeKind sh:BlankNode ; + sh:order 8 ; + sh:path reproschema:messages ], + [ sh:datatype xsd:string ; + sh:description "TODO not described in reproschema" ; + sh:maxCount 1 ; + sh:name "cronTable" ; + sh:order 5 ; + sh:path reproschema:cronTable ], [ sh:datatype xsd:string ; sh:description "The alternate label." ; sh:maxCount 1 ; sh:name "alternate label" ; sh:order 1 ; sh:path skos:altLabel ], + [ sh:class rdf:langString ; + sh:nodeKind sh:BlankNode ; + sh:order 3 ; + sh:path schema1:citation ], [ sh:datatype xsd:string ; + sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:version ], - [ sh:maxCount 1 ; - sh:order 15 ; - sh:path rdf:type ], + sh:name "associatedMedia" ; + sh:order 2 ; + sh:path schema1:associatedMedia ], + [ sh:class schema1:ImageObject ; + sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; + sh:maxCount 1 ; + sh:name "image" ; + sh:nodeKind sh:BlankNode ; + sh:order 7 ; + sh:path schema1:image ], + [ sh:class rdf:langString ; + sh:description "The preamble for an assessment" ; + sh:name "Preamble" ; + sh:nodeKind sh:BlankNode ; + sh:order 9 ; + sh:path reproschema:preamble ], [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 11 ; sh:path schema1:schemaVersion ], [ sh:class rdf:langString ; sh:nodeKind sh:BlankNode ; - sh:order 3 ; - sh:path schema1:citation ] ; + sh:order 6 ; + sh:path schema1:description ], + [ sh:class reproschema:ComputeSpecification ; + sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; + sh:name "computation" ; + sh:nodeKind sh:BlankNode ; + sh:order 4 ; + sh:path reproschema:compute ], + [ sh:class reproschema:UI ; + sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; + sh:maxCount 1 ; + sh:name "UI" ; + sh:nodeKind sh:BlankNode ; + sh:order 12 ; + sh:path reproschema:ui ] ; sh:targetClass reproschema:Activity . reproschema:AdditionalProperty a sh:NodeShape ; @@ -565,45 +564,23 @@ reproschema:AdditionalProperty a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; sh:property [ sh:datatype xsd:string ; - sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; - sh:maxCount 1 ; - sh:name "Schedule" ; - sh:order 7 ; - sh:path reproschema:schedule ], - [ sh:datatype xsd:string ; sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; sh:maxCount 1 ; sh:name "visibility" ; sh:order 2 ; sh:path reproschema:isVis ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 8 ; - sh:path schema1:valueRequired ], [ sh:datatype xsd:string ; sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; sh:name "limit" ; sh:order 3 ; sh:path reproschema:limit ], - [ sh:datatype xsd:string ; - sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; - sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - sh:order 6 ; - sh:path reproschema:randomMaxDelay ], [ sh:datatype xsd:string ; sh:description "Defines number of times the item is allowed to be redone." ; sh:maxCount 1 ; sh:name "maxRetakes" ; sh:order 4 ; sh:path reproschema:maxRetakes ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path skos:prefLabel ], [ sh:class reproschema:UI ; sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; sh:maxCount 1 ; @@ -611,6 +588,18 @@ reproschema:AdditionalProperty a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 10 ; sh:path reproschema:ui ], + [ sh:datatype xsd:string ; + sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 6 ; + sh:path reproschema:randomMaxDelay ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 5 ; + sh:path skos:prefLabel ], [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; sh:name "allow" ; @@ -623,6 +612,16 @@ reproschema:AdditionalProperty a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 9 ; sh:path reproschema:variableName ], + [ sh:datatype xsd:boolean ; + sh:maxCount 1 ; + sh:order 8 ; + sh:path schema1:valueRequired ], + [ sh:datatype xsd:string ; + sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; + sh:maxCount 1 ; + sh:name "Schedule" ; + sh:order 7 ; + sh:path reproschema:schedule ], [ sh:datatype xsd:string ; sh:description "A pointer to the node describing the item." ; sh:maxCount 1 ; @@ -636,7 +635,31 @@ reproschema:OverrideProperty a sh:NodeShape ; sh:description "An object to override the various properties added to assessments and Items." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Additional properties" ; - sh:property [ sh:datatype xsd:string ; + sh:property [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 4 ; + sh:path skos:prefLabel ], + [ sh:datatype xsd:string ; + sh:description "A pointer to the node describing the item." ; + sh:maxCount 1 ; + sh:name "isAbout" ; + sh:order 0 ; + sh:path reproschema:isAbout ], + [ sh:datatype xsd:string ; + sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; + sh:maxCount 1 ; + sh:name "randomMaxDelay" ; + sh:order 5 ; + sh:path reproschema:randomMaxDelay ], + [ sh:datatype xsd:string ; + sh:description "Defines number of times the item is allowed to be redone." ; + sh:maxCount 1 ; + sh:name "maxRetakes" ; + sh:order 3 ; + sh:path reproschema:maxRetakes ], + [ sh:datatype xsd:string ; sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; sh:maxCount 1 ; sh:name "visibility" ; @@ -649,46 +672,22 @@ reproschema:OverrideProperty a sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:order 8 ; sh:path reproschema:variableName ], - [ sh:datatype xsd:string ; - sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; - sh:maxCount 1 ; - sh:name "Schedule" ; - sh:order 6 ; - sh:path reproschema:schedule ], - [ sh:datatype xsd:string ; - sh:description "Defines number of times the item is allowed to be redone." ; - sh:maxCount 1 ; - sh:name "maxRetakes" ; - sh:order 3 ; - sh:path reproschema:maxRetakes ], [ sh:datatype xsd:string ; sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; sh:maxCount 1 ; sh:name "limit" ; sh:order 2 ; sh:path reproschema:limit ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 7 ; - sh:path schema1:valueRequired ], [ sh:datatype xsd:string ; - sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; + sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - sh:order 5 ; - sh:path reproschema:randomMaxDelay ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 4 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; - sh:description "A pointer to the node describing the item." ; + sh:name "Schedule" ; + sh:order 6 ; + sh:path reproschema:schedule ], + [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:name "isAbout" ; - sh:order 0 ; - sh:path reproschema:isAbout ] ; + sh:order 7 ; + sh:path schema1:valueRequired ] ; sh:targetClass reproschema:OverrideProperty . reproschema:Participant a sh:NodeShape ; @@ -707,14 +706,14 @@ reproschema:SoftwareAgent a sh:NodeShape ; sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; sh:ignoredProperties ( rdf:type ) ; sh:name "Software Agent" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:url ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:order 0 ; - sh:path schema1:version ] ; + sh:path schema1:version ], + [ sh:datatype xsd:anyURI ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:url ] ; sh:targetClass reproschema:SoftwareAgent . reproschema:UnitOption a sh:NodeShape ; @@ -722,18 +721,18 @@ reproschema:UnitOption a sh:NodeShape ; sh:description "An object to represent a human displayable name alongside the more formal value for units." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Unit options" ; - sh:property [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 0 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; + sh:property [ sh:datatype xsd:string ; sh:description "The value for each option in choices or in additionalNotesObj" ; sh:maxCount 1 ; sh:name "value" ; sh:order 1 ; - sh:path schema1:value ] ; + sh:path schema1:value ], + [ sh:class rdf:langString ; + sh:description "['The preferred label.']" ; + sh:name "preferred label" ; + sh:nodeKind sh:BlankNode ; + sh:order 0 ; + sh:path skos:prefLabel ] ; sh:targetClass reproschema:UnitOption . reproschema:ComputeSpecification a sh:NodeShape ; @@ -741,19 +740,19 @@ reproschema:ComputeSpecification a sh:NodeShape ; sh:description "An object to define computations in an activity or protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Compute Specification" ; - sh:property [ sh:datatype xsd:string ; - sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; - sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:order 0 ; - sh:path reproschema:jsExpression ], - [ sh:class rdf:langString ; + sh:property [ sh:class rdf:langString ; sh:description "The name used to represent an item." ; sh:maxCount 1 ; sh:name "variableName" ; sh:nodeKind sh:BlankNode ; sh:order 1 ; - sh:path reproschema:variableName ] ; + sh:path reproschema:variableName ], + [ sh:datatype xsd:string ; + sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; + sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:order 0 ; + sh:path reproschema:jsExpression ] ; sh:targetClass reproschema:ComputeSpecification . reproschema:MessageSpecification a sh:NodeShape ; @@ -761,18 +760,18 @@ reproschema:MessageSpecification a sh:NodeShape ; sh:description "An object to define messages in an activity or protocol." ; sh:ignoredProperties ( rdf:type ) ; sh:name "Message Specification" ; - sh:property [ sh:datatype xsd:string ; - sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; - sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:order 0 ; - sh:path reproschema:jsExpression ], - [ sh:class rdf:langString ; + sh:property [ sh:class rdf:langString ; sh:description "The message to be conditionally displayed for an item." ; sh:name "Message" ; sh:nodeKind sh:BlankNode ; sh:order 1 ; - sh:path reproschema:message ] ; + sh:path reproschema:message ], + [ sh:datatype xsd:string ; + sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; + sh:maxCount 1 ; + sh:name "JavaScript Expression" ; + sh:order 0 ; + sh:path reproschema:jsExpression ] ; sh:targetClass reproschema:MessageSpecification . schema1:ImageObject a sh:NodeShape ; @@ -781,6 +780,10 @@ schema1:ImageObject a sh:NodeShape ; sh:property [ sh:maxCount 1 ; sh:order 3 ; sh:path rdf:type ], + [ sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:order 1 ; + sh:path schema1:inLanguage ], [ sh:datatype xsd:anyURI ; sh:maxCount 1 ; sh:order 2 ; @@ -788,11 +791,7 @@ schema1:ImageObject a sh:NodeShape ; [ sh:maxCount 1 ; sh:minCount 1 ; sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ] ; + sh:path schema1:contentUrl ] ; sh:targetClass schema1:ImageObject . reproschema:UI a sh:NodeShape ; @@ -800,17 +799,11 @@ reproschema:UI a sh:NodeShape ; sh:description "['todo']" ; sh:ignoredProperties ( rdf:type ) ; sh:name "todo" ; - sh:property [ sh:datatype xsd:string ; - sh:description "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." ; - sh:name "Order" ; - sh:order 0 ; - sh:path reproschema:order ], - [ sh:class reproschema:AdditionalProperty ; - sh:description "An array of objects to describe the various properties added to assessments and Items." ; - sh:name "addProperties" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:addProperties ], + sh:property [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; + sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; + sh:name "allow" ; + sh:order 4 ; + sh:path reproschema:allow ], [ sh:datatype xsd:string ; sh:description "An element to describe the input type of a Item." ; sh:maxCount 1 ; @@ -827,17 +820,23 @@ reproschema:UI a sh:NodeShape ; sh:maxCount 1 ; sh:order 6 ; sh:path schema1:readonlyValue ], + [ sh:datatype xsd:string ; + sh:description "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." ; + sh:name "Order" ; + sh:order 0 ; + sh:path reproschema:order ], [ sh:datatype xsd:boolean ; sh:description "An element (bool) to determine if the list of items is shuffled or in order." ; sh:maxCount 1 ; sh:name "Shuffle" ; sh:order 3 ; sh:path reproschema:shuffle ], - [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; - sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; - sh:name "allow" ; - sh:order 4 ; - sh:path reproschema:allow ] ; + [ sh:class reproschema:AdditionalProperty ; + sh:description "An array of objects to describe the various properties added to assessments and Items." ; + sh:name "addProperties" ; + sh:nodeKind sh:BlankNode ; + sh:order 1 ; + sh:path reproschema:addProperties ] ; sh:targetClass reproschema:UI . rdf:langString a sh:NodeShape ; diff --git a/linkml-schema/reproschema.py b/linkml-schema/reproschema.py index c845385df0..2f716d6a30 100644 --- a/linkml-schema/reproschema.py +++ b/linkml-schema/reproschema.py @@ -29,28 +29,25 @@ class ConfiguredBaseModel(BaseModel): class AllowedType(str, Enum): - # Indicates (by boolean) if data can be exported or not. - AllowExport = "AllowExport" + AllowExport = "reproschema:AllowExport" # Indicates (by boolean) if items can be replayed or not. - AllowReplay = "AllowReplay" + AllowReplay = "reproschema:AllowReplay" # Indicates (by boolean) if assessments in a protocol can auto advance or not. - AutoAdvance = "AutoAdvance" + AutoAdvance = "reproschema:AutoAdvance" # Indicates (by boolean) if we can go back to a completed assessment in a protocol. - DisableBack = "DisableBack" - - + DisableBack = "reproschema:DisableBack" + class MissingType(str, Enum): - # An element to describe the choice when the item is skipped. - Skipped = "Skipped" + Skipped = "reproschema:Skipped" # An element to describe the choice when response is not known. - DontKnow = "DontKnow" + DontKnow = "reproschema:DontKnow" # An element to describe the choice when the reason for missing response is unknown. - Unknown = "Unknown" + Unknown = "reproschema:Unknown" # A boolean element to describe if the response did not occur within the prescribed time. - TimedOut = "TimedOut" + TimedOut = "reproschema:TimedOut" @@ -253,7 +250,7 @@ class Protocol(CreativeWork): compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) - landingPage: Optional[Union[LandingPage, str]] = Field(None, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") + landingPage: Optional[List[Union[LandingPage, str]]] = Field(default_factory=list, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") schemaVersion: Optional[str] = Field(None) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index f4902cb876..6411e6e38d 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -169,10 +169,12 @@ slots: title: Landing page content description: An element (by URL) to point to the protocol readme or landing page. slot_uri: reproschema:landingPage + multivalued: true any_of: - range: uri - range: string - range: LandingPage + inlined: true langstring_prefix: description: The language prefix component of a langString. From f7e135707310dd5786d690cfd494689d2948e56b Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sat, 17 Feb 2024 17:07:52 -0500 Subject: [PATCH 09/34] change name to also allow importing reproschema --- linkml-schema/{reproschema.py => reproschema_linkml.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename linkml-schema/{reproschema.py => reproschema_linkml.py} (100%) diff --git a/linkml-schema/reproschema.py b/linkml-schema/reproschema_linkml.py similarity index 100% rename from linkml-schema/reproschema.py rename to linkml-schema/reproschema_linkml.py From b0a72cb5378f721a98a5f73b09033c2851336051 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Sun, 18 Feb 2024 20:54:14 -0500 Subject: [PATCH 10/34] remove slot_usage of value for some classes --- linkml-schema/reproschema.yaml | 18 +----------------- linkml-schema/reproschema_linkml.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 6411e6e38d..44f1f3572f 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -258,8 +258,7 @@ slots: inlined: true prefLabel: title: preferred label - description: - - The preferred label. + description: The preferred label. slot_uri: skos:prefLabel multivalued: true range: langString @@ -396,9 +395,6 @@ classes: - schemaVersion - ui - version - slot_usage: - ui: - range: UI class_uri: reproschema:Activity AdditionalNoteObj: title: Additional Notes Object @@ -546,9 +542,6 @@ classes: - schemaVersion - ui - version - slot_usage: - ui: - range: UI class_uri: reproschema:Protocol Response: # multiple types title: Response @@ -558,15 +551,6 @@ classes: - isAbout - value #TODO it was schema:value - wasAttributedTo - slot_usage: - value: - any_of: - - range: MissingType - - range: decimal - - range: boolean - - range: string - - range: uri - - range: StructuredValue class_uri: reproschema:Response ResponseActivity: # multiple types title: ResponseActivity diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 2f716d6a30..f5ef087409 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -26,7 +26,7 @@ class ConfiguredBaseModel(BaseModel): pass - + class AllowedType(str, Enum): # Indicates (by boolean) if data can be exported or not. @@ -48,8 +48,8 @@ class MissingType(str, Enum): Unknown = "reproschema:Unknown" # A boolean element to describe if the response did not occur within the prescribed time. TimedOut = "reproschema:TimedOut" - - + + class AdditionalNoteObj(ConfiguredBaseModel): """ @@ -70,7 +70,7 @@ class AdditionalProperty(ConfiguredBaseModel): isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") valueRequired: Optional[bool] = Field(None) @@ -125,7 +125,7 @@ class Activity(CreativeWork): image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) @@ -148,7 +148,7 @@ class Item(CreativeWork): imageUrl: Optional[str] = Field(None, title="imageUrl", description="""An image url.""") isPartOf: Optional[Activity] = Field(None) preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") question: Optional[Dict[str, str]] = Field(default_factory=dict) responseOptions: Optional[Union[ResponseOption, str]] = Field(None, title="Response options", description="""An element (object or by URL)to describe the properties of response of the Item.""") schemaVersion: Optional[str] = Field(None) @@ -224,7 +224,7 @@ class OverrideProperty(ConfiguredBaseModel): isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") valueRequired: Optional[bool] = Field(None) @@ -252,7 +252,7 @@ class Protocol(CreativeWork): description: Optional[Dict[str, str]] = Field(default_factory=dict) landingPage: Optional[List[Union[LandingPage, str]]] = Field(default_factory=list, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) @@ -266,7 +266,7 @@ class Response(CreativeWork): Describes the response of an item. """ isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - value: Optional[Union[Decimal, MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) id: Optional[str] = Field(None) category: Optional[str] = Field(None) @@ -342,7 +342,7 @@ class UnitOption(ConfiguredBaseModel): """ An object to represent a human displayable name alongside the more formal value for units. """ - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""['The preferred label.']""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") value: Optional[Union[LangString, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") From 885f9b7d7dfbe54943c592cc5fa7dc43b8306afc Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sun, 18 Feb 2024 21:05:06 -0500 Subject: [PATCH 11/34] adding AllowSkip and fixing activity1 --- contexts/reproschema_new | 3 +++ examples/activities/activity1.jsonld | 2 +- linkml-schema/reproschema.yaml | 3 +++ linkml-schema/reproschema_linkml.py | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index af296b4ebb..2efaff31c5 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -276,6 +276,9 @@ "AllowReplay": { "@id": "reproschema:AllowReplay" }, + "AllowSkip": { + "@id": "reproschema:AllowSkip" + }, "AutoAdvance": { "@id": "reproschema:AutoAdvance" }, diff --git a/examples/activities/activity1.jsonld b/examples/activities/activity1.jsonld index a7da3bc16d..b7b3e296d3 100644 --- a/examples/activities/activity1.jsonld +++ b/examples/activities/activity1.jsonld @@ -41,7 +41,7 @@ "variableName": "item2", "valueRequired": true, "isVis": true, - "allow": ["reproschema:Skipped"] + "allow": ["reproschema:AllowSkip"] }, { "isAbout": "items/activity1_total_score", "variableName": "activity1_total_score", diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 44f1f3572f..9a4ace037b 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -631,6 +631,9 @@ enums: AllowReplay: description: Indicates (by boolean) if items can be replayed or not. meaning: reproschema:AllowReplay + AllowSkip: + description: Indicates (by boolean) if items can be skipped or not. + meaning: reproschema:AllowSkip AutoAdvance: description: Indicates (by boolean) if assessments in a protocol can auto advance or not. meaning: reproschema:AutoAdvance diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index f5ef087409..c8a79c5156 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -33,6 +33,8 @@ class AllowedType(str, Enum): AllowExport = "reproschema:AllowExport" # Indicates (by boolean) if items can be replayed or not. AllowReplay = "reproschema:AllowReplay" + # Indicates (by boolean) if items can be skipped or not. + AllowSkip = "reproschema:AllowSkip" # Indicates (by boolean) if assessments in a protocol can auto advance or not. AutoAdvance = "reproschema:AutoAdvance" # Indicates (by boolean) if we can go back to a completed assessment in a protocol. From 99f220b8cdb6d26681aab36d9d5718370804bc5e Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Wed, 21 Feb 2024 09:20:55 -0500 Subject: [PATCH 12/34] changing LangString to Dict[str, str] --- linkml-schema/reproschema_linkml.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index c8a79c5156..860d400ca3 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -59,7 +59,7 @@ class AdditionalNoteObj(ConfiguredBaseModel): """ column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") - value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -93,7 +93,7 @@ class Choice(ConfiguredBaseModel): """ name: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -168,16 +168,7 @@ class LandingPage(ConfiguredBaseModel): """ inLanguage: Optional[str] = Field(None) id: Optional[str] = Field(None) - - -class LangString(ConfiguredBaseModel): - """ - RDF langString tuple - """ - langstring_prefix: str = Field(..., description="""The language prefix component of a langString.""") - langstring_value: str = Field(..., description="""The value component of a langString.""") - class MediaObject(CreativeWork): @@ -268,7 +259,7 @@ class Response(CreativeWork): Describes the response of an item. """ isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - value: Optional[Union[Decimal, LangString, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) id: Optional[str] = Field(None) category: Optional[str] = Field(None) @@ -345,7 +336,7 @@ class UnitOption(ConfiguredBaseModel): An object to represent a human displayable name alongside the more formal value for units. """ prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - value: Optional[Union[LangString, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Dict[str, str], str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -370,7 +361,6 @@ class VideoObject(MediaObject): Activity.model_rebuild() Item.model_rebuild() LandingPage.model_rebuild() -LangString.model_rebuild() MediaObject.model_rebuild() AudioObject.model_rebuild() ImageObject.model_rebuild() From c7c534810453444545b2c1e2df044ec40dd78968 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Wed, 21 Feb 2024 10:16:42 -0500 Subject: [PATCH 13/34] fixing vocab in the context file --- contexts/reproschema_new | 142 ++------------------------------- linkml-schema/reproschema.yaml | 5 +- 2 files changed, 9 insertions(+), 138 deletions(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 2efaff31c5..688be2afd1 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -19,7 +19,7 @@ "@prefix": true }, "xsd": "http://www.w3.org/2001/XMLSchema#", - "@vocab": "http://example.org/example/", + "@vocab": "http://schema.repronim.org/", "@version": 1.1, "@language": "en", "id": "@id", @@ -28,17 +28,12 @@ "about": { "@id": "schema:about" }, - "additionalNotesObj": { - "@id": "reproschema:additionalNotesObj" - }, "addProperties": { - "@id": "reproschema:addProperties", "@container": "@set", "@nest": "ui" }, "allow": { "@type": "@id", - "@id": "reproschema:allow", "@container": "@set", "@nest": "ui" }, @@ -53,19 +48,14 @@ "@type": "@id", "@id": "schema:audio" }, - "choices": { - "@id": "reproschema:choices" - }, "citation": { "@id": "schema:citation", "@container": "@language" }, "column": { - "@id": "reproschema:column", "@type": "xsd:string" }, "compute": { - "@id": "reproschema:compute", "@container": "@list" }, "contentUrl": { @@ -94,61 +84,44 @@ "@id": "schema:image" }, "imageUrl": { - "@type": "@id", - "@id": "reproschema:imageUrl" + "@type": "@id" }, "inLanguage": { "@id": "schema:inLanguage", "@language": null }, "inputType": { - "@id": "reproschema:inputType", "@type": "xsd:string", "@nest": "ui" }, "isAbout": { - "@type": "@id", - "@id": "reproschema:isAbout" + "@type": "@id" }, "isPartOf": { "@type": "@id", "@id": "schema:isPartOf" }, - "isVis": { - "@id": "reproschema:isVis" - }, - "jsExpression": { - "@id": "reproschema:jsExpression" - }, "landingPage": { "@type": "@id", - "@id": "reproschema:landingPage", "@container": "@set" }, "limit": { - "@id": "reproschema:limit", "@language": null }, - "maxRetakes": { - "@id": "reproschema:maxRetakes" - }, "maxValue": { "@id": "schema:maxValue" }, "message": { - "@id": "reproschema:message", "@container": "@language" }, "messages": { - "@container": "@set", - "@id": "reproschema:messages" + "@container": "@set" }, "minValue": { "@id": "schema:minValue" }, "multipleChoice": { - "@type": "xsd:boolean", - "@id": "reproschema:multipleChoice" + "@type": "xsd:boolean" }, "name": { "@id": "schema:name", @@ -156,12 +129,10 @@ }, "order": { "@type": "@id", - "@id": "reproschema:order", "@container": "@list", "@nest": "ui" }, "overrideProperties": { - "@id": "reproschema:overrideProperties", "@container": "@set", "@nest": "ui" }, @@ -178,7 +149,6 @@ "@container": "@language" }, "randomMaxDelay": { - "@id": "reproschema:randomMaxDelay", "@language": null }, "readonlyValue": { @@ -186,11 +156,9 @@ "@id": "schema:readonlyValue" }, "responseOptions": { - "@type": "@id", - "@id": "reproschema:responseOptions" + "@type": "@id" }, "schedule": { - "@id": "reproschema:schedule", "@language": null }, "schemaVersion": { @@ -199,26 +167,20 @@ }, "shuffle": { "@type": "xsd:boolean", - "@id": "reproschema:shuffle", "@nest": "ui" }, "source": { - "@id": "reproschema:source", "@type": "xsd:string" }, "startedAtTime": { "@type": "xsd:dateTime", "@id": "prov:startedAtTime" }, - "statusOptions": { - "@id": "reproschema:statusOptions" - }, "subject_id": { "@id": "nidm:subject_id" }, "unitOptions": { - "@type": "@id", - "@id": "reproschema:unitOptions" + "@type": "@id" }, "url": { "@type": "@id", @@ -228,19 +190,12 @@ "@type": "@id", "@id": "prov:used" }, - "value": { - "@id": "reproschema:value" - }, "valueRequired": { "@type": "xsd:boolean", "@id": "schema:valueRequired" }, "valueType": { - "@type": "@id", - "@id": "reproschema:valueType" - }, - "variableName": { - "@id": "reproschema:variableName" + "@type": "@id" }, "version": { "@id": "schema:version", @@ -261,105 +216,24 @@ "Activity": { "@id": "reproschema:Activity" }, - "AdditionalNoteObj": { - "@id": "reproschema:AdditionalNoteObj" - }, - "AdditionalProperty": { - "@id": "reproschema:AdditionalProperty" - }, "Agent": { "@id": "prov:Agent" }, - "AllowExport": { - "@id": "reproschema:AllowExport" - }, - "AllowReplay": { - "@id": "reproschema:AllowReplay" - }, - "AllowSkip": { - "@id": "reproschema:AllowSkip" - }, - "AutoAdvance": { - "@id": "reproschema:AutoAdvance" - }, - "Choice": { - "@id": "reproschema:Choice" - }, - "ComputeSpecification": { - "@id": "reproschema:ComputeSpecification" - }, "CreativeWork": { "@id": "schema:CreativeWork" }, - "DisableBack": { - "@id": "reproschema:DisableBack" - }, - "DontKnow": { - "@id": "reproschema:DontKnow" - }, - "Item": { - "@id": "reproschema:Field" - }, - "LandingPage": { - "@id": "reproschema:LandingPage" - }, "LangString": { "@id": "rdf:langString" }, "MediaObject": { "@id": "schema:MediaObject" }, - "MessageSpecification": { - "@id": "reproschema:MessageSpecification" - }, - "OverrideProperty": { - "@id": "reproschema:OverrideProperty" - }, - "Participant": { - "@id": "reproschema:Participant" - }, - "Protocol": { - "@id": "reproschema:Protocol" - }, - "Response": { - "@id": "reproschema:Response" - }, - "ResponseActivity": { - "@id": "reproschema:ResponseActivity" - }, - "ResponseOption": { - "@id": "reproschema:ResponseOption" - }, - "Schedule": { - "@id": "reproschema:Schedule" - }, - "Skipped": { - "@id": "reproschema:Skipped" - }, - "SoftwareAgent": { - "@id": "reproschema:SoftwareAgent" - }, "StructuredValue": { "@id": "schema:StructuredValue" }, "Thing": { "@id": "schema:Thing" }, - "TimedOut": { - "@id": "reproschema:TimedOut" - }, - "UiActivity": { - "@id": "http://example.org/example/UiActivity" - }, - "UiField": { - "@id": "http://example.org/example/UiField" - }, - "UiProtocol": { - "@id": "http://example.org/example/UiProtocol" - }, - "UnitOption": { - "@id": "reproschema:UnitOption" - }, "VideoObject": { "@id": "schema:VideoObject" } diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 9a4ace037b..5803ee3d79 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -1,5 +1,5 @@ name: reproschema -id: http://schema.repronim.org/ # todo: change this +id: http://schema.repronim.org/ imports: - linkml:types prefixes: @@ -278,9 +278,6 @@ slots: readonlyValue: slot_uri: schema:readonlyValue range: boolean -# requiredValue: -# range: boolean -# slot_uri: schema:requiredValue responseOptions: title: Response options description: An element (object or by URL)to describe the properties of response of the Item. From 577009be9fd0f19327c620fa61409cbdc5186c51 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 23 Feb 2024 13:42:23 -0500 Subject: [PATCH 14/34] fixing alt label so it is also langString, adding altLabel to the example --- examples/activities/items/item1.jsonld | 1 + linkml-schema/reproschema.yaml | 3 +++ linkml-schema/reproschema_linkml.py | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/activities/items/item1.jsonld b/examples/activities/items/item1.jsonld index 26b76643b7..569762425f 100644 --- a/examples/activities/items/item1.jsonld +++ b/examples/activities/items/item1.jsonld @@ -3,6 +3,7 @@ "@type": "reproschema:Field", "@id": "item1.jsonld", "prefLabel": "item1", + "altLabel": "item1_alt", "description": "Q1 of example 1", "schemaVersion": "1.0.0-rc4", "version": "0.0.1", diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 5803ee3d79..00c1ff250b 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -45,6 +45,9 @@ slots: title: alternate label description: The alternate label. slot_uri: skos:altLabel + multivalued: true + range: langString + inlined: true associatedMedia: title: associatedMedia description: A media object that encodes this CreativeWork. This property is a synonym for encoding. diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 860d400ca3..f32cc123b6 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -118,7 +118,7 @@ class Activity(CreativeWork): An assessment in a protocol. """ about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") citation: Optional[Dict[str, str]] = Field(default_factory=dict) compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") @@ -142,7 +142,7 @@ class Item(CreativeWork): """ about: Optional[str] = Field(None, description="""The subject matter of the Field.""") additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes", description="""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.""") - altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") audio: Optional[Union[AudioObject, str]] = Field(None, title="audio", description="""TODO""") description: Optional[Dict[str, str]] = Field(default_factory=dict) @@ -238,7 +238,7 @@ class Protocol(CreativeWork): A representation of a study which comprises one or more assessments. """ about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[str] = Field(None, title="alternate label", description="""The alternate label.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") From 083a8cc625584297f59a09e8ba713839932b920a Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 23 Feb 2024 16:17:24 -0500 Subject: [PATCH 15/34] fixing context for additionalNotesObj --- contexts/reproschema_new | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 688be2afd1..79ecf1c6e3 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -32,6 +32,9 @@ "@container": "@set", "@nest": "ui" }, + "additionalNotesObj": { + "@container": "@set" + }, "allow": { "@type": "@id", "@container": "@set", From f88f74b4dfa50666d198ed7bf363417811ef8c41 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 26 Feb 2024 12:35:40 -0500 Subject: [PATCH 16/34] adding container to choices in the context --- contexts/reproschema_new | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 79ecf1c6e3..0dd506d288 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -51,6 +51,9 @@ "@type": "@id", "@id": "schema:audio" }, + "choices": { + "@container": "@set" + }, "citation": { "@id": "schema:citation", "@container": "@language" From 7dbffe30f0d5f4482b33556be28e8b74d719a42c Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 1 Mar 2024 14:52:01 -0500 Subject: [PATCH 17/34] adding additional container=set to the context --- contexts/reproschema_new | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contexts/reproschema_new b/contexts/reproschema_new index 0dd506d288..8c7414e359 100644 --- a/contexts/reproschema_new +++ b/contexts/reproschema_new @@ -186,7 +186,8 @@ "@id": "nidm:subject_id" }, "unitOptions": { - "@type": "@id" + "@type": "@id", + "@container": "@set" }, "url": { "@type": "@id", @@ -194,6 +195,7 @@ }, "used": { "@type": "@id", + "@container": "@set", "@id": "prov:used" }, "valueRequired": { From 27949dc184a7ec20da7be13cc764c9005e4ed074 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 1 Mar 2024 15:05:09 -0500 Subject: [PATCH 18/34] removing old contexts and renaming the new one --- contexts/base | 18 -- contexts/generic | 279 ------------------ contexts/{reproschema_new => reproschema} | 0 examples/activities/activity1.jsonld | 2 +- examples/activities/activity1_embed.jsonld | 2 +- .../activities/items/activity1_total_score | 2 +- examples/activities/items/item1.jsonld | 2 +- examples/activities/items/item2.jsonld | 2 +- examples/protocols/protocol1.jsonld | 2 +- examples/protocols/protocol1_embed.jsonld | 2 +- examples/responses/response1.jsonld | 2 +- examples/responses/responseActivity1.jsonld | 2 +- 12 files changed, 9 insertions(+), 306 deletions(-) delete mode 100644 contexts/base delete mode 100644 contexts/generic rename contexts/{reproschema_new => reproschema} (100%) diff --git a/contexts/base b/contexts/base deleted file mode 100644 index ac6fb734d8..0000000000 --- a/contexts/base +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@context": { - "@version": 1.1, - "dct": "http://purl.org/dc/terms/", - "owl": "http://www.w3.org/2002/07/owl#", - "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", - "rdfa": "http://www.w3.org/ns/rdfa#", - "rdfs": "http://www.w3.org/2000/01/rdf-schema#", - "schema": "http://schema.org/", - "xsd": "http://www.w3.org/2001/XMLSchema#", - "skos": "http://www.w3.org/2004/02/skos/core#", - "prov": "http://www.w3.org/ns/prov#", - "pav": "http://purl.org/pav/", - "nidm": "http://purl.org/nidash/nidm#", - "uuid": "http://uuid.repronim.org/", - "reproschema": "http://schema.repronim.org/" - } -} diff --git a/contexts/generic b/contexts/generic deleted file mode 100644 index 8a9ba1b47a..0000000000 --- a/contexts/generic +++ /dev/null @@ -1,279 +0,0 @@ -{ - "@context": [ "base", - { - "@version": 1.1, - "@language": "en", - "description": { - "@id": "schema:description", - "@container": "@language" - }, - "name": { - "@id": "schema:name", - "@container": "@language" - }, - "value": { - "@id": "reproschema:value" - }, - "image": { - "@id": "schema:image" - }, - "imageUrl": { - "@id": "schema:image", - "@type": "@id" - }, - "audio": { - "@id": "schema:audio" - }, - "video": { - "@id": "schema:video" - }, - "contentUrl": { - "@id": "schema:contentUrl", - "@type": "@id" - }, - "VideoObject": "schema:VideoObject", - "AudioObject": "schema:AudioObject", - "inLanguage": { - "@id": "schema:inLanguage" - }, - "url": { - "@id": "schema:url", - "@type": "@id" - }, - "citation": { - "@id": "schema:citation", - "@container": "@language" - }, - "version": { - "@id": "schema:version" - }, - "schemaVersion": { - "@id": "schema:schemaVersion" - }, - "prefLabel": { - "@id": "skos:prefLabel", - "@container": "@language" - }, - "altLabel": { - "@id": "skos:altLabel", - "@container": "@language" - }, - "preamble": { - "@id": "reproschema:preamble", - "@container": "@language" - }, - "valueType": { - "@id": "reproschema:valueType", - "@type": "@id", - "@container": "@set" - }, - "landingPage": { - "@id": "reproschema:landingPage", - "@type": "@id", - "@container": "@set" - }, - "question": { - "@id": "schema:question", - "@container": "@language" - }, - "choices": { - "@id": "reproschema:choices" - }, - "valueRequired": "schema:valueRequired", - "multipleChoice": { - "@id": "reproschema:multipleChoice", - "@type": "schema:Boolean" - }, - "responseOptions": { - "@id": "reproschema:responseOptions", - "@container": "@set", - "@type": "@id" - }, - "dataType": { - "@id": "schema:DataType", - "@type": "@id" - }, - "minValue": { - "@id": "schema:minValue" - }, - "maxValue": { - "@id": "schema:maxValue" - }, - "unitCode": { - "@id": "schema:unitCode", - "@container": "@set" - }, - "unitOptions": { - "@id": "reproschema:unitOptions", - "@container": "@set" - }, - "ui" : "@nest", - "order": { - "@id": "reproschema:order", - "@container": "@list", - "@type": "@id", - "@nest": "ui" - }, - "addProperties": { - "@id": "reproschema:addProperties", - "@type": "reproschema:AdditionalProperty", - "@container": "@set", - "@nest": "ui" - }, - "overrideProperties": { - "@id": "reproschema:overrideProperties", - "@type": "reproschema:OverrideProperty", - "@container": "@set", - "@nest": "ui" - }, - "message": { - "@id": "reproschema:message", - "@container": "@language" - }, - "shuffle": { - "@id": "reproschema:shuffle", - "@type": "schema:Boolean", - "@nest": "ui" - }, - "inputOptions": { - "@id": "reproschema:inputs", - "@container": "@index", - "@nest": "ui" - }, - "inputType": { - "@id": "reproschema:inputType", - "@type": "xsd:string", - "@nest": "ui" - }, - "readonlyValue": { - "@id": "schema:readonlyValue", - "@nest": "ui" - }, - "compute": { - "@id": "reproschema:compute", - "@container": "@set" - }, - "messages": { - "@id": "reproschema:messages", - "@container": "@set" - }, - "jsExpression": { - "@id": "reproschema:jsExpression" - }, - "isVis": { - "@id": "reproschema:isVis" - }, - "variableName": "reproschema:variableName", - "isAbout": { - "@id": "reproschema:isAbout", - "@type": "@id" - }, - "allow": { - "@id": "reproschema:allow", - "@container": "@set", - "@type": "@id", - "@nest": "ui" - }, - "reproschema:Skipped": {"@id": "reproschema:Skipped"}, - "reproschema:DontKnow": {"@id": "reproschema:DontKnow"}, - "reproschema:TimedOut": {"@id": "reproschema:TimedOut"}, - "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", - "@nest": "ui" - }, - "delay": { - "@id": "reproschema:delay", - "@type": "@id", - "@nest": "ui" - }, - "additionalNotesObj": { - "@id": "reproschema:additionalNotesObj", - "@type": "reproschema:AdditionalNoteObj", - "@container": "@set" - }, - "source": { - "@id": "reproschema:source", - "@type": "xsd:string" - }, - "column": { - "@id": "reproschema:column", - "@type": "xsd:string" - }, - "randomMaxDelay": { - "@id": "reproschema:randomMaxDelay" - }, - "schedule": { - "@id": "reproschema:schedule" - }, - "limit": { - "@id": "reproschema:limit" - }, - "maxRetakes": { - "@id": "reproschema:maxRetakes" - }, - "importedFrom": { - "@id": "pav:importedFrom", - "@type": "@id" - }, - "importedBy": { - "@id": "pav:importedBy", - "@type": "@id" - }, - "createdWith": { - "@id": "pav:createdWith", - "@type": "@id" - }, - "createdBy": { - "@id": "pav:createdBy", - "@type": "@id" - }, - "createdOn": { - "@id": "pav:createdOn", - "@type": "xsd:dateTime" - }, - "previousVersion": { - "@id": "pav:previousVersion", - "@type": "@id" - }, - "lastUpdateOn": { - "@id": "pav:lastUpdateOn", - "@type": "xsd:dateTime" - }, - "derivedFrom": { - "@id": "prov:wasDerivedFrom", - "@type": "@id" - }, - "used": { - "@id": "prov:used", - "@container": "@set", - "@type": "@id" - }, - "wasAttributedTo": { - "@id": "prov:wasAttributedTo", - "@type": "reproschema:Participant", - "@container": "@set" - }, - "wasAssociatedWith": { - "@id": "prov:wasAssociatedWith", - "@type": "reproschema:SoftwareAgent", - "@container": "@set" - }, - "subject_id": { - "@id": "nidm:subject_id" - }, - "startedAtTime": { - "@id": "prov:startedAtTime", - "@type": "xsd:dateTime" - }, - "endedAtTime": { - "@id": "prov:endedAtTime", - "@type": "xsd:dateTime" - } - } - ] -} diff --git a/contexts/reproschema_new b/contexts/reproschema similarity index 100% rename from contexts/reproschema_new rename to contexts/reproschema diff --git a/examples/activities/activity1.jsonld b/examples/activities/activity1.jsonld index b7b3e296d3..6ffe5f050b 100644 --- a/examples/activities/activity1.jsonld +++ b/examples/activities/activity1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:Activity", "@id": "activity1.jsonld", "prefLabel": "Example 1", diff --git a/examples/activities/activity1_embed.jsonld b/examples/activities/activity1_embed.jsonld index cdf6e4382d..fc27f7cd35 100644 --- a/examples/activities/activity1_embed.jsonld +++ b/examples/activities/activity1_embed.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:Activity", "@id": "activity1.jsonld", "prefLabel": "Example 1", diff --git a/examples/activities/items/activity1_total_score b/examples/activities/items/activity1_total_score index 8174c85962..b384e74fcb 100644 --- a/examples/activities/items/activity1_total_score +++ b/examples/activities/items/activity1_total_score @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/reproschema_new", + "@context": "../../../contexts/reproschema", "@type": "reproschema:Field", "@id": "activity1_total_score", "prefLabel": "activity1_total_score", diff --git a/examples/activities/items/item1.jsonld b/examples/activities/items/item1.jsonld index 569762425f..0584f3bcaa 100644 --- a/examples/activities/items/item1.jsonld +++ b/examples/activities/items/item1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/reproschema_new", + "@context": "../../../contexts/reproschema", "@type": "reproschema:Field", "@id": "item1.jsonld", "prefLabel": "item1", diff --git a/examples/activities/items/item2.jsonld b/examples/activities/items/item2.jsonld index bfcfedd540..d37c68c408 100644 --- a/examples/activities/items/item2.jsonld +++ b/examples/activities/items/item2.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../../contexts/reproschema_new", + "@context": "../../../contexts/reproschema", "@type": "reproschema:Field", "@id": "item2.jsonld", "prefLabel": "item2", diff --git a/examples/protocols/protocol1.jsonld b/examples/protocols/protocol1.jsonld index 54d3d4178a..7af2813101 100644 --- a/examples/protocols/protocol1.jsonld +++ b/examples/protocols/protocol1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { diff --git a/examples/protocols/protocol1_embed.jsonld b/examples/protocols/protocol1_embed.jsonld index 70ff72f785..3cf1b29e62 100644 --- a/examples/protocols/protocol1_embed.jsonld +++ b/examples/protocols/protocol1_embed.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { diff --git a/examples/responses/response1.jsonld b/examples/responses/response1.jsonld index 936070297c..3dc93014e3 100644 --- a/examples/responses/response1.jsonld +++ b/examples/responses/response1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:Response", "@id": "uuid:fc963765-1f1b-4ad9-bc4b-0d21b9de5acb", "wasAttributedTo": { diff --git a/examples/responses/responseActivity1.jsonld b/examples/responses/responseActivity1.jsonld index df73f87d33..e7b9bbf4d4 100644 --- a/examples/responses/responseActivity1.jsonld +++ b/examples/responses/responseActivity1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/reproschema_new", + "@context": "../../contexts/reproschema", "@type": "reproschema:ResponseActivity", "@id": "uuid:96496a96-50d6-4b87-a65e-468420e7c80d", "used": [ From 953087b961dfc0f3f97a674533d459bfff38fde2 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Thu, 28 Mar 2024 21:24:46 -0400 Subject: [PATCH 19/34] updates based on the examples from reproschema-library --- contexts/reproschema | 6 ++++-- linkml-schema/reproschema.yaml | 5 ++++- linkml-schema/reproschema_linkml.py | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/contexts/reproschema b/contexts/reproschema index 8c7414e359..9130976d14 100644 --- a/contexts/reproschema +++ b/contexts/reproschema @@ -159,7 +159,8 @@ }, "readonlyValue": { "@type": "xsd:boolean", - "@id": "schema:readonlyValue" + "@id": "schema:readonlyValue", + "@nest": "ui" }, "responseOptions": { "@type": "@id" @@ -203,7 +204,8 @@ "@id": "schema:valueRequired" }, "valueType": { - "@type": "@id" + "@type": "@id", + "@container": "@set" }, "version": { "@id": "schema:version", diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 00c1ff250b..c60a0f28bf 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -128,7 +128,9 @@ slots: An image of the item. This can be a URL or a fully described ImageObject. slot_uri: schema:image - range: ImageObject + any_of: + - range: ImageObject + - range: uri imageUrl: title: imageUrl description: An image url. @@ -354,6 +356,7 @@ slots: title: The type of the response description: The type of the response of an item. For example, string, integer, etc. slot_uri: reproschema:valueType + multivalued: true range: string valueRequired: slot_uri: schema:valueRequired diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index f32cc123b6..4121d18b49 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -92,7 +92,7 @@ class Choice(ConfiguredBaseModel): An object to describe a response option. """ name: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -124,7 +124,7 @@ class Activity(CreativeWork): compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") @@ -146,7 +146,7 @@ class Item(CreativeWork): associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") audio: Optional[Union[AudioObject, str]] = Field(None, title="audio", description="""TODO""") description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[ImageObject] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") imageUrl: Optional[str] = Field(None, title="imageUrl", description="""An image url.""") isPartOf: Optional[Activity] = Field(None) preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") @@ -291,7 +291,7 @@ class ResponseOption(ConfiguredBaseModel): minValue: Optional[Union[float, int]] = Field(None) multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") - valueType: Optional[str] = Field(None, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") + valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") From befbd8c853665212976dba4ed56428c0155c8b91 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Tue, 2 Apr 2024 11:51:48 -0400 Subject: [PATCH 20/34] additional changes based on testing library: adding CreativeWork to ResponseOption, dealing with dict-form of compute --- contexts/reproschema | 2 +- linkml-schema/reproschema.yaml | 1 + linkml-schema/reproschema_linkml.py | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contexts/reproschema b/contexts/reproschema index 9130976d14..d7b3f4e924 100644 --- a/contexts/reproschema +++ b/contexts/reproschema @@ -62,7 +62,7 @@ "@type": "xsd:string" }, "compute": { - "@container": "@list" + "@id": "reproschema:compute" }, "contentUrl": { "@type": "@id", diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index c60a0f28bf..93b20e8eb8 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -572,6 +572,7 @@ classes: ResponseOption: title: Response option description: An element (object or by URL)to describe the properties of response of the Item. + is_a: CreativeWork slots: - choices - datumType diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 4121d18b49..82fe3227fe 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -121,7 +121,7 @@ class Activity(CreativeWork): altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + compute: Optional[Union[List[ComputeSpecification], ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") @@ -240,7 +240,7 @@ class Protocol(CreativeWork): about: Optional[str] = Field(None, description="""The subject matter of the Field.""") altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + compute: Optional[Union[List[ComputeSpecification], ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) landingPage: Optional[List[Union[LandingPage, str]]] = Field(default_factory=list, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") @@ -281,7 +281,7 @@ class ResponseActivity(CreativeWork): -class ResponseOption(ConfiguredBaseModel): +class ResponseOption(CreativeWork): """ An element (object or by URL)to describe the properties of response of the Item. """ @@ -292,6 +292,8 @@ class ResponseOption(ConfiguredBaseModel): multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") + id: Optional[str] = Field(None) + category: Optional[str] = Field(None) From fcea6fdca97bce070d3900758e75c09f18e36082 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Thu, 4 Apr 2024 17:04:14 -0400 Subject: [PATCH 21/34] fixing compute --- contexts/reproschema | 3 ++- linkml-schema/reproschema_linkml.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contexts/reproschema b/contexts/reproschema index d7b3f4e924..566c2ab43d 100644 --- a/contexts/reproschema +++ b/contexts/reproschema @@ -62,7 +62,8 @@ "@type": "xsd:string" }, "compute": { - "@id": "reproschema:compute" + "@id": "reproschema:compute", + "@container": "@set" }, "contentUrl": { "@type": "@id", diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 82fe3227fe..b00a48a8c2 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -121,7 +121,7 @@ class Activity(CreativeWork): altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[Union[List[ComputeSpecification], ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") @@ -240,7 +240,7 @@ class Protocol(CreativeWork): about: Optional[str] = Field(None, description="""The subject matter of the Field.""") altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") - compute: Optional[Union[List[ComputeSpecification], ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) landingPage: Optional[List[Union[LandingPage, str]]] = Field(default_factory=list, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") From 5a4788f5832dc57ddc48d135413739841b181ad6 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Thu, 4 Apr 2024 17:13:01 -0400 Subject: [PATCH 22/34] adding MissingType to the Response value --- linkml-schema/reproschema.yaml | 3 ++- linkml-schema/reproschema_linkml.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 93b20e8eb8..31ed4d3c5e 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -351,6 +351,7 @@ slots: - range: langString - range: uri - range: string + - range: MissingType inlined: true valueType: title: The type of the response @@ -552,7 +553,7 @@ classes: is_a: CreativeWork slots: - isAbout - - value #TODO it was schema:value + - value - wasAttributedTo class_uri: reproschema:Response ResponseActivity: # multiple types diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index b00a48a8c2..c2bd550b9f 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -59,7 +59,7 @@ class AdditionalNoteObj(ConfiguredBaseModel): """ column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") - value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -93,7 +93,7 @@ class Choice(ConfiguredBaseModel): """ name: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") @@ -259,7 +259,7 @@ class Response(CreativeWork): Describes the response of an item. """ isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - value: Optional[Union[Decimal, Dict[str, str], StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) id: Optional[str] = Field(None) category: Optional[str] = Field(None) From 2ea709f2cf6c29ca67d4900fc68aed233455a89d Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 5 Apr 2024 09:36:35 -0400 Subject: [PATCH 23/34] adding AllowAltResponse option --- linkml-schema/reproschema.yaml | 3 +++ linkml-schema/reproschema_linkml.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 31ed4d3c5e..2459bbe34e 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -630,6 +630,9 @@ classes: enums: AllowedType: permissible_values: + AllowAltResponse: + description: Indicates (by boolean) if alternate responses are allowed or not. + meaning: reproschema:AllowAltResponse AllowExport: description: Indicates (by boolean) if data can be exported or not. meaning: reproschema:AllowExport diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index c2bd550b9f..91b94cfeb4 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -29,6 +29,9 @@ class ConfiguredBaseModel(BaseModel): class AllowedType(str, Enum): + + # Indicates (by boolean) if alternate responses are allowed or not. + AllowAltResponse = "reproschema:AllowAltResponse" # Indicates (by boolean) if data can be exported or not. AllowExport = "reproschema:AllowExport" # Indicates (by boolean) if items can be replayed or not. From 362330b48978cde1bd36a5fc8c15722f44bb9278 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 12 Apr 2024 23:14:03 -0400 Subject: [PATCH 24/34] adding CreativeWork to most of the classes; adding description to CreativeWork slots; slightly different formatting from the linkml generator --- linkml-schema/reproschema.yaml | 18 +- linkml-schema/reproschema_linkml.py | 269 ++++++++++++++-------------- 2 files changed, 147 insertions(+), 140 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 2459bbe34e..b4351d413b 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -1,5 +1,6 @@ name: reproschema id: http://schema.repronim.org/ +version: 1.0.0 imports: - linkml:types prefixes: @@ -61,6 +62,7 @@ slots: - range: AudioObject inlined: true category: + description: A specific type of class. slot_uri: rdf:type range: uriorcurie choices: @@ -120,7 +122,8 @@ slots: slot_uri: prov:generated range: uri id: - slot_uri: schema:id + description: A unique identifier for an item. + slot_uri: schema:identifier range: uri image: title: image @@ -405,6 +408,7 @@ classes: description: A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema + is_a: CreativeWork slots: - column - source @@ -413,6 +417,7 @@ classes: AdditionalProperty: title: Additional properties description: An object to describe the various properties added to assessments and Items. + is_a: CreativeWork slots: - allow - isAbout @@ -434,6 +439,7 @@ classes: Choice: title: Response choice description: An object to describe a response option. + is_a: CreativeWork slots: - name - image @@ -442,6 +448,7 @@ classes: ComputeSpecification: title: Compute Specification description: An object to define computations in an activity or protocol. + is_a: CreativeWork slots: - jsExpression - variableName @@ -480,9 +487,9 @@ classes: LandingPage: title: Landing Page description: An object to define the landing page of a protocol. + is_a: CreativeWork slots: - inLanguage - - id class_uri: reproschema:LandingPage langString: description: RDF langString tuple @@ -504,6 +511,7 @@ classes: MessageSpecification: title: Message Specification description: An object to define messages in an activity or protocol. + is_a: CreativeWork slots: - jsExpression - message @@ -511,6 +519,7 @@ classes: OverrideProperty: title: Additional properties description: An object to override the various properties added to assessments and Items. + is_a: CreativeWork slots: - isAbout - isVis @@ -527,6 +536,7 @@ classes: description: An Agent describing characteristics associated with a participant. is_a: Agent slots: + - id - subject_id class_uri: reproschema:Participant Protocol: # TODO multiple types @@ -588,6 +598,7 @@ classes: description: Captures information about some action that took place. It also links to information (entities) that were used during the activity + is_a: CreativeWork slots: - version - url @@ -595,8 +606,6 @@ classes: StructuredValue: is_a: CreativeWork class_uri: schema:StructuredValue - Thing: # todo should we switch - class_uri: schema:Thing UI: title: todo description: @@ -613,6 +622,7 @@ classes: UnitOption: title: Unit options description: An object to represent a human displayable name alongside the more formal value for units. + is_a: CreativeWork slots: - prefLabel - value diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 91b94cfeb4..2175deb546 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -1,33 +1,51 @@ -from __future__ import annotations -from datetime import datetime, date -from enum import Enum - -from decimal import Decimal -from typing import List, Dict, Optional, Any, Union -from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator +from __future__ import annotations +from datetime import ( + datetime, + date +) +from decimal import Decimal +from enum import Enum import re import sys -if sys.version_info >= (3, 8): - from typing import Literal +from typing import ( + Any, + List, + Literal, + Dict, + Optional, + Union +) +from pydantic.version import VERSION as PYDANTIC_VERSION +if int(PYDANTIC_VERSION[0])>=2: + from pydantic import ( + BaseModel, + ConfigDict, + Field, + field_validator + ) else: - from typing_extensions import Literal - + from pydantic import ( + BaseModel, + Field, + validator + ) metamodel_version = "None" -version = "None" +version = "1.0.0" + class ConfiguredBaseModel(BaseModel): model_config = ConfigDict( - validate_assignment=True, - validate_default=True, - extra = 'forbid', - arbitrary_types_allowed=True, - use_enum_values = True) - + validate_assignment = True, + validate_default = True, + extra = "forbid", + arbitrary_types_allowed = True, + use_enum_values = True, + strict = False, + ) pass - class AllowedType(str, Enum): # Indicates (by boolean) if alternate responses are allowed or not. @@ -54,19 +72,49 @@ class MissingType(str, Enum): # A boolean element to describe if the response did not occur within the prescribed time. TimedOut = "reproschema:TimedOut" +class Agent(ConfiguredBaseModel): + pass + + +class CreativeWork(ConfiguredBaseModel): + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + + +class Activity(CreativeWork): + """ + An assessment in a protocol. + """ + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + citation: Optional[Dict[str, str]] = Field(default_factory=dict) + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") + preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class AdditionalNoteObj(ConfiguredBaseModel): +class AdditionalNoteObj(CreativeWork): """ A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema """ column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class AdditionalProperty(ConfiguredBaseModel): + +class AdditionalProperty(CreativeWork): """ An object to describe the various properties added to assessments and Items. """ @@ -81,63 +129,30 @@ class AdditionalProperty(ConfiguredBaseModel): valueRequired: Optional[bool] = Field(None) variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class Agent(ConfiguredBaseModel): - - None - - -class Choice(ConfiguredBaseModel): +class Choice(CreativeWork): """ An object to describe a response option. """ name: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + -class ComputeSpecification(ConfiguredBaseModel): +class ComputeSpecification(CreativeWork): """ An object to define computations in an activity or protocol. """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - - - -class CreativeWork(ConfiguredBaseModel): - - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class Activity(CreativeWork): - """ - An assessment in a protocol. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") - citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") - cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - class Item(CreativeWork): """ @@ -160,17 +175,17 @@ class Item(CreativeWork): ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) video: Optional[VideoObject] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + -class LandingPage(ConfiguredBaseModel): +class LandingPage(CreativeWork): """ An object to define the landing page of a protocol. """ inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") @@ -180,39 +195,35 @@ class MediaObject(CreativeWork): """ contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class AudioObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class ImageObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class MessageSpecification(ConfiguredBaseModel): + +class MessageSpecification(CreativeWork): """ An object to define messages in an activity or protocol. """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") message: Optional[Dict[str, str]] = Field(default_factory=dict, title="Message", description="""The message to be conditionally displayed for an item.""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + -class OverrideProperty(ConfiguredBaseModel): +class OverrideProperty(CreativeWork): """ An object to override the various properties added to assessments and Items. """ @@ -225,16 +236,17 @@ class OverrideProperty(ConfiguredBaseModel): schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") valueRequired: Optional[bool] = Field(None) variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class Participant(Agent): """ An Agent describing characteristics associated with a participant. """ + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") subject_id: Optional[str] = Field(None) - - + class Protocol(CreativeWork): """ @@ -252,10 +264,9 @@ class Protocol(CreativeWork): schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class Response(CreativeWork): """ @@ -264,10 +275,9 @@ class Response(CreativeWork): isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class ResponseActivity(CreativeWork): """ @@ -279,10 +289,9 @@ class ResponseActivity(CreativeWork): startedAtTime: Optional[datetime ] = Field(None) used: Optional[List[str]] = Field(default_factory=list) wasAssociatedWith: Optional[SoftwareAgent] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class ResponseOption(CreativeWork): """ @@ -295,32 +304,24 @@ class ResponseOption(CreativeWork): multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + -class SoftwareAgent(ConfiguredBaseModel): +class SoftwareAgent(CreativeWork): """ Captures information about some action that took place. It also links to information (entities) that were used during the activity """ version: Optional[str] = Field(None) url: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class StructuredValue(CreativeWork): - - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") -class Thing(ConfiguredBaseModel): - - None - - class UI(ConfiguredBaseModel): """ @@ -333,37 +334,34 @@ class UI(ConfiguredBaseModel): allow: Optional[List[AllowedType]] = Field(default_factory=list, title="allow", description="""An array of items indicating properties allowed on an activity or protocol.""") inputType: Optional[str] = Field(None, title="inputType", description="""An element to describe the input type of a Item.""") readonlyValue: Optional[bool] = Field(None) - - -class UnitOption(ConfiguredBaseModel): + +class UnitOption(CreativeWork): """ An object to represent a human displayable name alongside the more formal value for units. """ prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") value: Optional[Union[Dict[str, str], str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") + class VideoObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None) - category: Optional[str] = Field(None) - - + id: Optional[str] = Field(None, description="""A unique identifier for an item.""") + category: Optional[str] = Field(None, description="""A specific type of class.""") # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model +Agent.model_rebuild() +CreativeWork.model_rebuild() +Activity.model_rebuild() AdditionalNoteObj.model_rebuild() AdditionalProperty.model_rebuild() -Agent.model_rebuild() Choice.model_rebuild() ComputeSpecification.model_rebuild() -CreativeWork.model_rebuild() -Activity.model_rebuild() Item.model_rebuild() LandingPage.model_rebuild() MediaObject.model_rebuild() @@ -378,7 +376,6 @@ class VideoObject(MediaObject): ResponseOption.model_rebuild() SoftwareAgent.model_rebuild() StructuredValue.model_rebuild() -Thing.model_rebuild() UI.model_rebuild() UnitOption.model_rebuild() VideoObject.model_rebuild() From 2c2f930d8a98af77b1dfbdc6b3a98525ca704d15 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 26 Apr 2024 16:30:02 -0400 Subject: [PATCH 25/34] adding title to enum, and modyfing label so it include reproschema --- linkml-schema/reproschema.yaml | 30 +++++++++++++++++++---------- linkml-schema/reproschema_linkml.py | 3 +-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index b4351d413b..a1d668f07a 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -640,35 +640,45 @@ classes: enums: AllowedType: permissible_values: - AllowAltResponse: + reproschema:AllowAltResponse: + title: AllowAltResponse description: Indicates (by boolean) if alternate responses are allowed or not. meaning: reproschema:AllowAltResponse - AllowExport: + reproschema:AllowExport: + title: AllowExport description: Indicates (by boolean) if data can be exported or not. meaning: reproschema:AllowExport - AllowReplay: + reproschema:AllowReplay: + title: AllowReplay description: Indicates (by boolean) if items can be replayed or not. meaning: reproschema:AllowReplay - AllowSkip: + reproschema:AllowSkip: + title: AllowSkip description: Indicates (by boolean) if items can be skipped or not. meaning: reproschema:AllowSkip - AutoAdvance: + reproschema:AutoAdvance: + title: AutoAdvance description: Indicates (by boolean) if assessments in a protocol can auto advance or not. meaning: reproschema:AutoAdvance - DisableBack: + reproschema:DisableBack: + title: DisableBack description: Indicates (by boolean) if we can go back to a completed assessment in a protocol. meaning: reproschema:DisableBack MissingType: permissible_values: - Skipped: + reproschema:Skipped: + title: Skipped description: An element to describe the choice when the item is skipped. meaning: reproschema:Skipped - DontKnow: + reproschema:DontKnow: + title: DontKnow description: An element to describe the choice when response is not known. meaning: reproschema:DontKnow - Unknown: + reproschema:Unknown: + title: Unknown description: An element to describe the choice when the reason for missing response is unknown. meaning: reproschema:Unknown - TimedOut: + reproschema:TimedOut: + title: TimedOut description: A boolean element to describe if the response did not occur within the prescribed time. meaning: reproschema:TimedOut diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 2175deb546..de4f582945 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -47,7 +47,6 @@ class ConfiguredBaseModel(BaseModel): class AllowedType(str, Enum): - # Indicates (by boolean) if alternate responses are allowed or not. AllowAltResponse = "reproschema:AllowAltResponse" # Indicates (by boolean) if data can be exported or not. @@ -72,6 +71,7 @@ class MissingType(str, Enum): # A boolean element to describe if the response did not occur within the prescribed time. TimedOut = "reproschema:TimedOut" + class Agent(ConfiguredBaseModel): pass @@ -187,7 +187,6 @@ class LandingPage(CreativeWork): id: Optional[str] = Field(None, description="""A unique identifier for an item.""") category: Optional[str] = Field(None, description="""A specific type of class.""") - class MediaObject(CreativeWork): """ From 5cdd34939a83d19997d2e88ec1e416ce9f5d16d5 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 26 Apr 2024 17:53:22 -0400 Subject: [PATCH 26/34] adding Thing and use it instead of CreativeWork in some classes --- linkml-schema/reproschema.yaml | 43 +++++--- linkml-schema/reproschema_linkml.py | 157 ++++++++++++++++------------ 2 files changed, 119 insertions(+), 81 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index a1d668f07a..fa3fdb3a67 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -62,7 +62,10 @@ slots: - range: AudioObject inlined: true category: - description: A specific type of class. + description: + Name of the high level ontology class in which this entity is categorized. + Corresponds to the label for the biolink entity type class. + In an RDF database it should be a model class URI. This field is multi-valued. slot_uri: rdf:type range: uriorcurie choices: @@ -99,6 +102,9 @@ slots: contentUrl: slot_uri: schema:contentUrl range: uriorcurie + creator: + slot_uri: schema:creator + range: Person cronTable: title: cronTable description: TODO not described in reproschema @@ -122,9 +128,11 @@ slots: slot_uri: prov:generated range: uri id: - description: A unique identifier for an item. + description: + A unique identifier for an entity. + Must be either a CURIE shorthand for a URI or a complete URI. slot_uri: schema:identifier - range: uri + range: uriorcurie image: title: image description: @@ -386,7 +394,7 @@ classes: Activity: title: Activity description: An assessment in a protocol. - is_a: CreativeWork + is_a: Thing slots: - about - altLabel @@ -408,7 +416,7 @@ classes: description: A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema - is_a: CreativeWork + is_a: Thing slots: - column - source @@ -417,7 +425,7 @@ classes: AdditionalProperty: title: Additional properties description: An object to describe the various properties added to assessments and Items. - is_a: CreativeWork + is_a: Thing slots: - allow - isAbout @@ -439,7 +447,7 @@ classes: Choice: title: Response choice description: An object to describe a response option. - is_a: CreativeWork + is_a: Thing slots: - name - image @@ -454,14 +462,15 @@ classes: - variableName class_uri: reproschema:ComputeSpecification CreativeWork: + is_a: Thing slots: - - id - category + - contentUrl class_uri: schema:CreativeWork ImageObject: is_a: MediaObject class_uri: schema:ImageObject - Item: #TODO: multiple @type in reproschema + Item: title: Item in an activity description: An item in an assessment. is_a: CreativeWork @@ -503,7 +512,6 @@ classes: is_a: CreativeWork class_uri: schema:MediaObject slots: - - contentUrl - inLanguage slot_usage: contentUrl: @@ -519,7 +527,7 @@ classes: OverrideProperty: title: Additional properties description: An object to override the various properties added to assessments and Items. - is_a: CreativeWork + is_a: Thing slots: - isAbout - isVis @@ -583,7 +591,7 @@ classes: ResponseOption: title: Response option description: An element (object or by URL)to describe the properties of response of the Item. - is_a: CreativeWork + is_a: Thing slots: - choices - datumType @@ -598,14 +606,19 @@ classes: description: Captures information about some action that took place. It also links to information (entities) that were used during the activity - is_a: CreativeWork + is_a: Thing slots: - version - url class_uri: reproschema:SoftwareAgent StructuredValue: - is_a: CreativeWork + is_a: Thing class_uri: schema:StructuredValue + Thing: + slots: + - id + - name + class_uri: schema:Thing UI: title: todo description: @@ -622,7 +635,7 @@ classes: UnitOption: title: Unit options description: An object to represent a human displayable name alongside the more formal value for units. - is_a: CreativeWork + is_a: Thing slots: - prefLabel - value diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index de4f582945..8c3f2ca862 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -76,12 +76,20 @@ class Agent(ConfiguredBaseModel): pass -class CreativeWork(ConfiguredBaseModel): - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") +class Participant(Agent): + """ + An Agent describing characteristics associated with a participant. + """ + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + subject_id: Optional[str] = Field(None) + +class Thing(ConfiguredBaseModel): + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class Activity(CreativeWork): + +class Activity(Thing): """ An assessment in a protocol. """ @@ -99,22 +107,22 @@ class Activity(CreativeWork): schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class AdditionalNoteObj(CreativeWork): +class AdditionalNoteObj(Thing): """ A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema """ column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class AdditionalProperty(CreativeWork): +class AdditionalProperty(Thing): """ An object to describe the various properties added to assessments and Items. """ @@ -129,19 +137,25 @@ class AdditionalProperty(CreativeWork): valueRequired: Optional[bool] = Field(None) variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class Choice(CreativeWork): +class Choice(Thing): """ An object to describe a response option. """ name: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + + +class CreativeWork(Thing): + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class ComputeSpecification(CreativeWork): @@ -150,8 +164,10 @@ class ComputeSpecification(CreativeWork): """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class Item(CreativeWork): @@ -175,8 +191,10 @@ class Item(CreativeWork): ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) video: Optional[VideoObject] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class LandingPage(CreativeWork): @@ -184,32 +202,37 @@ class LandingPage(CreativeWork): An object to define the landing page of a protocol. """ inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class MediaObject(CreativeWork): """ Add description """ - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: str = Field(...) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class AudioObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: str = Field(...) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class ImageObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: str = Field(...) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class MessageSpecification(CreativeWork): @@ -218,11 +241,13 @@ class MessageSpecification(CreativeWork): """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") message: Optional[Dict[str, str]] = Field(default_factory=dict, title="Message", description="""The message to be conditionally displayed for an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class OverrideProperty(CreativeWork): +class OverrideProperty(Thing): """ An object to override the various properties added to assessments and Items. """ @@ -235,16 +260,8 @@ class OverrideProperty(CreativeWork): schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") valueRequired: Optional[bool] = Field(None) variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") - - -class Participant(Agent): - """ - An Agent describing characteristics associated with a participant. - """ - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - subject_id: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class Protocol(CreativeWork): @@ -263,8 +280,10 @@ class Protocol(CreativeWork): schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class Response(CreativeWork): @@ -274,8 +293,10 @@ class Response(CreativeWork): isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class ResponseActivity(CreativeWork): @@ -288,11 +309,13 @@ class ResponseActivity(CreativeWork): startedAtTime: Optional[datetime ] = Field(None) used: Optional[List[str]] = Field(default_factory=list) wasAssociatedWith: Optional[SoftwareAgent] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class ResponseOption(CreativeWork): +class ResponseOption(Thing): """ An element (object or by URL)to describe the properties of response of the Item. """ @@ -303,23 +326,23 @@ class ResponseOption(CreativeWork): multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class SoftwareAgent(CreativeWork): +class SoftwareAgent(Thing): """ Captures information about some action that took place. It also links to information (entities) that were used during the activity """ version: Optional[str] = Field(None) url: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) -class StructuredValue(CreativeWork): - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") +class StructuredValue(Thing): + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class UI(ConfiguredBaseModel): @@ -335,31 +358,34 @@ class UI(ConfiguredBaseModel): readonlyValue: Optional[bool] = Field(None) -class UnitOption(CreativeWork): +class UnitOption(Thing): """ An object to represent a human displayable name alongside the more formal value for units. """ prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") value: Optional[Union[Dict[str, str], str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) class VideoObject(MediaObject): - contentUrl: str = Field(...) inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an item.""") - category: Optional[str] = Field(None, description="""A specific type of class.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: str = Field(...) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) # Model rebuild # see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model Agent.model_rebuild() -CreativeWork.model_rebuild() +Participant.model_rebuild() +Thing.model_rebuild() Activity.model_rebuild() AdditionalNoteObj.model_rebuild() AdditionalProperty.model_rebuild() Choice.model_rebuild() +CreativeWork.model_rebuild() ComputeSpecification.model_rebuild() Item.model_rebuild() LandingPage.model_rebuild() @@ -368,7 +394,6 @@ class VideoObject(MediaObject): ImageObject.model_rebuild() MessageSpecification.model_rebuild() OverrideProperty.model_rebuild() -Participant.model_rebuild() Protocol.model_rebuild() Response.model_rebuild() ResponseActivity.model_rebuild() From e87941e7b6ec6dd1b2a5e9ffec0e00b24a08aa3d Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 26 Apr 2024 22:02:42 -0400 Subject: [PATCH 27/34] adding back CreativeWork to ResponseOption and Activity --- linkml-schema/reproschema.yaml | 4 +-- linkml-schema/reproschema_linkml.py | 52 ++++++++++++++++------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index fa3fdb3a67..1c31de5a56 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -394,7 +394,7 @@ classes: Activity: title: Activity description: An assessment in a protocol. - is_a: Thing + is_a: CreativeWork slots: - about - altLabel @@ -591,7 +591,7 @@ classes: ResponseOption: title: Response option description: An element (object or by URL)to describe the properties of response of the Item. - is_a: Thing + is_a: CreativeWork slots: - choices - datumType diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 8c3f2ca862..6546387416 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -89,28 +89,6 @@ class Thing(ConfiguredBaseModel): name: Optional[Dict[str, str]] = Field(default_factory=dict) -class Activity(Thing): - """ - An assessment in a protocol. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") - citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") - cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - - class AdditionalNoteObj(Thing): """ A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema @@ -158,6 +136,30 @@ class CreativeWork(Thing): name: Optional[Dict[str, str]] = Field(default_factory=dict) +class Activity(CreativeWork): + """ + An assessment in a protocol. + """ + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + citation: Optional[Dict[str, str]] = Field(default_factory=dict) + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") + preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) + + class ComputeSpecification(CreativeWork): """ An object to define computations in an activity or protocol. @@ -315,7 +317,7 @@ class ResponseActivity(CreativeWork): name: Optional[Dict[str, str]] = Field(default_factory=dict) -class ResponseOption(Thing): +class ResponseOption(CreativeWork): """ An element (object or by URL)to describe the properties of response of the Item. """ @@ -326,6 +328,8 @@ class ResponseOption(Thing): multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) @@ -381,11 +385,11 @@ class VideoObject(MediaObject): Agent.model_rebuild() Participant.model_rebuild() Thing.model_rebuild() -Activity.model_rebuild() AdditionalNoteObj.model_rebuild() AdditionalProperty.model_rebuild() Choice.model_rebuild() CreativeWork.model_rebuild() +Activity.model_rebuild() ComputeSpecification.model_rebuild() Item.model_rebuild() LandingPage.model_rebuild() From d76dd78c5ec8c67dca0a66d91afda052c94f6a39 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Wed, 8 May 2024 20:14:32 -0400 Subject: [PATCH 28/34] moving category to Thing and removing Creative Work; removing imageUrl to have consistent with video and audio --- linkml-schema/reproschema.yaml | 41 ++++------ linkml-schema/reproschema_linkml.py | 120 +++++++++++++--------------- 2 files changed, 71 insertions(+), 90 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 1c31de5a56..11edf97000 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -51,7 +51,7 @@ slots: inlined: true associatedMedia: title: associatedMedia - description: A media object that encodes this CreativeWork. This property is a synonym for encoding. + description: A media object that encodes this creative work. This property is a synonym for encoding. slot_uri: schema:associatedMedia audio: title: audio @@ -60,7 +60,6 @@ slots: any_of: - range: uri - range: AudioObject - inlined: true category: description: Name of the high level ontology class in which this entity is categorized. @@ -142,11 +141,6 @@ slots: any_of: - range: ImageObject - range: uri - imageUrl: - title: imageUrl - description: An image url. - slot_uri: reproschema:imageUrl - range: uri inLanguage: slot_uri: schema:inLanguage range: string @@ -383,7 +377,9 @@ slots: range: string video: slot_uri: schema:video - range: VideoObject + any_of: + - range: VideoObject + - range: uri wasAssociatedWith: slot_uri: prov:wasAssociatedWith range: SoftwareAgent @@ -394,7 +390,7 @@ classes: Activity: title: Activity description: An assessment in a protocol. - is_a: CreativeWork + is_a: Thing slots: - about - altLabel @@ -456,24 +452,18 @@ classes: ComputeSpecification: title: Compute Specification description: An object to define computations in an activity or protocol. - is_a: CreativeWork + is_a: Thing slots: - jsExpression - variableName class_uri: reproschema:ComputeSpecification - CreativeWork: - is_a: Thing - slots: - - category - - contentUrl - class_uri: schema:CreativeWork ImageObject: is_a: MediaObject class_uri: schema:ImageObject Item: title: Item in an activity description: An item in an assessment. - is_a: CreativeWork + is_a: Thing slots: - about - additionalNotesObj @@ -482,7 +472,6 @@ classes: - audio - description - image - - imageUrl - isPartOf - preamble - prefLabel @@ -496,7 +485,7 @@ classes: LandingPage: title: Landing Page description: An object to define the landing page of a protocol. - is_a: CreativeWork + is_a: Thing slots: - inLanguage class_uri: reproschema:LandingPage @@ -509,17 +498,18 @@ classes: MediaObject: title: Media Object description: Add description #TODO - is_a: CreativeWork + is_a: Thing class_uri: schema:MediaObject slots: - inLanguage + - contentUrl slot_usage: contentUrl: required: true MessageSpecification: title: Message Specification description: An object to define messages in an activity or protocol. - is_a: CreativeWork + is_a: Thing slots: - jsExpression - message @@ -550,7 +540,7 @@ classes: Protocol: # TODO multiple types title: Protocol description: A representation of a study which comprises one or more assessments. - is_a: CreativeWork + is_a: Thing slots: - about - altLabel @@ -568,7 +558,7 @@ classes: Response: # multiple types title: Response description: Describes the response of an item. - is_a: CreativeWork + is_a: Thing slots: - isAbout - value @@ -579,7 +569,7 @@ classes: description: Captures information about some action that took place. It also links to information (entities) that were used during the activity - is_a: CreativeWork + is_a: Thing slots: - endedAtTime - generated @@ -591,7 +581,7 @@ classes: ResponseOption: title: Response option description: An element (object or by URL)to describe the properties of response of the Item. - is_a: CreativeWork + is_a: Thing slots: - choices - datumType @@ -618,6 +608,7 @@ classes: slots: - id - name + - category class_uri: schema:Thing UI: title: todo diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 6546387416..3002112d26 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -87,6 +87,30 @@ class Participant(Agent): class Thing(ConfiguredBaseModel): id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") + + +class Activity(Thing): + """ + An assessment in a protocol. + """ + about: Optional[str] = Field(None, description="""The subject matter of the Field.""") + altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") + citation: Optional[Dict[str, str]] = Field(default_factory=dict) + compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") + cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") + description: Optional[Dict[str, str]] = Field(default_factory=dict) + image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") + messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") + preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") + prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") + schemaVersion: Optional[str] = Field(None) + ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") + version: Optional[str] = Field(None) + id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") + name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class AdditionalNoteObj(Thing): @@ -98,6 +122,7 @@ class AdditionalNoteObj(Thing): value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class AdditionalProperty(Thing): @@ -117,6 +142,7 @@ class AdditionalProperty(Thing): ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class Choice(Thing): @@ -127,63 +153,31 @@ class Choice(Thing): image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - - -class CreativeWork(Thing): category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) -class Activity(CreativeWork): - """ - An assessment in a protocol. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") - citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") - cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - - -class ComputeSpecification(CreativeWork): +class ComputeSpecification(Thing): """ An object to define computations in an activity or protocol. """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class Item(CreativeWork): +class Item(Thing): """ An item in an assessment. """ about: Optional[str] = Field(None, description="""The subject matter of the Field.""") additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes", description="""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.""") altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") audio: Optional[Union[AudioObject, str]] = Field(None, title="audio", description="""TODO""") description: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - imageUrl: Optional[str] = Field(None, title="imageUrl", description="""An image url.""") isPartOf: Optional[Activity] = Field(None) preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") @@ -192,61 +186,58 @@ class Item(CreativeWork): schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) - video: Optional[VideoObject] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) + video: Optional[Union[VideoObject, str]] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class LandingPage(CreativeWork): +class LandingPage(Thing): """ An object to define the landing page of a protocol. """ inLanguage: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class MediaObject(CreativeWork): +class MediaObject(Thing): """ Add description """ inLanguage: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") contentUrl: str = Field(...) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class AudioObject(MediaObject): inLanguage: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") contentUrl: str = Field(...) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class ImageObject(MediaObject): inLanguage: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") contentUrl: str = Field(...) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class MessageSpecification(CreativeWork): +class MessageSpecification(Thing): """ An object to define messages in an activity or protocol. """ jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") message: Optional[Dict[str, str]] = Field(default_factory=dict, title="Message", description="""The message to be conditionally displayed for an item.""") - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class OverrideProperty(Thing): @@ -264,15 +255,16 @@ class OverrideProperty(Thing): variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class Protocol(CreativeWork): +class Protocol(Thing): """ A representation of a study which comprises one or more assessments. """ about: Optional[str] = Field(None, description="""The subject matter of the Field.""") altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this CreativeWork. This property is a synonym for encoding.""") + associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") description: Optional[Dict[str, str]] = Field(default_factory=dict) @@ -282,26 +274,24 @@ class Protocol(CreativeWork): schemaVersion: Optional[str] = Field(None) ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") version: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class Response(CreativeWork): +class Response(Thing): """ Describes the response of an item. """ isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class ResponseActivity(CreativeWork): +class ResponseActivity(Thing): """ Captures information about some action that took place. It also links to information (entities) that were used during the activity """ @@ -311,13 +301,12 @@ class ResponseActivity(CreativeWork): startedAtTime: Optional[datetime ] = Field(None) used: Optional[List[str]] = Field(default_factory=list) wasAssociatedWith: Optional[SoftwareAgent] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") -class ResponseOption(CreativeWork): +class ResponseOption(Thing): """ An element (object or by URL)to describe the properties of response of the Item. """ @@ -328,10 +317,9 @@ class ResponseOption(CreativeWork): multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - contentUrl: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class SoftwareAgent(Thing): @@ -342,11 +330,13 @@ class SoftwareAgent(Thing): url: Optional[str] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class StructuredValue(Thing): id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class UI(ConfiguredBaseModel): @@ -370,14 +360,15 @@ class UnitOption(Thing): value: Optional[Union[Dict[str, str], str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") class VideoObject(MediaObject): inLanguage: Optional[str] = Field(None) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") contentUrl: str = Field(...) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) + category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") # Model rebuild @@ -385,11 +376,10 @@ class VideoObject(MediaObject): Agent.model_rebuild() Participant.model_rebuild() Thing.model_rebuild() +Activity.model_rebuild() AdditionalNoteObj.model_rebuild() AdditionalProperty.model_rebuild() Choice.model_rebuild() -CreativeWork.model_rebuild() -Activity.model_rebuild() ComputeSpecification.model_rebuild() Item.model_rebuild() LandingPage.model_rebuild() From 5f9c2ac8ced05d32748e9a68134092ad11eb2656 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 11 May 2024 13:56:15 -0400 Subject: [PATCH 29/34] removing imageUrl and CreativeWork from the context --- contexts/reproschema | 6 ------ 1 file changed, 6 deletions(-) diff --git a/contexts/reproschema b/contexts/reproschema index 566c2ab43d..be56b06cdc 100644 --- a/contexts/reproschema +++ b/contexts/reproschema @@ -90,9 +90,6 @@ "@type": "@id", "@id": "schema:image" }, - "imageUrl": { - "@type": "@id" - }, "inLanguage": { "@id": "schema:inLanguage", "@language": null @@ -230,9 +227,6 @@ "Agent": { "@id": "prov:Agent" }, - "CreativeWork": { - "@id": "schema:CreativeWork" - }, "LangString": { "@id": "rdf:langString" }, From 4d01c40c1df0ff6b6ab6f6dbbb410e423612bee8 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 15 May 2024 14:43:17 -0400 Subject: [PATCH 30/34] add proprietary flag to activities --- linkml-schema/reproschema.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 11edf97000..a5f89a6a4a 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -160,6 +160,9 @@ slots: isPartOf: slot_uri: schema:isPartOf range: Activity + isProprietary: + slot_uri: schema:isProprietary + range: boolean isVis: title: visibility description: @@ -400,6 +403,7 @@ classes: - cronTable - description - image + - isProprietary - messages - preamble - prefLabel From ff24fa2f01f748270e13ab7745d0a9d12921352a Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 10 Jun 2024 23:29:02 -0400 Subject: [PATCH 31/34] removing decimal --- linkml-schema/reproschema.yaml | 5 +++-- linkml-schema/reproschema_linkml.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/linkml-schema/reproschema.yaml b/linkml-schema/reproschema.yaml index 11edf97000..f1385a1f95 100644 --- a/linkml-schema/reproschema.yaml +++ b/linkml-schema/reproschema.yaml @@ -208,7 +208,7 @@ slots: description: Defines number of times the item is allowed to be redone. slot_uri: reproschema:maxRetakes any_of: - - range: decimal + - range: integer maxValue: any_of: - range: float @@ -350,8 +350,9 @@ slots: description: The value for each option in choices or in additionalNotesObj slot_uri: schema:value any_of: + - range: float + - range: integer - range: boolean - - range: decimal - range: StructuredValue - range: langString - range: uri diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py index 3002112d26..2b0e335da9 100644 --- a/linkml-schema/reproschema_linkml.py +++ b/linkml-schema/reproschema_linkml.py @@ -119,7 +119,7 @@ class AdditionalNoteObj(Thing): """ column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") - value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") @@ -133,7 +133,7 @@ class AdditionalProperty(Thing): isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") - maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") + maxRetakes: Optional[int] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") @@ -151,7 +151,7 @@ class Choice(Thing): """ name: Optional[Dict[str, str]] = Field(default_factory=dict) image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") @@ -247,7 +247,7 @@ class OverrideProperty(Thing): isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") - maxRetakes: Optional[Decimal] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") + maxRetakes: Optional[int] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") @@ -284,7 +284,7 @@ class Response(Thing): Describes the response of an item. """ isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - value: Optional[Union[Decimal, Dict[str, str], MissingType, StructuredValue, bool, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") + value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") wasAttributedTo: Optional[Participant] = Field(None) id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") name: Optional[Dict[str, str]] = Field(default_factory=dict) From cd95b138e893dbbe59cf9aca0ee27dc14cb110c2 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 14 Jun 2024 09:25:47 -0400 Subject: [PATCH 32/34] cleaning: removing some fles and changing test (will not work before merging reproschema-py) --- .github/workflows/pythonpackage.yml | 2 +- linkml-schema/reproschema-shacl.ttl | 860 ---------------------------- linkml-schema/reproschema_linkml.py | 400 ------------- validation/reproschema-shacl.ttl | 473 --------------- 4 files changed, 1 insertion(+), 1734 deletions(-) delete mode 100644 linkml-schema/reproschema-shacl.ttl delete mode 100644 linkml-schema/reproschema_linkml.py delete mode 100644 validation/reproschema-shacl.ttl diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 90e2b69399..375aa92e88 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -27,7 +27,7 @@ jobs: - name: Test with pyshacl run: | python scripts/jsonParser.py - reproschema -l DEBUG validate --shapefile validation/reproschema-shacl.ttl examples + reproschema validate examples - name: Make a release run: | python scripts/makeRelease.py ci-release diff --git a/linkml-schema/reproschema-shacl.ttl b/linkml-schema/reproschema-shacl.ttl deleted file mode 100644 index 93a1472d1d..0000000000 --- a/linkml-schema/reproschema-shacl.ttl +++ /dev/null @@ -1,860 +0,0 @@ -# metamodel_version: 1.7.0 -@prefix nidm: . -@prefix prov: . -@prefix rdf: . -@prefix reproschema: . -@prefix schema1: . -@prefix sh: . -@prefix skos: . -@prefix xsd: . - -schema1:AudioObject a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ] ; - sh:targetClass schema1:AudioObject . - -schema1:CreativeWork a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:maxCount 1 ; - sh:order 1 ; - sh:path rdf:type ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:id ] ; - sh:targetClass schema1:CreativeWork . - -schema1:MediaObject a sh:NodeShape ; - sh:closed true ; - sh:description "Add description" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Media Object" ; - sh:property [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ] ; - sh:targetClass schema1:MediaObject . - -schema1:StructuredValue a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:maxCount 1 ; - sh:order 1 ; - sh:path rdf:type ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:id ] ; - sh:targetClass schema1:StructuredValue . - -schema1:Thing a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass schema1:Thing . - -reproschema:AdditionalNoteObj a sh:NodeShape ; - sh:closed true ; - sh:description "A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Additional Notes Object" ; - sh:property [ sh:datatype xsd:string ; - sh:description "The value for each option in choices or in additionalNotesObj" ; - sh:maxCount 1 ; - sh:name "value" ; - sh:order 2 ; - sh:path schema1:value ], - [ sh:datatype xsd:string ; - sh:description "An element to define the source (eg. RedCap, NDA) where the note was taken from." ; - sh:maxCount 1 ; - sh:name "source" ; - sh:order 1 ; - sh:path reproschema:source ], - [ sh:datatype xsd:string ; - sh:description "An element to define the column name where the note was taken from." ; - sh:maxCount 1 ; - sh:name "column" ; - sh:order 0 ; - sh:path reproschema:column ] ; - sh:targetClass reproschema:AdditionalNoteObj . - -reproschema:Choice a sh:NodeShape ; - sh:closed true ; - sh:description "An object to describe a response option." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response choice" ; - sh:property [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path schema1:image ], - [ sh:datatype xsd:string ; - sh:description "The value for each option in choices or in additionalNotesObj" ; - sh:maxCount 1 ; - sh:name "value" ; - sh:order 2 ; - sh:path schema1:value ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 0 ; - sh:path schema1:name ] ; - sh:targetClass reproschema:Choice . - -reproschema:Field a sh:NodeShape ; - sh:closed true ; - sh:description "An item in an assessment." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Item in an activity" ; - sh:property [ sh:datatype xsd:string ; - sh:description "TODO" ; - sh:maxCount 1 ; - sh:name "audio" ; - sh:order 4 ; - sh:path schema1:audio ], - [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 3 ; - sh:path schema1:associatedMedia ], - [ sh:class schema1:VideoObject ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 16 ; - sh:path schema1:video ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; - sh:description "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." ; - sh:name "additional notes" ; - sh:order 1 ; - sh:path reproschema:additionalNotesObj ], - [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 17 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:description "The alternate label." ; - sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 2 ; - sh:path skos:altLabel ], - [ sh:class rdf:langString ; - sh:description "The preamble for an assessment" ; - sh:name "Preamble" ; - sh:nodeKind sh:BlankNode ; - sh:order 9 ; - sh:path reproschema:preamble ], - [ sh:maxCount 1 ; - sh:order 18 ; - sh:path rdf:type ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 11 ; - sh:path schema1:question ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:schemaVersion ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 15 ; - sh:path schema1:version ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path schema1:description ], - [ sh:datatype xsd:string ; - sh:description "An element (object or by URL)to describe the properties of response of the Item." ; - sh:maxCount 1 ; - sh:name "Response options" ; - sh:order 12 ; - sh:path reproschema:responseOptions ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 14 ; - sh:path reproschema:ui ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:image ], - [ sh:datatype xsd:anyURI ; - sh:description "An image url." ; - sh:maxCount 1 ; - sh:name "imageUrl" ; - sh:order 7 ; - sh:path reproschema:imageUrl ], - [ sh:class reproschema:Activity ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path schema1:isPartOf ] ; - sh:targetClass reproschema:Field . - -reproschema:LandingPage a sh:NodeShape ; - sh:closed true ; - sh:description "An object to define the landing page of a protocol." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Landing Page" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:inLanguage ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:id ] ; - sh:targetClass reproschema:LandingPage . - -reproschema:Protocol a sh:NodeShape ; - sh:closed true ; - sh:description "A representation of a study which comprises one or more assessments." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Protocol" ; - sh:property [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 2 ; - sh:path schema1:associatedMedia ], - [ sh:datatype xsd:string ; - sh:description "The alternate label." ; - sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 1 ; - sh:path skos:altLabel ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path skos:prefLabel ], - [ sh:class reproschema:ComputeSpecification ; - sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; - sh:name "computation" ; - sh:nodeKind sh:BlankNode ; - sh:order 3 ; - sh:path reproschema:compute ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path reproschema:ui ], - [ sh:datatype xsd:string ; - sh:description "TODO not described in reproschema" ; - sh:maxCount 1 ; - sh:name "cronTable" ; - sh:order 4 ; - sh:path reproschema:cronTable ], - [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 9 ; - sh:path schema1:schemaVersion ], - [ sh:maxCount 1 ; - sh:order 13 ; - sh:path rdf:type ], - [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path reproschema:messages ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 12 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 11 ; - sh:path schema1:version ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path schema1:description ], - [ sh:datatype xsd:string ; - sh:description "An element (by URL) to point to the protocol readme or landing page." ; - sh:name "Landing page content" ; - sh:order 6 ; - sh:path reproschema:landingPage ] ; - sh:targetClass reproschema:Protocol . - -reproschema:Response a sh:NodeShape ; - sh:closed true ; - sh:description "Describes the response of an item." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response" ; - sh:property [ sh:class reproschema:Participant ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 2 ; - sh:path prov:wasAttributedTo ], - [ sh:datatype xsd:string ; - sh:description "A pointer to the node describing the item." ; - sh:maxCount 1 ; - sh:name "isAbout" ; - sh:order 0 ; - sh:path reproschema:isAbout ], - [ sh:datatype xsd:string ; - sh:description "The value for each option in choices or in additionalNotesObj" ; - sh:maxCount 1 ; - sh:name "value" ; - sh:order 1 ; - sh:path schema1:value ], - [ sh:maxCount 1 ; - sh:order 4 ; - sh:path rdf:type ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:id ] ; - sh:targetClass reproschema:Response . - -reproschema:ResponseActivity a sh:NodeShape ; - sh:closed true ; - sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "ResponseActivity" ; - sh:property [ sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path prov:startedAtTime ], - [ sh:class reproschema:SoftwareAgent ; - sh:maxCount 1 ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path prov:wasAssociatedWith ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:inLanguage ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path prov:generated ], - [ sh:datatype xsd:string ; - sh:order 4 ; - sh:path prov:used ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:id ], - [ sh:maxCount 1 ; - sh:order 7 ; - sh:path rdf:type ], - [ sh:datatype xsd:dateTime ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path prov:endedAtTime ] ; - sh:targetClass reproschema:ResponseActivity . - -reproschema:ResponseOption a sh:NodeShape ; - sh:closed true ; - sh:description "An element (object or by URL)to describe the properties of response of the Item." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Response option" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:maxValue ], - [ sh:datatype xsd:string ; - sh:description "The type of the response of an item. For example, string, integer, etc." ; - sh:maxCount 1 ; - sh:name "The type of the response" ; - sh:order 6 ; - sh:path reproschema:valueType ], - [ sh:class reproschema:UnitOption ; - sh:description "A list of objects to represent a human displayable name alongside the more formal value for units." ; - sh:name "unitOptions" ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path reproschema:unitOptions ], - [ sh:datatype xsd:boolean ; - sh:description "Indicates (by bool) if response for the Item has one or more answer." ; - sh:maxCount 1 ; - sh:name "Multiple choice response expectation" ; - sh:order 4 ; - sh:path reproschema:multipleChoice ], - [ sh:datatype xsd:string ; - sh:description "An array to list the available options for response of the Item." ; - sh:name "choices" ; - sh:order 0 ; - sh:path reproschema:choices ], - [ sh:datatype xsd:string ; - sh:description "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item." ; - sh:maxCount 1 ; - sh:name "datumType" ; - sh:order 1 ; - sh:path reproschema:datumType ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 3 ; - sh:path schema1:minValue ] ; - sh:targetClass reproschema:ResponseOption . - -prov:Agent a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:targetClass prov:Agent . - -schema1:VideoObject a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Video Object" ; - sh:property [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ] ; - sh:targetClass schema1:VideoObject . - -reproschema:Activity a sh:NodeShape ; - sh:closed true ; - sh:description "An assessment in a protocol." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Activity" ; - sh:property [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 14 ; - sh:path schema1:id ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 13 ; - sh:path schema1:version ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path skos:prefLabel ], - [ sh:maxCount 1 ; - sh:order 15 ; - sh:path rdf:type ], - [ sh:datatype xsd:string ; - sh:description "The subject matter of the Field." ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:about ], - [ sh:class reproschema:MessageSpecification ; - sh:description "An array of objects to define conditional messages in an activity or protocol." ; - sh:name "messages" ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path reproschema:messages ], - [ sh:datatype xsd:string ; - sh:description "TODO not described in reproschema" ; - sh:maxCount 1 ; - sh:name "cronTable" ; - sh:order 5 ; - sh:path reproschema:cronTable ], - [ sh:datatype xsd:string ; - sh:description "The alternate label." ; - sh:maxCount 1 ; - sh:name "alternate label" ; - sh:order 1 ; - sh:path skos:altLabel ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 3 ; - sh:path schema1:citation ], - [ sh:datatype xsd:string ; - sh:description "A media object that encodes this CreativeWork. This property is a synonym for encoding." ; - sh:maxCount 1 ; - sh:name "associatedMedia" ; - sh:order 2 ; - sh:path schema1:associatedMedia ], - [ sh:class schema1:ImageObject ; - sh:description "An image of the item. This can be a URL or a fully described ImageObject." ; - sh:maxCount 1 ; - sh:name "image" ; - sh:nodeKind sh:BlankNode ; - sh:order 7 ; - sh:path schema1:image ], - [ sh:class rdf:langString ; - sh:description "The preamble for an assessment" ; - sh:name "Preamble" ; - sh:nodeKind sh:BlankNode ; - sh:order 9 ; - sh:path reproschema:preamble ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 11 ; - sh:path schema1:schemaVersion ], - [ sh:class rdf:langString ; - sh:nodeKind sh:BlankNode ; - sh:order 6 ; - sh:path schema1:description ], - [ sh:class reproschema:ComputeSpecification ; - sh:description "An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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." ; - sh:name "computation" ; - sh:nodeKind sh:BlankNode ; - sh:order 4 ; - sh:path reproschema:compute ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 12 ; - sh:path reproschema:ui ] ; - sh:targetClass reproschema:Activity . - -reproschema:AdditionalProperty a sh:NodeShape ; - sh:closed true ; - sh:description "An object to describe the various properties added to assessments and Items." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Additional properties" ; - sh:property [ sh:datatype xsd:string ; - sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; - sh:maxCount 1 ; - sh:name "visibility" ; - sh:order 2 ; - sh:path reproschema:isVis ], - [ sh:datatype xsd:string ; - sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; - sh:maxCount 1 ; - sh:name "limit" ; - sh:order 3 ; - sh:path reproschema:limit ], - [ sh:datatype xsd:string ; - sh:description "Defines number of times the item is allowed to be redone." ; - sh:maxCount 1 ; - sh:name "maxRetakes" ; - sh:order 4 ; - sh:path reproschema:maxRetakes ], - [ sh:class reproschema:UI ; - sh:description "An element to control UI specifications. Originally @nest in jsonld, but using a class in the model." ; - sh:maxCount 1 ; - sh:name "UI" ; - sh:nodeKind sh:BlankNode ; - sh:order 10 ; - sh:path reproschema:ui ], - [ sh:datatype xsd:string ; - sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; - sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - sh:order 6 ; - sh:path reproschema:randomMaxDelay ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 5 ; - sh:path skos:prefLabel ], - [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; - sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; - sh:name "allow" ; - sh:order 0 ; - sh:path reproschema:allow ], - [ sh:class rdf:langString ; - sh:description "The name used to represent an item." ; - sh:maxCount 1 ; - sh:name "variableName" ; - sh:nodeKind sh:BlankNode ; - sh:order 9 ; - sh:path reproschema:variableName ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 8 ; - sh:path schema1:valueRequired ], - [ sh:datatype xsd:string ; - sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; - sh:maxCount 1 ; - sh:name "Schedule" ; - sh:order 7 ; - sh:path reproschema:schedule ], - [ sh:datatype xsd:string ; - sh:description "A pointer to the node describing the item." ; - sh:maxCount 1 ; - sh:name "isAbout" ; - sh:order 1 ; - sh:path reproschema:isAbout ] ; - sh:targetClass reproschema:AdditionalProperty . - -reproschema:OverrideProperty a sh:NodeShape ; - sh:closed true ; - sh:description "An object to override the various properties added to assessments and Items." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Additional properties" ; - sh:property [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 4 ; - sh:path skos:prefLabel ], - [ sh:datatype xsd:string ; - sh:description "A pointer to the node describing the item." ; - sh:maxCount 1 ; - sh:name "isAbout" ; - sh:order 0 ; - sh:path reproschema:isAbout ], - [ sh:datatype xsd:string ; - sh:description "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration" ; - sh:maxCount 1 ; - sh:name "randomMaxDelay" ; - sh:order 5 ; - sh:path reproschema:randomMaxDelay ], - [ sh:datatype xsd:string ; - sh:description "Defines number of times the item is allowed to be redone." ; - sh:maxCount 1 ; - sh:name "maxRetakes" ; - sh:order 3 ; - sh:path reproschema:maxRetakes ], - [ sh:datatype xsd:string ; - sh:description "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment." ; - sh:maxCount 1 ; - sh:name "visibility" ; - sh:order 1 ; - sh:path reproschema:isVis ], - [ sh:class rdf:langString ; - sh:description "The name used to represent an item." ; - sh:maxCount 1 ; - sh:name "variableName" ; - sh:nodeKind sh:BlankNode ; - sh:order 8 ; - sh:path reproschema:variableName ], - [ sh:datatype xsd:string ; - sh:description "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available." ; - sh:maxCount 1 ; - sh:name "limit" ; - sh:order 2 ; - sh:path reproschema:limit ], - [ sh:datatype xsd:string ; - sh:description "An element to set make activity available/repeat info using ISO 8601 repeating interval format." ; - sh:maxCount 1 ; - sh:name "Schedule" ; - sh:order 6 ; - sh:path reproschema:schedule ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 7 ; - sh:path schema1:valueRequired ] ; - sh:targetClass reproschema:OverrideProperty . - -reproschema:Participant a sh:NodeShape ; - sh:closed true ; - sh:description "An Agent describing characteristics associated with a participant." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Participant" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path nidm:subject_id ] ; - sh:targetClass reproschema:Participant . - -reproschema:SoftwareAgent a sh:NodeShape ; - sh:closed true ; - sh:description "Captures information about some action that took place. It also links to information (entities) that were used during the activity" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Software Agent" ; - sh:property [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 0 ; - sh:path schema1:version ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:url ] ; - sh:targetClass reproschema:SoftwareAgent . - -reproschema:UnitOption a sh:NodeShape ; - sh:closed true ; - sh:description "An object to represent a human displayable name alongside the more formal value for units." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Unit options" ; - sh:property [ sh:datatype xsd:string ; - sh:description "The value for each option in choices or in additionalNotesObj" ; - sh:maxCount 1 ; - sh:name "value" ; - sh:order 1 ; - sh:path schema1:value ], - [ sh:class rdf:langString ; - sh:description "['The preferred label.']" ; - sh:name "preferred label" ; - sh:nodeKind sh:BlankNode ; - sh:order 0 ; - sh:path skos:prefLabel ] ; - sh:targetClass reproschema:UnitOption . - -reproschema:ComputeSpecification a sh:NodeShape ; - sh:closed true ; - sh:description "An object to define computations in an activity or protocol." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Compute Specification" ; - sh:property [ sh:class rdf:langString ; - sh:description "The name used to represent an item." ; - sh:maxCount 1 ; - sh:name "variableName" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:variableName ], - [ sh:datatype xsd:string ; - sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; - sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:order 0 ; - sh:path reproschema:jsExpression ] ; - sh:targetClass reproschema:ComputeSpecification . - -reproschema:MessageSpecification a sh:NodeShape ; - sh:closed true ; - sh:description "An object to define messages in an activity or protocol." ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "Message Specification" ; - sh:property [ sh:class rdf:langString ; - sh:description "The message to be conditionally displayed for an item." ; - sh:name "Message" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:message ], - [ sh:datatype xsd:string ; - sh:description "A JavaScript expression for computations. A JavaScript expression to compute a score from other variables." ; - sh:maxCount 1 ; - sh:name "JavaScript Expression" ; - sh:order 0 ; - sh:path reproschema:jsExpression ] ; - sh:targetClass reproschema:MessageSpecification . - -schema1:ImageObject a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:maxCount 1 ; - sh:order 3 ; - sh:path rdf:type ], - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:order 1 ; - sh:path schema1:inLanguage ], - [ sh:datatype xsd:anyURI ; - sh:maxCount 1 ; - sh:order 2 ; - sh:path schema1:id ], - [ sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path schema1:contentUrl ] ; - sh:targetClass schema1:ImageObject . - -reproschema:UI a sh:NodeShape ; - sh:closed true ; - sh:description "['todo']" ; - sh:ignoredProperties ( rdf:type ) ; - sh:name "todo" ; - sh:property [ sh:description "An array of items indicating properties allowed on an activity or protocol." ; - sh:in ( reproschema:AllowExport reproschema:AllowReplay reproschema:AutoAdvance reproschema:DisableBack ) ; - sh:name "allow" ; - sh:order 4 ; - sh:path reproschema:allow ], - [ sh:datatype xsd:string ; - sh:description "An element to describe the input type of a Item." ; - sh:maxCount 1 ; - sh:name "inputType" ; - sh:order 5 ; - sh:path reproschema:inputType ], - [ sh:class reproschema:OverrideProperty ; - sh:description "An array of objects to override the various properties added to assessments and fields." ; - sh:name "overrideProperties" ; - sh:nodeKind sh:BlankNode ; - sh:order 2 ; - sh:path reproschema:overrideProperties ], - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:order 6 ; - sh:path schema1:readonlyValue ], - [ sh:datatype xsd:string ; - sh:description "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface." ; - sh:name "Order" ; - sh:order 0 ; - sh:path reproschema:order ], - [ sh:datatype xsd:boolean ; - sh:description "An element (bool) to determine if the list of items is shuffled or in order." ; - sh:maxCount 1 ; - sh:name "Shuffle" ; - sh:order 3 ; - sh:path reproschema:shuffle ], - [ sh:class reproschema:AdditionalProperty ; - sh:description "An array of objects to describe the various properties added to assessments and Items." ; - sh:name "addProperties" ; - sh:nodeKind sh:BlankNode ; - sh:order 1 ; - sh:path reproschema:addProperties ] ; - sh:targetClass reproschema:UI . - -rdf:langString a sh:NodeShape ; - sh:closed true ; - sh:description "RDF langString tuple" ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; - sh:description "The value component of a langString." ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 1 ; - sh:path ], - [ sh:datatype xsd:string ; - sh:description "The language prefix component of a langString." ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:order 0 ; - sh:path ] ; - sh:targetClass rdf:langString . - - diff --git a/linkml-schema/reproschema_linkml.py b/linkml-schema/reproschema_linkml.py deleted file mode 100644 index 2b0e335da9..0000000000 --- a/linkml-schema/reproschema_linkml.py +++ /dev/null @@ -1,400 +0,0 @@ -from __future__ import annotations -from datetime import ( - datetime, - date -) -from decimal import Decimal -from enum import Enum -import re -import sys -from typing import ( - Any, - List, - Literal, - Dict, - Optional, - Union -) -from pydantic.version import VERSION as PYDANTIC_VERSION -if int(PYDANTIC_VERSION[0])>=2: - from pydantic import ( - BaseModel, - ConfigDict, - Field, - field_validator - ) -else: - from pydantic import ( - BaseModel, - Field, - validator - ) - -metamodel_version = "None" -version = "1.0.0" - - -class ConfiguredBaseModel(BaseModel): - model_config = ConfigDict( - validate_assignment = True, - validate_default = True, - extra = "forbid", - arbitrary_types_allowed = True, - use_enum_values = True, - strict = False, - ) - pass - - -class AllowedType(str, Enum): - # Indicates (by boolean) if alternate responses are allowed or not. - AllowAltResponse = "reproschema:AllowAltResponse" - # Indicates (by boolean) if data can be exported or not. - AllowExport = "reproschema:AllowExport" - # Indicates (by boolean) if items can be replayed or not. - AllowReplay = "reproschema:AllowReplay" - # Indicates (by boolean) if items can be skipped or not. - AllowSkip = "reproschema:AllowSkip" - # Indicates (by boolean) if assessments in a protocol can auto advance or not. - AutoAdvance = "reproschema:AutoAdvance" - # Indicates (by boolean) if we can go back to a completed assessment in a protocol. - DisableBack = "reproschema:DisableBack" - - -class MissingType(str, Enum): - # An element to describe the choice when the item is skipped. - Skipped = "reproschema:Skipped" - # An element to describe the choice when response is not known. - DontKnow = "reproschema:DontKnow" - # An element to describe the choice when the reason for missing response is unknown. - Unknown = "reproschema:Unknown" - # A boolean element to describe if the response did not occur within the prescribed time. - TimedOut = "reproschema:TimedOut" - - -class Agent(ConfiguredBaseModel): - pass - - -class Participant(Agent): - """ - An Agent describing characteristics associated with a participant. - """ - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - subject_id: Optional[str] = Field(None) - - -class Thing(ConfiguredBaseModel): - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class Activity(Thing): - """ - An assessment in a protocol. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") - citation: Optional[Dict[str, str]] = Field(default_factory=dict) - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") - cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class AdditionalNoteObj(Thing): - """ - A set of objects to define notes in a Item. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema - """ - column: Optional[str] = Field(None, title="column", description="""An element to define the column name where the note was taken from.""") - source: Optional[str] = Field(None, title="source", description="""An element to define the source (eg. RedCap, NDA) where the note was taken from.""") - value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class AdditionalProperty(Thing): - """ - An object to describe the various properties added to assessments and Items. - """ - allow: Optional[List[AllowedType]] = Field(default_factory=list, title="allow", description="""An array of items indicating properties allowed on an activity or protocol.""") - isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") - limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") - maxRetakes: Optional[int] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") - schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") - valueRequired: Optional[bool] = Field(None) - variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class Choice(Thing): - """ - An object to describe a response option. - """ - name: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class ComputeSpecification(Thing): - """ - An object to define computations in an activity or protocol. - """ - jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") - variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class Item(Thing): - """ - An item in an assessment. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - additionalNotesObj: Optional[List[AdditionalNoteObj]] = Field(default_factory=list, title="additional notes", description="""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.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") - audio: Optional[Union[AudioObject, str]] = Field(None, title="audio", description="""TODO""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - image: Optional[Union[ImageObject, str]] = Field(None, title="image", description="""An image of the item. This can be a URL or a fully described ImageObject.""") - isPartOf: Optional[Activity] = Field(None) - preamble: Optional[Dict[str, str]] = Field(default_factory=dict, title="Preamble", description="""The preamble for an assessment""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - question: Optional[Dict[str, str]] = Field(default_factory=dict) - responseOptions: Optional[Union[ResponseOption, str]] = Field(None, title="Response options", description="""An element (object or by URL)to describe the properties of response of the Item.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - video: Optional[Union[VideoObject, str]] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class LandingPage(Thing): - """ - An object to define the landing page of a protocol. - """ - inLanguage: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class MediaObject(Thing): - """ - Add description - """ - inLanguage: Optional[str] = Field(None) - contentUrl: str = Field(...) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class AudioObject(MediaObject): - inLanguage: Optional[str] = Field(None) - contentUrl: str = Field(...) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class ImageObject(MediaObject): - inLanguage: Optional[str] = Field(None) - contentUrl: str = Field(...) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class MessageSpecification(Thing): - """ - An object to define messages in an activity or protocol. - """ - jsExpression: Optional[str] = Field(None, title="JavaScript Expression", description="""A JavaScript expression for computations. A JavaScript expression to compute a score from other variables.""") - message: Optional[Dict[str, str]] = Field(default_factory=dict, title="Message", description="""The message to be conditionally displayed for an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class OverrideProperty(Thing): - """ - An object to override the various properties added to assessments and Items. - """ - isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - isVis: Optional[Union[bool, str]] = Field(None, title="visibility", description="""An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.""") - limit: Optional[str] = Field(None, title="limit", description="""An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.""") - maxRetakes: Optional[int] = Field(None, title="maxRetakes", description="""Defines number of times the item is allowed to be redone.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - randomMaxDelay: Optional[str] = Field(None, title="randomMaxDelay", description="""Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration""") - schedule: Optional[str] = Field(None, title="Schedule", description="""An element to set make activity available/repeat info using ISO 8601 repeating interval format.""") - valueRequired: Optional[bool] = Field(None) - variableName: Optional[str] = Field(None, title="variableName", description="""The name used to represent an item.""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class Protocol(Thing): - """ - A representation of a study which comprises one or more assessments. - """ - about: Optional[str] = Field(None, description="""The subject matter of the Field.""") - altLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="alternate label", description="""The alternate label.""") - associatedMedia: Optional[str] = Field(None, title="associatedMedia", description="""A media object that encodes this creative work. This property is a synonym for encoding.""") - compute: Optional[List[ComputeSpecification]] = Field(default_factory=list, title="computation", description="""An array of objects indicating computations in an activity or protocol and maps it to the corresponding 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.""") - cronTable: Optional[str] = Field(None, title="cronTable", description="""TODO not described in reproschema""") - description: Optional[Dict[str, str]] = Field(default_factory=dict) - landingPage: Optional[List[Union[LandingPage, str]]] = Field(default_factory=list, title="Landing page content", description="""An element (by URL) to point to the protocol readme or landing page.""") - messages: Optional[List[MessageSpecification]] = Field(default_factory=list, title="messages", description="""An array of objects to define conditional messages in an activity or protocol.""") - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - schemaVersion: Optional[str] = Field(None) - ui: Optional[UI] = Field(None, title="UI", description="""An element to control UI specifications. Originally @nest in jsonld, but using a class in the model.""") - version: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class Response(Thing): - """ - Describes the response of an item. - """ - isAbout: Optional[Union[Activity, Item, str]] = Field(None, title="isAbout", description="""A pointer to the node describing the item.""") - value: Optional[Union[Dict[str, str], MissingType, StructuredValue, bool, float, int, str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - wasAttributedTo: Optional[Participant] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class ResponseActivity(Thing): - """ - Captures information about some action that took place. It also links to information (entities) that were used during the activity - """ - endedAtTime: Optional[datetime ] = Field(None) - generated: Optional[str] = Field(None) - inLanguage: Optional[str] = Field(None) - startedAtTime: Optional[datetime ] = Field(None) - used: Optional[List[str]] = Field(default_factory=list) - wasAssociatedWith: Optional[SoftwareAgent] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class ResponseOption(Thing): - """ - An element (object or by URL)to describe the properties of response of the Item. - """ - choices: Optional[List[Union[Choice, str]]] = Field(default_factory=list, title="choices", description="""An array to list the available options for response of the Item.""") - datumType: Optional[str] = Field(None, title="datumType", description="""Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Item.""") - maxValue: Optional[Union[float, int]] = Field(None) - minValue: Optional[Union[float, int]] = Field(None) - multipleChoice: Optional[bool] = Field(None, title="Multiple choice response expectation", description="""Indicates (by bool) if response for the Item has one or more answer.""") - unitOptions: Optional[List[UnitOption]] = Field(default_factory=list, title="unitOptions", description="""A list of objects to represent a human displayable name alongside the more formal value for units.""") - valueType: Optional[List[str]] = Field(default_factory=list, title="The type of the response", description="""The type of the response of an item. For example, string, integer, etc.""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class SoftwareAgent(Thing): - """ - Captures information about some action that took place. It also links to information (entities) that were used during the activity - """ - version: Optional[str] = Field(None) - url: Optional[str] = Field(None) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class StructuredValue(Thing): - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class UI(ConfiguredBaseModel): - """ - ['todo'] - """ - order: Optional[List[Union[Activity, Item, str]]] = Field(default_factory=list, title="Order", description="""An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.""") - addProperties: Optional[List[AdditionalProperty]] = Field(default_factory=list, title="addProperties", description="""An array of objects to describe the various properties added to assessments and Items.""") - overrideProperties: Optional[List[OverrideProperty]] = Field(default_factory=list, title="overrideProperties", description="""An array of objects to override the various properties added to assessments and fields.""") - shuffle: Optional[bool] = Field(None, title="Shuffle", description="""An element (bool) to determine if the list of items is shuffled or in order.""") - allow: Optional[List[AllowedType]] = Field(default_factory=list, title="allow", description="""An array of items indicating properties allowed on an activity or protocol.""") - inputType: Optional[str] = Field(None, title="inputType", description="""An element to describe the input type of a Item.""") - readonlyValue: Optional[bool] = Field(None) - - -class UnitOption(Thing): - """ - An object to represent a human displayable name alongside the more formal value for units. - """ - prefLabel: Optional[Dict[str, str]] = Field(default_factory=dict, title="preferred label", description="""The preferred label.""") - value: Optional[Union[Dict[str, str], str]] = Field(None, title="value", description="""The value for each option in choices or in additionalNotesObj""") - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -class VideoObject(MediaObject): - inLanguage: Optional[str] = Field(None) - contentUrl: str = Field(...) - id: Optional[str] = Field(None, description="""A unique identifier for an entity. Must be either a CURIE shorthand for a URI or a complete URI.""") - name: Optional[Dict[str, str]] = Field(default_factory=dict) - category: Optional[str] = Field(None, description="""Name of the high level ontology class in which this entity is categorized. Corresponds to the label for the biolink entity type class. In an RDF database it should be a model class URI. This field is multi-valued.""") - - -# Model rebuild -# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model -Agent.model_rebuild() -Participant.model_rebuild() -Thing.model_rebuild() -Activity.model_rebuild() -AdditionalNoteObj.model_rebuild() -AdditionalProperty.model_rebuild() -Choice.model_rebuild() -ComputeSpecification.model_rebuild() -Item.model_rebuild() -LandingPage.model_rebuild() -MediaObject.model_rebuild() -AudioObject.model_rebuild() -ImageObject.model_rebuild() -MessageSpecification.model_rebuild() -OverrideProperty.model_rebuild() -Protocol.model_rebuild() -Response.model_rebuild() -ResponseActivity.model_rebuild() -ResponseOption.model_rebuild() -SoftwareAgent.model_rebuild() -StructuredValue.model_rebuild() -UI.model_rebuild() -UnitOption.model_rebuild() -VideoObject.model_rebuild() - diff --git a/validation/reproschema-shacl.ttl b/validation/reproschema-shacl.ttl deleted file mode 100644 index d0156a938e..0000000000 --- a/validation/reproschema-shacl.ttl +++ /dev/null @@ -1,473 +0,0 @@ -@prefix dash: . -@prefix rdf: . -@prefix reproschema: . -@prefix schema: . -@prefix sh: . -@prefix skos: . -@prefix xsd: . -@prefix nidm: . -@prefix uuid: . -@prefix prov: . - -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:or ( [ sh:nodeKind sh:IRI; ] - [sh:node reproschema:MediaObjectShape] ) ; - sh:path schema:image ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:audio ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:video ], - - [ sh:nodeKind sh:IRI ; - sh:path schema:about ], - - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path skos:prefLabel ], - - [ sh:datatype rdf:langString ; - sh:path skos:altLabel ], - - [ sh:datatype rdf:langString ; - sh:path reproschema:preamble ], - - [ sh:node reproschema:ComputeSpecificationShape ; - sh:path reproschema:compute ], - - [ sh:node reproschema:MessageSpecificationShape ; - sh:path reproschema:messages ], - - [ 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:node reproschema:OverridePropertiesShape ; - sh:path reproschema:overrideProperties ], - - [ sh:datatype schema:Boolean ; - sh:path reproschema:shuffle ], - - [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; - sh:path reproschema:allow ], - - [ sh:node reproschema:CronTableShape ; - sh:path reproschema:cronTable ] ; - 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:path skos:altLabel ], - - [ 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:question ], - - [ sh:datatype rdf:langString ; - sh:path reproschema:preamble ], - - [ sh:or ( [ sh:nodeKind sh:IRI ] - [ sh:node reproschema:MediaObjectShape] ) ; - sh:path schema:image ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:audio ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:video ], - - [ sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:minCount 1 ; - sh:path reproschema:inputType ], - - [ sh:datatype xsd:boolean ; - sh:maxCount 1 ; - sh:path schema:readonlyValue ], - - [ sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - sh:path schema:about ], - - [ sh:nodeKind sh:IRI ; - sh:path schema:isPartOf ], - - [ sh:node reproschema:AdditionalNoteObjShape ; - sh:path reproschema:additionalNotesObj ], - - [ sh:or ( [ sh:nodeKind sh:IRI ] [ 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:path schema:description ], - - [ sh:datatype rdf:langString ; - sh:path schema:schemaVersion ], - - [ sh:datatype rdf:langString ; - sh:path schema:version ], - - [ sh:nodeKind sh:IRI ; - sh:maxCount 1 ; - sh:path schema:about ], - - [ sh:or ( [ sh:nodeKind sh:IRI] - [sh:node reproschema:MediaObjectShape] ) ; - sh:path schema:image ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:audio ], - - [ sh:node reproschema:MediaObjectShape ; - sh:path schema:video ], - - [ sh:node reproschema:LandingPageShape; - sh:path reproschema:landingPage ], - - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path skos:prefLabel ], - - [ sh:datatype rdf:langString ; - sh:path skos:altLabel ], - - [ sh:datatype rdf:langString ; - sh:path reproschema:preamble ], - - [ sh:node reproschema:ComputeSpecificationShape ; - sh:path reproschema:compute ], - - [ sh:node reproschema:MessageSpecificationShape ; - sh:path reproschema:messages ], - - [ 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:node reproschema:OverridePropertiesShape ; - sh:path reproschema:overrideProperties ], - - [ sh:datatype schema:Boolean ; - sh:path reproschema:shuffle ], - - [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; - sh:path reproschema:allow ] ; - sh:targetClass reproschema:Protocol . - -reproschema:LandingPageShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:maxCount 1 ; - sh:path schema:inLanguage ] . - -reproschema:ResponseOptionsShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype schema:Boolean ; - sh:maxCount 1 ; - sh:path reproschema:multipleChoice ], - - [ 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 xsd:string ; - sh:maxCount 1 ; - sh:path reproschema:datumType ], - - [ sh:or ( [ sh:datatype schema:URL ] [ sh:datatype rdf:langString ] ) ; - sh:path schema:unitCode ], - - [ sh:node reproschema:UnitOptionsShape ; - sh:path reproschema:unitOptions ] , - - [ sh:node reproschema:ChoicesShape ; - sh:path reproschema:choices ] ; - sh:targetClass reproschema:ResponseOption . - -reproschema:AddPropertiesShape a sh:NodeShape ; - sh:closed true ; - 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 xsd:boolean ; - sh:path schema:valueRequired ], - - [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; - sh:path reproschema:allow ], - - [ sh:datatype rdf:langString ; - sh:pattern "^P(?!$)(\\d+(?:\\.\\d+)?Y)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?W)?(\\d+(?:\\.\\d+)?D)?(T(?=\\d)(\\d+(?:\\.\\d+)?H)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?S)?)?$" ; - sh:path reproschema:randomMaxDelay ], - - # Patterns extracted from: https://gist.githubusercontent.com/philipashlock/8830168/raw/e65bee7b2c1c9908fd62d064b2451e2cf29aa43c/index.html - [ sh:datatype rdf:langString ; - sh:or ( [sh:pattern "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" ] - [sh:pattern "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?(\\/)([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - [sh:pattern "^(R\\d*\\/)?([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?(\\/)P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" ] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?\\/([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - ) ; - sh:path reproschema:schedule ], - - [ sh:datatype rdf:langString ; - sh:or ( [sh:pattern "^P(?!$)(\\d+(?:\\.\\d+)?Y)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?W)?(\\d+(?:\\.\\d+)?D)?(T(?=\\d)(\\d+(?:\\.\\d+)?H)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?S)?)?$"] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?\\/([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - ) ; - sh:path reproschema:limit ], - - [ sh:datatype xsd:integer ; - sh:path reproschema:maxRetakes ] ; - - sh:targetClass reproschema:AdditionalProperty . - -reproschema:OverridePropertiesShape a sh:NodeShape ; - sh:closed true ; - 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 xsd:boolean ; - sh:path schema:valueRequired ], - - [ sh:datatype rdf:langString ; - sh:pattern "^P(?!$)(\\d+(?:\\.\\d+)?Y)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?W)?(\\d+(?:\\.\\d+)?D)?(T(?=\\d)(\\d+(?:\\.\\d+)?H)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?S)?)?$" ; - sh:path reproschema:randomMaxDelay ], - - # Patterns extracted from: https://gist.githubusercontent.com/philipashlock/8830168/raw/e65bee7b2c1c9908fd62d064b2451e2cf29aa43c/index.html - [ sh:datatype rdf:langString ; - sh:or ( [sh:pattern "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" ] - [sh:pattern "^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?(\\/)([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - [sh:pattern "^(R\\d*\\/)?([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?(\\/)P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" ] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?\\/([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - ) ; - sh:path reproschema:schedule ], - - [ sh:datatype rdf:langString ; - sh:or ( [sh:pattern "^P(?!$)(\\d+(?:\\.\\d+)?Y)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?W)?(\\d+(?:\\.\\d+)?D)?(T(?=\\d)(\\d+(?:\\.\\d+)?H)?(\\d+(?:\\.\\d+)?M)?(\\d+(?:\\.\\d+)?S)?)?$"] - [sh:pattern "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?\\/([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\4([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\18[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" ] - ) ; - sh:path reproschema:limit ], - - [ sh:datatype xsd:integer ; - sh:path reproschema:maxRetakes ] ; - sh:targetClass reproschema:OverrideProperty . - -reproschema:ChoicesShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:or ( [ sh:nodeKind sh:IRI ] [sh:node reproschema:MediaObjectShape] ) ; - sh:path schema:image ], - - [ sh:datatype rdf:langString ; - sh:path schema:name ], - - [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype rdf:langString ]) ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:Choice . - -reproschema:UnitOptionsShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:path skos:prefLabel ], - - [ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:datatype rdf:langString ]) ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:UnitOption . - -reproschema:IsVisShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path schema:method ], - - [ sh:nodeKind sh:IRI ; - sh:minCount 1 ; - sh:path schema:url ], - - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:payload ] . - -reproschema:ComputeSpecificationShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:variableName ], - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:jsExpression ] ; - sh:targetClass reproschema:ComputeSpecification . - -reproschema:MessageSpecificationShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:message ] , - - [ sh:or ( [ sh:datatype rdf:langString ] [ sh:datatype xsd:boolean ] ) ; - sh:minCount 1 ; - sh:path reproschema:jsExpression ] ; - sh:targetClass reproschema:MessageSpecification . - -reproschema:AdditionalNoteObjShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype xsd:string ; - sh:minCount 1 ; - sh:path reproschema:source ], - - [ sh:datatype xsd:string ; - 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 rdf:langString ]) ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:AdditionalNoteObj . - -reproschema:ResponseShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:node prov:ParticipantShape ; - sh:path prov:wasAttributedTo ], - - [ sh:nodeKind sh:IRI ; - sh:path reproschema:isAbout ], - - [ 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 ] ; - sh:targetClass reproschema:Response . - -prov:ParticipantShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:path nidm:subject_id ] ; - sh:targetClass reproschema:Participant . - -reproschema:ResponseActivityShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:nodeKind sh:IRI ; - sh:path prov:used ], - - [ sh:datatype rdf:langString ; - sh:path schema:inLanguage ], - - [ sh:datatype xsd:dateTime ; - sh:path prov:startedAtTime ], - - [ sh:datatype xsd:dateTime ; - sh:path prov:endedAtTime ], - - [ sh:node prov:SoftwareAgentShape ; - sh:path prov:wasAssociatedWith ], - - [ sh:datatype rdf:langString ; - sh:path prov:generated ] ; - sh:targetClass reproschema:ResponseActivity . - -prov:SoftwareAgentShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:path schema:version ], - - [ sh:nodeKind sh:IRI ; - sh:path schema:url ] ; - sh:targetClass reproschema:SoftwareAgent . - -reproschema:MediaObjectShape a sh:NodeShape ; - sh:closed true; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:nodeKind sh:IRI ; - sh:minCount 1 ; - sh:path schema:contentUrl ], - [ sh:datatype rdf:langString ; - sh:maxCount 1 ; - sh:path schema:inLanguage ] . From e601ae72c4e7bf1afab642b29a128c1088abe9a4 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 14 Jun 2024 09:32:10 -0400 Subject: [PATCH 33/34] running pre-commit --- contexts/reproschema | 1 - docs/01_introduction.md | 2 +- docs/41_create_new_protocol.md | 2 +- docs/42_adopt_assessments.md | 8 ++++---- docs/46_tools.md | 4 ++-- mkdocs.yml | 4 ++-- terms/Field | 1 - terms/unitOptions | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/contexts/reproschema b/contexts/reproschema index be56b06cdc..a06f15460c 100644 --- a/contexts/reproschema +++ b/contexts/reproschema @@ -244,4 +244,3 @@ } } } - diff --git a/docs/01_introduction.md b/docs/01_introduction.md index 524ebf9732..7bafba0f21 100644 --- a/docs/01_introduction.md +++ b/docs/01_introduction.md @@ -126,7 +126,7 @@ displayed to the user and under which conditions, should be computed The ReproSchema also allows for internationalization and multiple languages support -by making it very easy to keep everything the same +by making it very easy to keep everything the same except the language displayed by the user interface. Finally ReproSchema allows tracking of variations and version of different assessments diff --git a/docs/41_create_new_protocol.md b/docs/41_create_new_protocol.md index f5f8a63e56..c40ca4c6ca 100644 --- a/docs/41_create_new_protocol.md +++ b/docs/41_create_new_protocol.md @@ -6,7 +6,7 @@ Ready for your first ReproSchema project?! We are going to use the [Reproschema 1. Prerequisite: Ensure you have Git and Cookiecutter installed on your system. If not, please refer to the installation guides for Git and Cookiecutter. 2. Generate Your Repository: Use the Reproschema Protocol Cookiecutter to create a new repository for your research protocol. Run the following command in your terminal: - + ```bash cookiecutter gh:ReproNim/reproschema-protocol-cookiecutter ``` diff --git a/docs/42_adopt_assessments.md b/docs/42_adopt_assessments.md index e164a0452c..743b1fd394 100644 --- a/docs/42_adopt_assessments.md +++ b/docs/42_adopt_assessments.md @@ -1,4 +1,4 @@ -# Adopting Assessments from the reproschema-library +# Adopting Assessments from the reproschema-library This part focuses on how to select and integrate assessments from the reproschema-library into your research protocol, an essential step in crafting a comprehensive study. The chosen assessments are to be placed in the `activities` folder within your repository. This folder serves as the central hub for various assessments or activities that collectively form your research protocol. @@ -34,7 +34,7 @@ This step involves precise modifications, particularly in the `@context` and `ad Labeling this link as "demo" directs the schema to the location in the ReproSchema-library where items for demographics and background information are defined. We use the link with a specific commit ID to ensure the consistency of the assessment version. This contextual link allows the schema to access the detailed structures and definitions needed for each demographic item. -2. **Customizing "addProperties" for Demographic Variables**: +2. **Customizing "addProperties" for Demographic Variables**: In the "addProperties" section, we define each variable that corresponds to a demographic question. For example: @@ -141,8 +141,8 @@ Different from `demograpgics`, `psychological_questionnaire_schema` combines ass "isAbout": "demo:clinical_history_psychiatry" } ``` - + - The `order` array specifies the sequence in which these assessments will appear in the questionnaire, ensuring a logical flow for participants. - The `shuffle` setting is `false`, maintaining the defined order, and allow includes functionalities like auto-advance between assessments and data export. -See the outcome [here](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/activities/2_psychological/psychological_questionnaire_schema) \ No newline at end of file +See the outcome [here](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/activities/2_psychological/psychological_questionnaire_schema) diff --git a/docs/46_tools.md b/docs/46_tools.md index 78e813b39a..7108a4c0f8 100644 --- a/docs/46_tools.md +++ b/docs/46_tools.md @@ -52,7 +52,7 @@ reproschema reproschema2redcap cd reproschema-demo-protocol pwd ``` - + In this case, the output from `pwd` (which shows your current directory path)should be your ``. - ``: The name of the output CSV file where the converted data will be saved. @@ -90,4 +90,4 @@ The `redcap2reproschema` function has been integrated into a CLI tool, use the f reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml ``` -Those tools can also be used as Python functions. For detailed instructions, please visit [reproschema-py](https://github.com/ReproNim/reproschema-py). +Those tools can also be used as Python functions. For detailed instructions, please visit [reproschema-py](https://github.com/ReproNim/reproschema-py). diff --git a/mkdocs.yml b/mkdocs.yml index d80d83b113..9a56d46a96 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,8 +20,8 @@ nav: - Project structure: "20_project_structure.md" - Schema: "30_schema.md" - User Guide: - - Create a research protocol: "41_create_new_protocol.md" - - Adopt assessments from the library: "42_adopt_assessments.md" + - Create a research protocol: "41_create_new_protocol.md" + - Adopt assessments from the library: "42_adopt_assessments.md" - Create new assessments for a protocol: "43_create_new_assess.md" - Add a feedback section: "44_setup_feedback.md" - Finalize the protocol: "45_finalize_protocol.md" diff --git a/terms/Field b/terms/Field index 9e62b8c996..f8b86fa396 100644 --- a/terms/Field +++ b/terms/Field @@ -139,4 +139,3 @@ } ] } - diff --git a/terms/unitOptions b/terms/unitOptions index c25a5c2c2b..c3d1b8aba7 100644 --- a/terms/unitOptions +++ b/terms/unitOptions @@ -9,4 +9,4 @@ "@id": "reproschema:UnitOption" } ] -} \ No newline at end of file +} From 7a7b9c487cf93d4ff8c1796d50ce0b6a5b41563f Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Fri, 14 Jun 2024 09:49:46 -0400 Subject: [PATCH 34/34] removing link to validation --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c71c8692c5..c405b0b5b1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ This repository contains: - the [different terms of the ReproSchema](./terms) - the [corresponding context files](./contexts) - a example of [a protocol based on the reproschema](./examples) -- the [validation SHACL files](./validation) - the [documentation](./docs)