This specification defines elements of the SHACL Shapes Constraint Language created to allow for profiles of SHACL and profiling with SHACL.

SHACL is a language for validating RDF graphs against a set of conditions, so this document's scope is limited to profiling of RDF graphs, including graphs containing SHACL Shapes.

The namespace for SHACL Profiling terms is http://www.w3.org/ns/shpr#

The suggested prefix for the SHACL Profiling namespace is shpr

SHACL Specifications

This specification is part of the SHACL 1.2 family of specifications. See the SHACL 1.2 Overview for a more detailed introduction to all of them.

The specifications are as follows:

SHACL 1.2 Overview
overviews the set of SHACL specifications
SHACL 1.2 Core
defines the Core of SHACL
SHACL 1.2 SPARQL Extensions
defines SPARQL-related extensions of the SHACL
SHACL 1.2 Node Expressions
defines graph expressions used to determine focus nodes in SHACL
SHACL 1.2 Inference Rules
defines SHACL's methods of rule-based inference
SHACL 1.2 UI
defines SHACL's use for User Interface generation
SHACL 1.2 Compact Syntax
defines an RDF syntax for expressing SHACL concepts
SHACL 1.2 Profiling (this specification)
defines the use of SHACL for profiling data, including SHACL data

Document Outline

The introduction provides background concepts of profiling and states this specification's scope.

Sections 2 & 3 cover the two main elements within the stated scope.

Introduction

What is profiling?

Profiling is the act of creating a "profile" of something.

Generically, in English, a "profile" of something is as follows:

The outline of a physical object or feature, or a representation of this

- Oxford English dictionary, use of the word "profile" since the 17th century

Within the world of data, a derived definition of "profile" consistent with the above is —

A summary or an extraction

In this definition, the essence of the English word is retained, since a summary or extraction of or from a data object may be an outline of it; for example, a 2D representation of a 3D spatial object. or a statistical summary of a dataset having lots of parts.

By definition, SHACL constrains (RDF) data; thus, any data that is valid according to a shapes graph will be a profile of the data graph that was validated. In the case of a shapes graph validating all elements of a data graph, the valid data will be a "null" profile of the data graph, that is identical to it.

The W3C's Profiles Vocabulary [[dx-prof]] has defined "data profiling" in the context of specifications or data specifications:

A data specification that constrains, extends, combines, or provides guidance or explanation about the use of other data specifications.

If a shapes graph is taken to be a "data specification" and it can sensibly be then, in addition to data valid according to a shapes graph being a profile of the data graph validated, the shapes graph itself is a profile of the data model used for the data graph.

Scope

With the above section's concepts in mind, this specification defines the following:

  1. profiles of SHACL
  2. profiling with SHACL

Terminology

Terminology used throughout this specification is taken from several sources:

SHACL 1.2 Core specification
technical terms for SHACL and RDF, the latter from [[rdf12-concepts]]
Profiles Vocabulary [[dx-prof]]
defines general terms to do with profiling including the terms "profiling" & "profile"

The SHACL & RDF terms include: binding , blank node , conformance , constraint , constraint component , data graph , datatype , failure , focus node , RDF graph , ill-formed , IRI , literal , local name , member , node , node shape , object , parameter , pre-binding , predicate , property path , property shape , RDF term , SHACL instance , SHACL list , SHACL subclass , shape , shapes graph , solution , subject , target , triple , validation , validation report , validation result , validator , value , value node .

The general profiling terms include: specification , [data] profile , metadata .

Document Conventions

Within this specification, the following namespace prefix definitions are used:

Prefix Namespace
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
sh: http://www.w3.org/ns/shacl#
xsd: http://www.w3.org/2001/XMLSchema#
ex: http://example.com/ns#

Within this specification, the following JSON-LD context is used:

{
  "@context": {
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "sh": "http://www.w3.org/ns/shacl#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "ex": "http://example.com/ns#"
  }
}

Note that the URI of the graph defining the SHACL vocabulary itself is equivalent to the namespace above, i.e., it includes the #. References to the SHACL vocabulary, e.g., via owl:imports should include the #.

Throughout the specification, color-coded boxes containing RDF graphs in Turtle and JSON-LD will appear. The color and title of a box indicate whether it is a Shapes graph, a Data graph, or something else. The Turtle specification fragments use the prefix bindings given above. The JSON-LD specification fragments use the context given above. Only the Turtle specifications will have parts highlighted.

# This box represents an input shapes graph <s> <p> <o> .
// This box represents an input shapes graph
{
  "@id": "ex:s",
  "ex:p": {
    "@id": "ex:o"
  }
}
# This box represents an input data graph. # When highlighting is used in the examples: # Elements highlighted in blue are focus nodes ex:Bob a ex:Person . # Elements highlighted in red are focus nodes that fail validation ex:Alice a ex:Person .
// This box represents an input data graph
{
	"@graph": [
		{
			"@id": "ex:Alice",
			"@type": "ex:Person"
		},
		{
			"@id": "ex:Bob",
			"@type": "ex:Person"
		}
	]
}
# This box represents an output results graph
// This box represents an output results graph

Grey boxes such as this include syntax rules that apply to the shapes graph.

true denotes the RDF term "true"^^xsd:boolean. false denotes the RDF term "false"^^xsd:boolean.

TODO

Profiles of SHACL

Content.

Profiling with SHACL

Content.

Summary of Syntax Rules from this Specification

Security Considerations

TODO

Privacy Considerations

TODO

Acknowledgements

Many people contributed to this specification, including members of the RDF Data Shapes Working Group.

Internationalization Considerations

TODO