|
| 1 | +@prefix dash: <http://datashapes.org/dash#> . |
| 2 | +@prefix ex: <http://datashapes.org/sh/tests/core/complex/personexample.test#> . |
| 3 | +@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> . |
| 4 | +@prefix owl: <http://www.w3.org/2002/07/owl#> . |
| 5 | +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
| 6 | +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
| 7 | +@prefix sh: <http://www.w3.org/ns/shacl#> . |
| 8 | +@prefix sht: <http://www.w3.org/ns/shacl-test#> . |
| 9 | +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
| 10 | + |
| 11 | +ex:Alice |
| 12 | + rdf:type ex:Person ; |
| 13 | + ex:ssn "987-65-432A" ; |
| 14 | +. |
| 15 | +ex:Bob |
| 16 | + rdf:type ex:Person ; |
| 17 | + ex:ssn "123-45-6789" ; |
| 18 | + ex:ssn "124-35-6789" ; |
| 19 | +. |
| 20 | +ex:Calvin |
| 21 | + rdf:type ex:Person ; |
| 22 | + ex:birthDate "1999-09-09"^^xsd:date ; |
| 23 | + ex:worksFor ex:UntypedCompany ; |
| 24 | +. |
| 25 | +ex:PersonShape |
| 26 | + rdf:type sh:NodeShape ; |
| 27 | + sh:closed "true"^^xsd:boolean ; |
| 28 | + sh:ignoredProperties ( |
| 29 | + rdf:type |
| 30 | + ) ; |
| 31 | + sh:property _:b61064 ; |
| 32 | + sh:property _:b60054 ; |
| 33 | + sh:property [ |
| 34 | + sh:path [ |
| 35 | + sh:inversePath ex:worksFor ; |
| 36 | + ] ; |
| 37 | + sh:name "employee" ; |
| 38 | + ] ; |
| 39 | + sh:targetClass ex:Person ; |
| 40 | +. |
| 41 | +_:b61064 |
| 42 | + sh:path ex:ssn ; |
| 43 | + sh:datatype xsd:string ; |
| 44 | + sh:maxCount 1 ; |
| 45 | + sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" |
| 46 | +. |
| 47 | +_:b60054 |
| 48 | + sh:path ex:worksFor ; |
| 49 | + sh:class ex:Company ; |
| 50 | + sh:nodeKind sh:IRI |
| 51 | +. |
| 52 | +<> |
| 53 | + rdf:type mf:Manifest ; |
| 54 | + mf:entries ( |
| 55 | + <personexample> |
| 56 | + ) ; |
| 57 | +. |
| 58 | +<personexample> |
| 59 | + rdf:type sht:Validate ; |
| 60 | + rdfs:label "Test of personexample" ; |
| 61 | + mf:action [ |
| 62 | + sht:dataGraph <> ; |
| 63 | + sht:shapesGraph <> ; |
| 64 | + ] ; |
| 65 | + mf:result [ |
| 66 | + rdf:type sh:ValidationReport ; |
| 67 | + sh:conforms "false"^^xsd:boolean ; |
| 68 | + sh:result [ |
| 69 | + rdf:type sh:ValidationResult ; |
| 70 | + sh:focusNode ex:Alice ; |
| 71 | + sh:resultPath ex:ssn ; |
| 72 | + sh:resultSeverity sh:Violation ; |
| 73 | + sh:sourceConstraintComponent sh:PatternConstraintComponent ; |
| 74 | + sh:sourceShape _:b61064 ; |
| 75 | + sh:value "987-65-432A" ; |
| 76 | + ] ; |
| 77 | + sh:result [ |
| 78 | + rdf:type sh:ValidationResult ; |
| 79 | + sh:focusNode ex:Bob ; |
| 80 | + sh:resultPath ex:ssn ; |
| 81 | + sh:resultSeverity sh:Violation ; |
| 82 | + sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; |
| 83 | + sh:sourceShape _:b61064 ; |
| 84 | + ] ; |
| 85 | + sh:result [ |
| 86 | + rdf:type sh:ValidationResult ; |
| 87 | + sh:focusNode ex:Calvin ; |
| 88 | + sh:resultPath ex:birthDate ; |
| 89 | + sh:resultSeverity sh:Violation ; |
| 90 | + sh:sourceConstraintComponent sh:ClosedConstraintComponent ; |
| 91 | + sh:sourceShape ex:PersonShape ; |
| 92 | + sh:value "1999-09-09"^^xsd:date ; |
| 93 | + ] ; |
| 94 | + sh:result [ |
| 95 | + rdf:type sh:ValidationResult ; |
| 96 | + sh:focusNode ex:Calvin ; |
| 97 | + sh:resultPath ex:worksFor ; |
| 98 | + sh:resultSeverity sh:Violation ; |
| 99 | + sh:sourceConstraintComponent sh:ClassConstraintComponent ; |
| 100 | + sh:sourceShape _:b60054 ; |
| 101 | + sh:value ex:UntypedCompany ; |
| 102 | + ] ; |
| 103 | + ] ; |
| 104 | + mf:status sht:approved ; |
| 105 | +. |
0 commit comments