diff --git a/schemas/2val1refvsAnnot.json b/schemas/2val1refvsAnnot.json new file mode 100644 index 00000000..f16a88de --- /dev/null +++ b/schemas/2val1refvsAnnot.json @@ -0,0 +1,75 @@ +{ + "type": "Schema", + "shapes": [ + { + "id": "http://a.example/S", + "type": "ShapeDecl", + "shapeExpr": { + "type": "Shape", + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://a.example/p1", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { "value": "1", "type": "http://www.w3.org/2001/XMLSchema#integer" }, + { "value": "5", "type": "http://www.w3.org/2001/XMLSchema#integer" } + ] + }, + "annotations": [ + { + "type": "Annotation", + "predicate": "http://a.example/annot1", + "object": { + "value": "3", + "type": "http://www.w3.org/2001/XMLSchema#integer" + } + } + ] + }, + { + "type": "TripleConstraint", + "predicate": "http://a.example/p2", + "valueExpr": "http://a.example/NC", + "annotations": [ + { + "type": "Annotation", + "predicate": "http://a.example/annot1", + "object": { + "value": "4", + "type": "http://www.w3.org/2001/XMLSchema#integer" + } + } + ] + } + ] + } + } + }, + { + "id": "http://a.example/NC", + "type": "ShapeDecl", + "shapeExpr": { + "type": "NodeConstraint", + "values": [ + { "value": "2", "type": "http://www.w3.org/2001/XMLSchema#integer" }, + { "value": "6", "type": "http://www.w3.org/2001/XMLSchema#integer" } + ], + "annotations": [ + { + "type": "Annotation", + "predicate": "http://a.example/annot1", + "object": { + "value": "7", + "type": "http://www.w3.org/2001/XMLSchema#integer" + } + } + ] + } + } + ], + "@context": "http://www.w3.org/ns/shex.jsonld" +} diff --git a/schemas/2val1refvsAnnot.shex b/schemas/2val1refvsAnnot.shex new file mode 100644 index 00000000..b0b6764d --- /dev/null +++ b/schemas/2val1refvsAnnot.shex @@ -0,0 +1,9 @@ + { + [1 5] + // 3 ; + @ + // 4 ; +} + + [2 6] + // 7 diff --git a/schemas/2val1refvsAnnot.ttl b/schemas/2val1refvsAnnot.ttl new file mode 100644 index 00000000..83b2f348 --- /dev/null +++ b/schemas/2val1refvsAnnot.ttl @@ -0,0 +1,51 @@ +PREFIX shex: + +[] a shex:Schema ; + shex:shapes ( ) . + + + a shex:ShapeDecl ; + shex:shapeExpr [ + a shex:Shape ; + shex:expression [ + a shex:EachOf ; + shex:expressions ( + [ + a shex:TripleConstraint ; + shex:annotation ( [ + a shex:Annotation ; + shex:predicate ; + shex:object 3 + ] ) ; + shex:predicate ; + shex:valueExpr [ + a shex:NodeConstraint ; + shex:values ( 1 5 ) + ] + ] + [ + a shex:TripleConstraint ; + shex:annotation ( [ + a shex:Annotation ; + shex:predicate ; + shex:object 4 + ] ) ; + shex:predicate ; + shex:valueExpr + ] + ) + ] + ] . + + + a shex:ShapeDecl ; + shex:shapeExpr [ + a shex:NodeConstraint ; + shex:annotation ( [ + a shex:Annotation ; + shex:predicate ; + shex:object 7 + ] ) ; + shex:values ( 2 6 ) + ] . + diff --git a/schemas/2val1refvsCode.json b/schemas/2val1refvsCode.json new file mode 100644 index 00000000..2b8e4d16 --- /dev/null +++ b/schemas/2val1refvsCode.json @@ -0,0 +1,66 @@ +{ + "type": "Schema", + "shapes": [ + { + "id": "http://a.example/S", + "type": "ShapeDecl", + "shapeExpr": { + "type": "Shape", + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://a.example/p1", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { "value": "1", "type": "http://www.w3.org/2001/XMLSchema#integer" }, + { "value": "5", "type": "http://www.w3.org/2001/XMLSchema#integer" } + ] + }, + "semActs": [ + { + "type": "SemAct", + "name": "http://shex.io/extensions/Test/", + "code": " print(o) " + } + ] + }, + { + "type": "TripleConstraint", + "predicate": "http://a.example/p2", + "valueExpr": "http://a.example/NC", + "semActs": [ + { + "type": "SemAct", + "name": "http://shex.io/extensions/Test/", + "code": " print(o) " + } + ] + } + ] + } + } + }, + { + "id": "http://a.example/NC", + "type": "ShapeDecl", + "shapeExpr": { + "type": "NodeConstraint", + "values": [ + { "value": "2", "type": "http://www.w3.org/2001/XMLSchema#integer" }, + { "value": "6", "type": "http://www.w3.org/2001/XMLSchema#integer" } + ], + "semActs": [ + { + "type": "SemAct", + "name": "http://shex.io/extensions/Test/", + "code": " print(n) " + } + ] + } + } + ], + "@context": "http://www.w3.org/ns/shex.jsonld" +} diff --git a/schemas/2val1refvsCode.shex b/schemas/2val1refvsCode.shex new file mode 100644 index 00000000..380e6244 --- /dev/null +++ b/schemas/2val1refvsCode.shex @@ -0,0 +1,9 @@ + { + [1 5] + %{ print(o) %} ; + @ + %{ print(o) %} ; +} + + [2 6] + %{ print(n) %} diff --git a/schemas/2val1refvsCode.ttl b/schemas/2val1refvsCode.ttl new file mode 100644 index 00000000..4261958b --- /dev/null +++ b/schemas/2val1refvsCode.ttl @@ -0,0 +1,51 @@ +PREFIX sx: + +[] a sx:Schema ; + sx:shapes ( ) . + + + a sx:ShapeDecl ; + sx:shapeExpr [ + a sx:Shape ; + sx:expression [ + a sx:EachOf ; + sx:expressions ( + [ + a sx:TripleConstraint ; + sx:semActs ( [ + a sx:SemAct; + sx:code " print(o) "; + sx:name + ] ) ; + sx:predicate ; + sx:valueExpr [ + a sx:NodeConstraint ; + sx:values ( 1 5 ) + ] + ] + [ + a sx:TripleConstraint ; + sx:semActs ( [ + a sx:SemAct; + sx:code " print(o) "; + sx:name + ] ) ; + sx:predicate ; + sx:valueExpr + ] + ) + ] + ] . + + + a sx:ShapeDecl ; + sx:shapeExpr [ + a sx:NodeConstraint ; + sx:semActs ( [ + a sx:SemAct; + sx:code " print(n) "; + sx:name + ] ) ; + sx:values ( 2 6 ) + ] . + diff --git a/schemas/manifest.jsonld b/schemas/manifest.jsonld index a2827811..ce112bfd 100644 --- a/schemas/manifest.jsonld +++ b/schemas/manifest.jsonld @@ -2756,6 +2756,15 @@ "json": "1dotShapeAnnotSTRING_LITERAL1.json", "ttl": "1dotShapeAnnotSTRING_LITERAL1.ttl" }, + { + "@id": "#2val1refvsAnnot", + "@type": "sht:RepresentationTest", + "name": "2val1refvsAnnot", + "status": "mf:Approved", + "shex": "2val1refvsAnnot.shex", + "json": "2val1refvsAnnot.json", + "ttl": "2val1refvsAnnot.ttl" + }, { "@id": "#open3EachdotcloseAnnot3", "@type": "sht:RepresentationTest", @@ -2936,6 +2945,15 @@ "json": "startCode3fail.json", "ttl": "startCode3fail.ttl" }, + { + "@id": "#2val1refvsCode", + "@type": "sht:RepresentationTest", + "name": "2val1refvsCode", + "status": "mf:Approved", + "shex": "2val1refvsCode.shex", + "json": "2val1refvsCode.json", + "ttl": "2val1refvsCode.ttl" + }, { "@id": "#open3Eachdotclosecard23Annot3Code2", "@type": "sht:RepresentationTest", diff --git a/schemas/manifest.ttl b/schemas/manifest.ttl index f910ab24..4b59fb38 100644 --- a/schemas/manifest.ttl +++ b/schemas/manifest.ttl @@ -314,6 +314,7 @@ <#1dotShapePlusAnnotIRIREF> <#1dotShapeAnnotAIRIREF> <#1dotShapeAnnotSTRING_LITERAL1> + <#2val1refvsAnnot> <#open3EachdotcloseAnnot3> <#1dotCode1> <#open1dotcloseCode1> @@ -334,6 +335,7 @@ <#startCode1startReffail> <#startCode3> <#startCode3fail> + <#2val1refvsCode> <#open3Eachdotclosecard23Annot3Code2> <#0focusIRI> <#0focusBNODE> @@ -3065,6 +3067,14 @@ sx:ttl <1dotShapeAnnotSTRING_LITERAL1.ttl> ; . +<#2val1refvsAnnot> a sht:RepresentationTest ; + mf:name "2val1refvsAnnot" ; + mf:status mf:Approved ; + sx:shex <2val1refvsAnnot.shex> ; + sx:json <2val1refvsAnnot.json> ; + sx:ttl <2val1refvsAnnot.ttl> ; + . + <#open3EachdotcloseAnnot3> a sht:RepresentationTest ; mf:name "open3EachdotcloseAnnot3" ; mf:status mf:Approved ; @@ -3225,6 +3235,14 @@ sx:ttl ; . +<#2val1refvsCode> a sht:RepresentationTest ; + mf:name "2val1refvsCode" ; + mf:status mf:Approved ; + sx:shex <2val1refvsCode.shex> ; + sx:json <2val1refvsCode.json> ; + sx:ttl <2val1refvsCode.ttl> ; + . + <#open3Eachdotclosecard23Annot3Code2> a sht:RepresentationTest ; mf:name "open3Eachdotclosecard23Annot3Code2" ; mf:status mf:Approved ; diff --git a/validation/In1_Ip1_L1.In1_Ip2_L2.ttl b/validation/In1_Ip1_L1.In1_Ip2_L2.ttl new file mode 100644 index 00000000..3c81c477 --- /dev/null +++ b/validation/In1_Ip1_L1.In1_Ip2_L2.ttl @@ -0,0 +1,2 @@ + 1 . + 2 . diff --git a/validation/manifest.jsonld b/validation/manifest.jsonld index 60a0c4e4..fef50790 100644 --- a/validation/manifest.jsonld +++ b/validation/manifest.jsonld @@ -16499,6 +16499,23 @@ "comment": " { . } // 'STRING_LITERAL1' on { }", "status": "mf:Approved" }, + { + "@id": "#2val1refvsAnnot_pass", + "@type": "sht:ValidationTest", + "action": { + "schema": "../schemas/2val1refvsAnnot.shex", + "shape": "http://a.example/S", + "data": "In1_Ip1_L1.In1_Ip2_L2.ttl", + "focus": "http://a.example/n1" + }, + "extensionResults": [], + "name": "2val1refvsAnnot_pass", + "trait": [ + "Annotation" + ], + "comment": " { [1 5] 3; @ 4 } [2 6] 5 on { }", + "status": "mf:Approved" + }, { "@id": "#1dotCode1_pass", "@type": "sht:ValidationTest", @@ -16897,6 +16914,36 @@ "comment": "%{print('startAct 1')%} %{ fail('startAct 2') %} %{print('startAct 3')%} { . } on { }", "status": "mf:Approved" }, + { + "@id": "#2val1refvsCode_pass", + "@type": "sht:ValidationTest", + "action": { + "schema": "../schemas/2val1refvsCode.shex", + "shape": "http://a.example/S", + "data": "In1_Ip1_L1.In1_Ip2_L2.ttl", + "focus": "http://a.example/n1" + }, + "extensionResults": [ + { + "extension": "http://shex.io/extensions/Test/", + "prints": "\"2\"^^http://www.w3.org/2001/XMLSchema#integer" + }, + { + "extension": "http://shex.io/extensions/Test/", + "prints": "\"1\"^^http://www.w3.org/2001/XMLSchema#integer" + }, + { + "extension": "http://shex.io/extensions/Test/", + "prints": "\"2\"^^http://www.w3.org/2001/XMLSchema#integer" + } + ], + "name": "2val1refvsCode_pass", + "trait": [ + "SemanticAction" + ], + "comment": " { [1 5] %{ print(o) %}; @ %{ print(o) %} } [2 6] %{ print(s) %} on { }", + "status": "mf:Approved" + }, { "@id": "#open3Eachdotclosecard23Annot3Code2-p1p2p3X3", "@type": "sht:ValidationTest", diff --git a/validation/manifest.ttl b/validation/manifest.ttl index e00a1dc1..a467434c 100644 --- a/validation/manifest.ttl +++ b/validation/manifest.ttl @@ -1082,6 +1082,7 @@ <#1dotShapePlusAnnotIRIREF_pass> <#1dotShapeAnnotAIRIREF_pass> <#1dotShapeAnnotSTRING_LITERAL1_pass> + <#2val1refvsAnnot_pass> ## semantic actions <#1dotCode1_pass> @@ -1101,6 +1102,7 @@ <#startCode1startReffail_abort> <#startCode3_pass> <#startCode3fail_abort> + <#2val1refvsCode_pass> ## annotations + semantic actions <#open3Eachdotclosecard23Annot3Code2-p1p2p3X3> @@ -14276,6 +14278,19 @@ ] . +<#2val1refvsAnnot_pass> a sht:ValidationTest ; + mf:name "2val1refvsAnnot_pass" ; + sht:trait sht:Annotation ; + rdfs:comment " { [1 5] 3; @ 4 } [2 6] 5 on { }" ; + mf:status mf:Approved ; + mf:action [ + sht:schema <../schemas/2val1refvsAnnot.shex> ; + sht:shape ; + sht:data ; + sht:focus + ] + . + # !../schemas/open3EachdotcloseAnnot3.shex ## } annotations @@ -14620,6 +14635,33 @@ ] . +<#2val1refvsCode_pass> a sht:ValidationTest ; + mf:name "2val1refvsCode_pass" ; + sht:trait sht:SemanticAction ; + rdfs:comment " { [1 5] %{ print(o) %}; @ %{ print(o) %} } [2 6] %{ print(s) %} on { }" ; + mf:status mf:Approved ; + mf:action [ + sht:schema <../schemas/2val1refvsCode.shex> ; + sht:shape ; + sht:data ; + sht:focus + ] ; + mf:extensionResults ( + [ + mf:extension ; + mf:prints "\"2\"^^http://www.w3.org/2001/XMLSchema#integer" + ] + [ + mf:extension ; + mf:prints "\"1\"^^http://www.w3.org/2001/XMLSchema#integer" + ] + [ + mf:extension ; + mf:prints "\"2\"^^http://www.w3.org/2001/XMLSchema#integer" + ] + ) + . + ## } semantic actions ## annotations + semantic actions { <#open3Eachdotclosecard23Annot3Code2-p1p2p3X3> a sht:ValidationTest ;