Skip to content

Commit

Permalink
Clarified that the values of sh:nodeShape must be IRIs. Added sh:allo…
Browse files Browse the repository at this point in the history
…wedValues as inverseProperty constraint (in system vocabulary).
  • Loading branch information
HolgerKnublauch committed Sep 2, 2015
1 parent be90c6a commit c5ea745
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions shacl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,7 @@ <h3>Scopes</h3>
<h4>Individual scopes (sh:nodeShape)</h4>
<p>
Individual nodes can point to the shapes that they are supposed to be validated against using the property <code>sh:nodeShape</code>.
The values of <code>sh:nodeShape</code> must be IRIs.
This pattern is illustrated in the following example.
</p>
<pre class="example" title="Scope based on sh:nodeShape">
Expand Down
25 changes: 22 additions & 3 deletions shacl/shacl.shacl.ttl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# baseURI: http://www.w3.org/ns/shacl

# SHACL - Shapes Constraint Language
# Draft last edited on 2015-09-01
# Draft last edited on 2015-09-02
# Created by the W3C RDF Data Shapes Working Group
# Editor: Holger Knublauch <holger@topquadrant.com>

Expand Down Expand Up @@ -179,6 +179,7 @@ sh:NodeKind
rdfs:subClassOf rdfs:Resource ;
rdfs:label "Node kind" ;
rdfs:comment "The class of RDF node kinds: literals, blank nodes and IRIs." ;
# TODO: Maybe specify that this is an enumerated class (ISSUE-84)
.

sh:BlankNode
Expand Down Expand Up @@ -885,7 +886,7 @@ sh:AbstractCountPropertyConstraint
] ;
sh:message "Required value count [{?minCount}..{?maxCount}] but found {?count}" ;
sh:sparql """
SELECT ?this (?this AS ?subject) ?predicate ?count ?minCount ?maxCount
SELECT ?this (?this AS ?subject) ?predicate ?count
WHERE {
BIND (sh:valueCount(?this, ?predicate) AS ?count) .
FILTER ((?count < ?minCount) || (bound(?maxCount) && (?count > ?maxCount))) .
Expand Down Expand Up @@ -1204,6 +1205,23 @@ sh:PropertyConstraint

# Inverse property constraints ------------------------------------------------

sh:AbstractAllowedValuesInversePropertyConstraint
a sh:InversePropertyValueConstraintTemplate ;
rdfs:subClassOf sh:AbstractPropertyConstraint ;
rdfs:label "Abstract allowed values inverse property constraint" ;
rdfs:comment "Specifies the allowed values for an inverse property by pointing to a List of nodes." ;
sh:abstract true ;
sh:argument [
sh:predicate sh:allowedValues ;
sh:optionalWhenInherited true ;
sh:valueClass rdf:List ;
rdfs:label "allowed values" ;
rdfs:comment "The rdf:List containing the allowed values of the inverse property." ;
] ;
sh:message "Value is not one of the allowed values" ;
sh:validationFunction sh:isAllowedValue ;
.

sh:AbstractCountInversePropertyConstraint
a sh:ConstraintTemplate ;
rdfs:subClassOf sh:AbstractPropertyConstraint ;
Expand Down Expand Up @@ -1290,6 +1308,7 @@ sh:AbstractValueShapeInversePropertyConstraint

sh:InversePropertyConstraint
a sh:ConstraintTemplate ;
rdfs:subClassOf sh:AbstractAllowedValuesInversePropertyConstraint ;
rdfs:subClassOf sh:AbstractCountInversePropertyConstraint ;
rdfs:subClassOf sh:AbstractValueClassInversePropertyConstraint ;
rdfs:subClassOf sh:AbstractValueShapeInversePropertyConstraint ;
Expand Down Expand Up @@ -1912,7 +1931,7 @@ sh:DefaultValueTypeRule
sh:nodeShape
a rdf:Property ;
rdfs:label "node shape" ;
rdfs:comment "Links a resource with the shapes that it is supposed to have." ;
rdfs:comment "Links a resource with the shapes that it is supposed to have. All values of this property must be IRI nodes." ;
rdfs:range sh:Shape ;
.

Expand Down

0 comments on commit c5ea745

Please sign in to comment.