SHACL for SHACL
comment: This shapes graph can be used to validate SHACL shapes graphs against a subset of the syntax rules.
declare:
  prefix: shsh
  namespace: SHACL for SHACL

List shape
type: NodeShape
comment: A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL.
property:
  path:
    zero or more path: rest
  comment: Each list member (including this node) must be have the shape shsh:ListNodeShape.
  has value: nil
  node: List node shape

List node shape
type: NodeShape
comment: Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion.
or:
  has value: nil
  property:
    path: first
    max count: 0
  property:
    path: rest
    max count: 0
or:
  not:
    has value: nil
  property:
    path: first
    max count: 1
    min count: 1
  property:
    path: rest
    max count: 1
    min count: 1

Shape shape
type: NodeShape
comment: A shape that can be used to validate syntax rules for other shapes.
target class: NodeShape
target class: PropertyShape
target subjects of: targetClass
target subjects of: targetNode
target subjects of: targetObjectsOf
target subjects of: targetSubjectsOf
target subjects of: and
target subjects of: class
target subjects of: closed
target subjects of: datatype
target subjects of: disjoint
target subjects of: equals
target subjects of: flags
target subjects of: hasValue
target subjects of: ignoredProperties
target subjects of: in
target subjects of: languageIn
target subjects of: lessThan
target subjects of: lessThanOrEquals
target subjects of: maxCount
target subjects of: maxExclusive
target subjects of: maxInclusive
target subjects of: maxLength
target subjects of: minCount
target subjects of: minExclusive
target subjects of: minInclusive
target subjects of: minLength
target subjects of: node
target subjects of: nodeKind
target subjects of: not
target subjects of: or
target subjects of: pattern
target subjects of: property
target subjects of: qualifiedMaxCount
target subjects of: qualifiedMinCount
target subjects of: qualifiedValueShape
target subjects of: qualifiedValueShapesDisjoint
target subjects of: uniqueLang
target subjects of: xone
target objects of: node
target objects of: not
target objects of: property
target objects of: qualifiedValueShape
xone: NodeShapeShape
xone: PropertyShapeShape
property:
  path: targetNode
  node kind: IRIOrLiteral
property:
  path: targetClass
  node kind: IRI
property:
  path: targetSubjectsOf
  node kind: IRI
property:
  path: targetObjectsOf
  node kind: IRI
or:
  not:
    class: Class
    or:
      class: NodeShape
    or:
      class: PropertyShape
or:
  node kind: IRI
property:
  path: severity
  max count: 1
  node kind: IRI
property:
  path: message
  or:
    datatype: string
  or:
    datatype: langString
property:
  path: deactivated
  max count: 1
  in: true
  in: false
property:
  path: and
  node: List shape
property:
  path: class
  node kind: IRI
property:
  path: closed
  datatype: boolean
  max count: 1
property:
  path: ignoredProperties
  node: List shape
  max count: 1
property:
  path: ignoredProperties
  path:
    zero or more path: rest
  path: first
  node kind: IRI
property:
  path: datatype
  node kind: IRI
  max count: 1
property:
  path: disjoint
  node kind: IRI
property:
  path: equals
  node kind: IRI
property:
  path: in
  max count: 1
  node: List shape
property:
  path: languageIn
  max count: 1
  node: List shape
property:
  path: languageIn
  path:
    zero or more path: rest
  path: first
  datatype: string
property:
  path: lessThan
  node kind: IRI
property:
  path: lessThanOrEquals
  node kind: IRI
property:
  path: maxCount
  datatype: integer
  max count: 1
property:
  path: maxExclusive
  max count: 1
  node kind: Literal
property:
  path: maxInclusive
  max count: 1
  node kind: Literal
property:
  path: maxLength
  datatype: integer
  max count: 1
property:
  path: minCount
  datatype: integer
  max count: 1
property:
  path: minExclusive
  max count: 1
  node kind: Literal
property:
  path: minInclusive
  max count: 1
  node kind: Literal
property:
  path: minLength
  datatype: integer
  max count: 1
property:
  path: nodeKind
  in: BlankNode
  in: IRI
  in: Literal
  in: BlankNodeOrIRI
  in: BlankNodeOrLiteral
  in: IRIOrLiteral
  max count: 1
property:
  path: or
  node: List shape
property:
  path: pattern
  datatype: string
  max count: 1

NodeShapeShape
type: NodeShape
target objects of: node
property:
  path: path
  max count: 0
property:
  path: lessThan
  max count: 0
property:
  path: lessThanOrEquals
  max count: 0
property:
  path: maxCount
  max count: 0
property:
  path: minCount
  max count: 0
property:
  path: qualifiedValueShape
  max count: 0
property:
  path: uniqueLang
  max count: 0

PropertyShapeShape
type: NodeShape
target objects of: property
property:
  path: path
  max count: 1
  min count: 1
  node: Path shape

Path shape
type: NodeShape
comment: A shape that can be used to validate the syntax rules of well-formed SHACL paths.
property:
  path:
    zero or more path:
      alternative path:
        zero or more path: rest
      alternative path: first
      alternative path: alternativePath
      alternative path:
        zero or more path: rest
      alternative path: inversePath
      alternative path: zeroOrMorePath
      alternative path: oneOrMorePath
      alternative path: zeroOrOnePath
  node: PathNodeShape

PathNodeShape
xone:
  node kind: IRI
xone:
  node kind: BlankNode
  node: PathListWithAtLeast2Members
xone:
  node kind: BlankNode
  closed: true
  property:
    path: alternativePath
    node: PathListWithAtLeast2Members
    min count: 1
    max count: 1
xone:
  node kind: BlankNode
  closed: true
  property:
    path: inversePath
    min count: 1
    max count: 1
xone:
  node kind: BlankNode
  closed: true
  property:
    path: zeroOrMorePath
    min count: 1
    max count: 1
xone:
  node kind: BlankNode
  closed: true
  property:
    path: oneOrMorePath
    min count: 1
    max count: 1
xone:
  node kind: BlankNode
  closed: true
  property:
    path: zeroOrOnePath
    min count: 1
    max count: 1

PathListWithAtLeast2Members
type: NodeShape
node: List shape
property:
  path:
    one or more path: rest
  min count: 2

path: flags
datatype: string
max count: 1

path: qualifiedMaxCount
datatype: integer
max count: 1

path: qualifiedMinCount
datatype: integer
max count: 1

path: qualifiedValueShape
max count: 1

path: qualifiedValueShapesDisjoint
datatype: boolean
max count: 1

path: uniqueLang
datatype: boolean
max count: 1