diff --git a/reproschema/tests/contexts/base b/reproschema/tests/contexts/base index 536e687..ac6fb73 100644 --- a/reproschema/tests/contexts/base +++ b/reproschema/tests/contexts/base @@ -12,6 +12,7 @@ "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/reproschema/tests/contexts/generic b/reproschema/tests/contexts/generic index a06ee0e..a149495 100644 --- a/reproschema/tests/contexts/generic +++ b/reproschema/tests/contexts/generic @@ -20,6 +20,13 @@ "@id": "schema:image", "@type": "@id" }, + "inLanguage": { + "@id": "schema:inLanguage" + }, + "url": { + "@id": "schema:url", + "@type": "@id" + }, "citation": { "@id": "schema:citation", "@container": "@language" @@ -209,6 +216,32 @@ "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/reproschema/tests/data/activities/activity1.jsonld b/reproschema/tests/data/activities/activity1.jsonld index 9dae5b5..2c3cd49 100644 --- a/reproschema/tests/data/activities/activity1.jsonld +++ b/reproschema/tests/data/activities/activity1.jsonld @@ -4,7 +4,7 @@ "@id": "activity1.jsonld", "prefLabel": "Example 1", "description": "Activity example 1", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/", "preamble": { @@ -23,9 +23,9 @@ "variableName": "item1", "requiredValue": true, "isVis": true, - "randomMaxDelay": "2:0:0", - "limit": "2-0", - "schedule": "0 8 * * *" + "randomMaxDelay": "PT2H", + "limit": "P2D", + "schedule": "R/2020-08-01T08:00:00Z/P1D" } ], "order": [ diff --git a/reproschema/tests/data/activities/activity1_embed.jsonld b/reproschema/tests/data/activities/activity1_embed.jsonld index 653b3ab..f1bbef9 100644 --- a/reproschema/tests/data/activities/activity1_embed.jsonld +++ b/reproschema/tests/data/activities/activity1_embed.jsonld @@ -4,7 +4,7 @@ "@id": "activity1.jsonld", "prefLabel": "Example 1", "description": "Activity example 1", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/", "preamble": { @@ -24,7 +24,7 @@ "@id": "items/item1.jsonld", "prefLabel": "item1", "description": "Q1 of example 1", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "question": { "en": "Little interest or pleasure in doing things", diff --git a/reproschema/tests/data/activities/items/item1.jsonld b/reproschema/tests/data/activities/items/item1.jsonld index 05bc1bd..02cd0da 100644 --- a/reproschema/tests/data/activities/items/item1.jsonld +++ b/reproschema/tests/data/activities/items/item1.jsonld @@ -4,7 +4,7 @@ "@id": "item1.jsonld", "prefLabel": "item1", "description": "Q1 of example 1", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "question": { "en": "Little interest or pleasure in doing things", diff --git a/reproschema/tests/data/protocols/protocol1.jsonld b/reproschema/tests/data/protocols/protocol1.jsonld index e9e835f..5165739 100644 --- a/reproschema/tests/data/protocols/protocol1.jsonld +++ b/reproschema/tests/data/protocols/protocol1.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/generic", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { @@ -7,7 +7,7 @@ "es": "Protocol1_es" }, "description": "example Protocol", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "ui": { "addProperties": [ @@ -18,7 +18,10 @@ "en": "Screening", "es": "Screening_es" }, - "isVis": true + "isVis": true, + "schedule": "R5/2008-01-01T13:00:00Z/P1Y2M10DT2H30M", + "randomMaxDelay": "PT12H", + "limit": "P1W/2020-08-01T13:00:00Z" } ], "order": [ diff --git a/reproschema/tests/data/protocols/protocol1_embed.jsonld b/reproschema/tests/data/protocols/protocol1_embed.jsonld index 0959dff..f8904d4 100644 --- a/reproschema/tests/data/protocols/protocol1_embed.jsonld +++ b/reproschema/tests/data/protocols/protocol1_embed.jsonld @@ -1,5 +1,5 @@ { - "@context": "../../contexts/generic", + "@context": "../../contexts/generic", "@type": "reproschema:Protocol", "@id": "protocol1.jsonld", "prefLabel": { @@ -7,7 +7,7 @@ "es": "Protocol1_es" }, "description": "example Protocol", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "ui": { "addProperties": [ @@ -27,7 +27,7 @@ "@id": "../activities/activity1.jsonld", "prefLabel": "Example 1", "description": "Activity example 1", - "schemaVersion": "0.0.1", + "schemaVersion": "1.0.0-rc1.post", "version": "0.0.1", "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/", "preamble": { diff --git a/reproschema/tests/data/responses/response1.jsonld b/reproschema/tests/data/responses/response1.jsonld new file mode 100644 index 0000000..9513cbf --- /dev/null +++ b/reproschema/tests/data/responses/response1.jsonld @@ -0,0 +1,11 @@ +{ + "@context": "../../contexts/generic", + "@type": "reproschema:Response", + "@id": "uuid:fc963765-1f1b-4ad9-bc4b-0d21b9de5acb", + "wasAttributedTo": { + "@id": "uuid:2b0aab3d-495f-4eee-98a5-4284b3268a56", + "subject_id": "6aabb03d-9e5f-ae5e-c4a5-21b9b326868a" + }, + "isAbout": "../activities/items/item1.jsonld", + "value": 1 +} diff --git a/reproschema/tests/data/responses/responseActivity1.jsonld b/reproschema/tests/data/responses/responseActivity1.jsonld new file mode 100644 index 0000000..781eabf --- /dev/null +++ b/reproschema/tests/data/responses/responseActivity1.jsonld @@ -0,0 +1,19 @@ +{ + "@context": "../../contexts/generic", + "@type": "reproschema:ResponseActivity", + "@id": "uuid:96496a96-50d6-4b87-a65e-468420e7c80d", + "used": [ + "../activities/items/item1.jsonld", + "../activities/activity1.jsonld", + "../protocols/protocol1.jsonld" + ], + "inLanguage": "en", + "startedAtTime": "2020-07-23T22:15:37.675Z", + "endedAtTime": "2020-07-23T22:15:50.293Z", + "wasAssociatedWith": { + "version": "0.0.1", + "url": "https://schema.repronim.org/ui/#/", + "@id": "https://github.com/ReproNim/reproschema-ui" + }, + "prov:generated": "uuid:85d18360-1787-4d3d-b72e-b543ca9b4b1a" +} diff --git a/reproschema/tests/reproschema-shacl.ttl b/reproschema/tests/reproschema-shacl.ttl index a60e97a..bef11d4 100644 --- a/reproschema/tests/reproschema-shacl.ttl +++ b/reproschema/tests/reproschema-shacl.ttl @@ -1,4 +1,6 @@ @prefix dash: . +@prefix nidm: . +@prefix prov: . @prefix rdf: . @prefix reproschema: . @prefix schema: . @@ -11,96 +13,85 @@ reproschema:ActivityShape a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; sh:path schema:description ], - [ sh:datatype rdf:langString ; sh:path schema:schemaVersion ], - [ sh:datatype rdf:langString ; sh:path schema:version ], - [ sh:datatype rdf:langString ; sh:path schema:citation ], - [ sh:nodeKind sh:IRI ; sh:path schema:image ], - [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path skos:prefLabel ], - [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], - [ sh:node reproschema:ComputeSpecificationShape ; sh:path reproschema:compute ], - [ sh:maxCount 1 ; sh:node dash:ListShape ; sh:path reproschema:order ; sh:property [ sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], - [ sh:node reproschema:AddPropertiesShape ; sh:path reproschema:addProperties ], - [ sh:datatype xsd:string ; sh:path reproschema:inputType ], - [ sh:datatype schema:Boolean ; sh:path reproschema:shuffle ], - - [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; + [ sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; + sh:nodeKind sh:IRI ; sh:path reproschema:allow ], - [ sh:node reproschema:CronTableShape ; sh:path reproschema:cronTable ] ; sh:targetClass reproschema:Activity . -reproschema:FieldShape a sh:NodeShape ; +reproschema:AdditionalNoteObjShape a sh:NodeShape ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; sh:minCount 1 ; - sh:path skos:prefLabel ], + sh:path reproschema:source ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:column ], + [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ] ) ; + sh:path reproschema:value ] ; + sh:targetClass reproschema:AdditionalNoteObj . +reproschema:FieldShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:node reproschema:AdditionalNoteObj ; + sh:path reproschema:additionalNotesObj ], + [ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproschema:ResponseOptionsShape ] ) ; + sh:path reproschema:responseOptions ], + [ 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:nodeKind sh:IRI ; - sh:maxCount 1 ; + [ sh:maxCount 1 ; + sh:nodeKind sh:IRI ; sh:path schema:image ], - [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], - [ sh:datatype xsd:string ; sh:maxCount 1 ; sh:minCount 1 ; sh:path reproschema:inputType ], - [ sh:datatype xsd:boolean ; sh:maxCount 1 ; - sh:path schema:readonlyValue ], - - [ sh:node reproschema:AdditionalNoteObj ; - sh:path reproschema:additionalNotesObj ], - - [ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproschema:ResponseOptionsShape ] ) ; - sh:path reproschema:responseOptions ] ; + sh:path schema:readonlyValue ] ; sh:targetClass reproschema:Field . reproschema:ProtocolShape a sh:NodeShape ; @@ -108,142 +99,158 @@ reproschema:ProtocolShape a sh:NodeShape ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:datatype rdf:langString ; sh:path schema:description ], - [ sh:datatype rdf:langString ; sh:path schema:schemaVersion ], - [ sh:datatype rdf:langString ; sh:path schema:version ], - - [ sh:nodeKind sh:IRI ; - sh:maxCount 1 ; + [ sh:maxCount 1 ; + sh:nodeKind sh:IRI ; sh:path schema:image ], - [ sh:nodeKind sh:IRI ; sh:path reproschema:landingPage ], - [ sh:datatype rdf:langString ; sh:minCount 1 ; sh:path skos:prefLabel ], - [ sh:datatype rdf:langString ; sh:path reproschema:preamble ], - [ sh:node reproschema:ComputeSpecificationShape ; sh:path reproschema:compute ], - [ sh:minCount 1 ; sh:node dash:ListShape ; sh:path reproschema:order ; sh:property [ sh:minCount 1 ; sh:nodeKind sh:IRI ; sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ] ], - [ sh:node reproschema:AddPropertiesShape ; sh:path reproschema:addProperties ], - [ sh:datatype schema:Boolean ; sh:path reproschema:shuffle ], - - [ sh:nodeKind sh:IRI ; - sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; + [ sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ; + sh:nodeKind sh:IRI ; sh:path reproschema:allow ], - [ sh:node reproschema:CronTableShape ; sh:path reproschema:cronTable ] ; sh:targetClass reproschema:Protocol . +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 . + +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 . + +reproschema:ChoicesShape a sh:NodeShape ; + sh:closed true ; + sh:ignoredProperties ( rdf:type ) ; + sh:property [ sh:nodeKind sh:IRI ; + 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 schema:Text ] ) ; + sh:path reproschema:value ] ; + sh:targetClass reproschema:Choice . + +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:datatype rdf:langString ; + sh:minCount 1 ; + sh:path schema:url ], + [ sh:datatype rdf:langString ; + sh:minCount 1 ; + sh:path reproschema:payload ] . + 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:ChoicesShape ; sh:path reproschema:choices ] ; sh:targetClass reproschema:ResponseOption . +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 . + +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: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:datatype rdf:langString ; - sh:path reproschema:randomMaxDelay ], - + sh:path reproschema:randomMaxDelay ; + 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:datatype rdf:langString ; - sh:pattern "(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\\d+(ns|us|µs|ms|s|m|h))+)|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})" ; + 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:ChoicesShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:nodeKind sh:IRI ; - 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 schema:Text ]) ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:Choice . - -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:datatype rdf:langString ; - 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 ) ; @@ -254,18 +261,3 @@ reproschema:ComputeSpecificationShape a sh:NodeShape ; sh:minCount 1 ; sh:path reproschema:jsExpression ] ; sh:targetClass reproschema:ComputeSpecification . - -reproschema:AdditionalNoteObjShape a sh:NodeShape ; - sh:closed true ; - sh:ignoredProperties ( rdf:type ) ; - sh:property [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:source ], - - [ sh:datatype rdf:langString ; - sh:minCount 1 ; - sh:path reproschema:column ], - - [ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ]) ; - sh:path reproschema:value ] ; - sh:targetClass reproschema:AdditionalNoteObj . diff --git a/reproschema/tests/test_validate.py b/reproschema/tests/test_validate.py index 24a3c61..96e40db 100644 --- a/reproschema/tests/test_validate.py +++ b/reproschema/tests/test_validate.py @@ -15,5 +15,5 @@ def test_type_error(): def test_url(): - url = "https://raw.githubusercontent.com/ReproNim/reproschema-py/master/reproschema/tests/data/activities/activity1.jsonld" + url = "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/examples/activities/activity1.jsonld" assert validate(os.path.abspath("reproschema-shacl.ttl"), url)