Skip to content

Commit c64e00e

Browse files
author
Sanu Ann
committed
refactor shacl shape and context
1 parent f5a0415 commit c64e00e

File tree

6 files changed

+61
-40
lines changed

6 files changed

+61
-40
lines changed

reproschema/tests/contexts/generic

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212
"@container": "@language"
1313
},
1414
"value": {
15-
"@id": "reproschema:value",
16-
"@type": "@id",
17-
"@container": "@language"
15+
"@id": "reproschema:value"
1816
},
1917
"image": {
2018
"@id": "schema:image",
2119
"@type": "@id"
2220
},
21+
"associatedMedia": {
22+
"@id": "schema:associatedMedia",
23+
"@type": "@id",
24+
"@container": "@set"
25+
},
2326
"inLanguage": {
2427
"@id": "schema:inLanguage"
2528
},
@@ -181,6 +184,7 @@
181184
},
182185
"additionalNotesObj": {
183186
"@id": "reproschema:additionalNotesObj",
187+
"@type": "reproschema:AdditionalNoteObj",
184188
"@container": "@set"
185189
},
186190
"source": {

reproschema/tests/data/activities/activity1.jsonld

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@
3636
{ "isAbout": "items/item2.jsonld",
3737
"variableName": "item2",
3838
"requiredValue": true,
39-
"isVis": true
39+
"isVis": true,
40+
"allow": ["reproschema:Skipped"]
4041
}
4142
],
4243
"order": [
4344
"items/item1.jsonld",
44-
"items/item2.jsonld"
45+
"items/item2.jsonld",
46+
"items/activity1_total_score"
4547
],
4648
"shuffle": false
4749
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"@context": "../../../contexts/generic",
3+
"@type": "reproschema:Field",
4+
"@id": "activity1_total_score",
5+
"prefLabel": "activity1_total_score",
6+
"description": "Score item for Activity 1",
7+
"schemaVersion": "1.0.0-rc2",
8+
"version": "0.0.1",
9+
"ui": {
10+
"inputType": "number",
11+
"readonlyValue": true
12+
},
13+
"responseOptions": {
14+
"valueType": "xsd:integer",
15+
"minValue": 0,
16+
"maxValue": 3
17+
}
18+
}

reproschema/tests/data/activities/items/item1.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757
}
5858
]
5959

60-
}
60+
}

reproschema/tests/data/activities/items/item2.jsonld

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"@id": "item2.jsonld",
55
"prefLabel": "item2",
66
"description": "Q2 of example 1",
7-
"schemaVersion": "1.0.0-rc2",
7+
"schemaVersion": "0.0.1",
88
"version": "0.0.1",
99
"question": {
1010
"en": "Current temperature.",
@@ -14,23 +14,7 @@
1414
"inputType": "float"
1515
},
1616
"responseOptions": {
17-
"valueType": "xsd:float",
18-
"unitOptions": [
19-
{
20-
"prefLabel": {
21-
"en": "Fahrenheit",
22-
"es": "Fahrenheit"
23-
},
24-
"value": "°F"
25-
},
26-
{
27-
"prefLabel": {
28-
"en": "Celsius",
29-
"es": "Celsius"
30-
},
31-
"value": "°C"
32-
}
33-
]
17+
"valueType": "xsd:float"
3418
}
3519
}
3620

reproschema/tests/reproschema-shacl.ttl

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ reproschema:ActivityShape a sh:NodeShape ;
2727
[ sh:nodeKind sh:IRI ;
2828
sh:path schema:image ],
2929

30+
[ sh:nodeKind sh:IRI ;
31+
sh:path schema:associatedMedia ],
32+
33+
[ sh:nodeKind sh:IRI ;
34+
sh:path schema:about ],
35+
3036
[ sh:datatype rdf:langString ;
3137
sh:minCount 1 ;
3238
sh:path skos:prefLabel ],
@@ -56,9 +62,6 @@ reproschema:ActivityShape a sh:NodeShape ;
5662
[ sh:node reproschema:OverridePropertiesShape ;
5763
sh:path reproschema:overrideProperties ],
5864

59-
[ sh:datatype xsd:string ;
60-
sh:path reproschema:inputType ],
61-
6265
[ sh:datatype schema:Boolean ;
6366
sh:path reproschema:shuffle ],
6467

@@ -92,12 +95,15 @@ reproschema:FieldShape a sh:NodeShape ;
9295
[ sh:datatype rdf:langString ;
9396
sh:path schema:question ],
9497

