Previous Up Next
Validating RDF data

Appendix B  WebIndex in SHACL

The following code contains the full version of the WebIndex data in SHACL that was described in Section 6.1.2.

@prefix : <http://example.org/> . @prefix sh: <http://www.w3.org/ns/shacl#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix wf: <http://data.webfoundation.org#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix qb: <http://purl.org/linked-data/cube#> . @prefix cex: <http://purl.org/weso/ontology/computex#> . @prefix dct: <http://purl.org/dc/terms/>. @prefix skos: <http://www.w3.org/2004/02/skos/core#>. @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix org: <http://www.w3.org/ns/org#> . :Country a sh:NodeShape ; sh:property [ sh:path rdfs:label ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path wf:iso2 ; sh:datatype xsd:string ; sh:length 2 ; sh:minCount 1 ; sh:maxCount 1 ] . :DataSet a sh:NodeShape ; sh:property [ sh:path rdf:type ; sh:hasValue qb:DataSet ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path qb:structure ; sh:hasValue wf:DSD ] ; sh:property [ sh:path rdfs:label ; sh:datatype xsd:string ; sh:maxCount 1 ] ; sh:property [ sh:path qb:slice ; sh:node :Slice ; ] ; sh:property [ sh:path dct:publisher ; sh:node :Organization ; sh:minCount 1 ; sh:maxCount 1 ] . :Slice a sh:NodeShape ; sh:property [ sh:path rdf:type ; sh:hasValue qb:Slice ] ; sh:property [ sh:path qb:sliceStructure ; sh:hasValue wf:sliceByYear ; sh:minCount 1 ; sh:maxCount 1 ; ] ; sh:property [ sh:path qb:observation ; sh:node :Observation ; ] ; sh:property [ sh:path cex:indicator ; sh:node :Indicator ; sh:minCount 1 ; sh:maxCount 1 ] . :Observation a sh:NodeShape ; sh:property [ sh:path rdf:type ; sh:in (qb:Observation wf:Observation); sh:minCount 2 ] ; sh:property [ sh:path rdf:type ; sh:minCount 2 ; sh:maxCount 2 ] ; sh:property [ sh:path cex:value ; sh:datatype xsd:float ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path rdfs:label ; sh:datatype xsd:string ; sh:maxCount 1 ] ; sh:property [ sh:path dct:issued ; sh:datatype xsd:dateTime ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:or ( [ sh:property [ sh:path dct:publisher ; sh:hasValue wf:WebFoundation ; ] ] [ sh:property [ sh:path dct:publisher ; sh:maxCount 0 ] ] ) ; sh:property [ sh:path qb:dataSet ; sh:node :DataSet ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path cex:ref-area ; sh:node :Country ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path cex:indicator; sh:node :Indicator ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:or ( [ sh:property [ sh:path wf:source ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path cex:computation ; sh:maxCount 0 ] ] [ sh:property [ sh:path cex:computation ; sh:node :Computation ; sh:minCount 1 ; sh:maxCount 1 ] ; sh:property [ sh:path wf:source ; sh:maxCount 0 ] ] ) . :Computation a sh:NodeShape ; sh:property [ sh:path rdf:type ; sh:hasValue cex:Computation ] . :Indicator a sh:NodeShape ; sh:property [ sh:path rdf:type ; sh:in ( wf:PrimaryIndicator wf:SecondaryIndicator ) ; sh:minCount 1 ; sh:maxCount 1 ; ] ; sh:property [ sh:path rdfs:label ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ; ] ; sh:property [ sh:path wf:provider ; sh:node :Organization ; sh:minCount 1 ; sh:maxCount 1 ; ] ; . :Organization a sh:NodeShape ; sh:closed true ; sh:ignoredProperties (rdf:type) ; sh:property [ sh:path rdf:type ; sh:hasValue org:Organization ; ] ; sh:property [ sh:path rdfs:label ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ; ] ; sh:property [ sh:path foaf:homepage ; sh:nodeKind sh:IRI ; sh:minCount 1 ; sh:maxCount 1 ; ] ; .

Previous Up Next