SHACL
Shapes Constraint Language (SHACL) is a World Wide Web Consortium (W3C) standard language for describing Resource Description Framework (RDF) graphs.[src] SHACL has been designed to enhance the semantic and technical interoperability layers of ontologies expressed as RDF graphs.[src] SHACL models are defined in terms of constraints on the content, structure and meaning of a graph.[src] SHACL is a highly expressive language.[src] Among others, it includes features to express conditions that constrain the number of values that a property may have, the type of such values, numeric ranges, string matching patterns, and logical combinations of such constraints.[src] SHACL also includes an extension mechanism to express more complex conditions in languages such as SPARQL and JavaScript.[src] SHACL Rules add inferencing capabilities to SHACL, allowing users to define what new statements can be inferred from existing (asserted) statements.[src]
Shapes Constraint Language (SHACL) is a World Wide Web Consortium (W3C) standard language for describing Resource Description Framework (RDF) graphs.[src] SHACL has been designed to enhance the semantic and technical interoperability layers of ontologies expressed as RDF graphs.[src] SHACL models are defined in terms of constraints on the content, structure and meaning of a graph.[src] SHACL is a highly expressive language.[src] Among others, it includes features to express conditions that constrain the number of values that a property may have, the type of such values, numeric ranges, string matching patterns, and logical combinations of such constraints.[src] SHACL also includes an extension mechanism to express more complex conditions in languages such as SPARQL and JavaScript.[src] SHACL Rules add inferencing capabilities to SHACL, allowing users to define what new statements can be inferred from existing (asserted) statements.[src] ==Terminology== SHACL lets its users describe shapes of data, targeting where a specific shape applies.[src] ===Property shapes=== A property shape describes characteristics of graph nodes that can be reached via a specific path.[src] A path can be a single predicate (property) or a chain of predicates.[src] A property shape must always specify a path.[src] This is done by using sh:path predicate.[src] One can think of property shapes that use simple paths as describing values of certain properties e.g., values of an age property or values of a works for property.[src] Complex paths can specify a combination of different predicates in a chain, including the inverse direction, alternative predicates and transitive chains.[src] Property shapes can be defined as part of a node shape.[src] In this case, a node shape points to property shapes using sh:property predicate.[src] Property shapes can also be "stand-alone" i.e., completely independent from any node shapes.[src] ===Node shapes=== A node shape describes characteristics of specific graph nodes irrespective of how you get to them.[src] It can, for example, be said that certain graph nodes must be literals or a URIs, etc.[src] It is common to include property shapes into a node shape, effectively defining values of many different properties of a node.[src] For example, a node shape for an employee may incorporate property shapes for age and works for properties.[src] ===Constraints=== A constraint is a way to describe characteristics of values.[src] A shape contains one or more constraint declarations.[src] SHACL provides many pre-built constraint types.[src] For example, sh:datatype is used to describe the type of literal values e.g., if they are strings or integers or dates.[src] sh:minCount is used to describe the minimum required number of values.[src] sh:length is used to describe the number of characters for a value.[src] ===Targets=== A target connects a shape with data it describes.[src] The ways to define a shape target are: State that a node shape is a class; the constraint applies to all instances of the class State that a shape targets members of a certain class.[src] State that a shape targets a specific resource by giving its URI.[src] State that a shape targets all subjects or all objects of triples with a certain predicate.[src] Use a SPARQL query to select the targeted resources.[src] Target declarations can be included in a node shape or in a property shape.[src] However, when a property shape is a part of a node shape, its own targets are ignored.[src] SHACL uses rdfs:subClassOf statements to identify targets.[src] A shape targeting members of a class, also targets members of all its subclasses.[src] In other words, all SHACL definitions for a class are inherited by subclasses.[src]
44 sentences · 44 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"SHACL." encyclopegia.org, 2026, https://encyclopegia.org/wiki/shacl. Accessed 04 December 2026.
Chicago
"SHACL." encyclopegia.org. Accessed December 4, 2026. https://encyclopegia.org/wiki/shacl.
APA
encyclopegia.org. (2026). SHACL. Retrieved December 4, 2026, from https://encyclopegia.org/wiki/shacl
Accessed December 4, 2026 · CC BY-SA 4.0 · citation page · JSON