98+
[ sh:datatype rdf:langString ;
99+
sh:path reproschema:preamble ],
100+
95101
[ sh:nodeKind sh:IRI ;
96102
sh:maxCount 1 ;
97103
sh:path schema:image ],
98104

99-
[ sh:datatype rdf:langString ;
100-
sh:path reproschema:preamble ],
105+
[ sh:nodeKind sh:IRI ;
106+
sh:path schema:associatedMedia ],
101107

102108
[ sh:datatype xsd:string ;
103109
sh:maxCount 1 ;
@@ -108,7 +114,14 @@ reproschema:FieldShape a sh:NodeShape ;
108114
sh:maxCount 1 ;
109115
sh:path schema:readonlyValue ],
110116

111-
[ sh:node reproschema:AdditionalNoteObj ;
117+
[ sh:nodeKind sh:IRI ;
118+
sh:maxCount 1 ;
119+
sh:path schema:about ],
120+
121+
[ sh:nodeKind sh:IRI ;
122+
sh:path schema:isPartOf ],
123+
124+
[ sh:node reproschema:AdditionalNoteObjShape ;
112125
sh:path reproschema:additionalNotesObj ],
113126

114127
[ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:node reproschema:ResponseOptionsShape ] ) ;
@@ -129,7 +142,10 @@ reproschema:ProtocolShape a sh:NodeShape ;
129142

130143
[ sh:nodeKind sh:IRI ;
131144
sh:maxCount 1 ;
132-
sh:path schema:image ],
145+
sh:path schema:about ],
146+
147+
[ sh:nodeKind sh:IRI ;
148+
sh:path schema:associatedMedia ],
133149

134150
[ sh:nodeKind sh:IRI ;
135151
sh:path reproschema:landingPage ],
@@ -168,10 +184,7 @@ reproschema:ProtocolShape a sh:NodeShape ;
168184

169185
[ sh:nodeKind sh:IRI ;
170186
sh:in ( reproschema:AllowExport reproschema:DisableBack reproschema:AutoAdvance reproschema:AllowReplay reproschema:Skipped reproschema:DontKnow reproschema:TimedOut ) ;
171-
sh:path reproschema:allow ],
172-
173-
[ sh:node reproschema:CronTableShape ;
174-
sh:path reproschema:cronTable ] ;
187+
sh:path reproschema:allow ] ;
175188
sh:targetClass reproschema:Protocol .
176189

177190
reproschema:ResponseOptionsShape a sh:NodeShape ;
@@ -308,7 +321,7 @@ reproschema:ChoicesShape a sh:NodeShape ;
308321
[ sh:datatype rdf:langString ;
309322
sh:path schema:name ],
310323

311-
[ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ]) ;
324+
[ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype rdf:langString ]) ;
312325
sh:path reproschema:value ] ;
313326
sh:targetClass reproschema:Choice .
314327

@@ -318,7 +331,7 @@ reproschema:UnitOptionsShape a sh:NodeShape ;
318331
sh:property [ sh:datatype rdf:langString ;
319332
sh:path skos:prefLabel ],
320333

321-
[ sh:or ( [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Text ]) ;
334+
[ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype rdf:langString ]) ;
322335
sh:path reproschema:value ] ;
323336
sh:targetClass reproschema:UnitOption .
324337

@@ -363,15 +376,15 @@ reproschema:MessageSpecificationShape a sh:NodeShape ;
363376
reproschema:AdditionalNoteObjShape a sh:NodeShape ;
364377
sh:closed true ;
365378
sh:ignoredProperties ( rdf:type ) ;
366-
sh:property [ sh:datatype rdf:langString ;
379+
sh:property [ sh:datatype xsd:string ;
367380
sh:minCount 1 ;
368381
sh:path reproschema:source ],
369382

370-
[ sh:datatype rdf:langString ;
383+
[ sh:datatype xsd:string ;
371384
sh:minCount 1 ;
372385
sh:path reproschema:column ],
373386

374-
[ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype schema:Text ]) ;
387+
[ sh:or ( [ sh:datatype xsd:integer ] [ sh:nodeKind sh:IRI ] [ sh:datatype schema:Boolean ] [ sh:datatype schema:StructuredValue ] [ sh:datatype rdf:langString ]) ;
375388
sh:path reproschema:value ] ;
376389
sh:targetClass reproschema:AdditionalNoteObj .
377390

0 commit comments

Comments
 (0)