HOME

TheInfoList



OR:

Shape Expressions (ShEx) is a
data model A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. For instance, a data model may specify that the data element representing a car be co ...
ling language for validating and describing a
Resource Description Framework The Resource Description Framework (RDF) is a World Wide Web Consortium (W3C) standard originally designed as a data model for metadata. It has come to be used as a general method for description and exchange of graph data. RDF provides a variety of ...
(RDF). It was proposed at the 2012 RDF Validation Workshop as a high-level, concise language for RDF validation. The shapes can be defined in a human-friendly compact syntax called ShExC or using any RDF serialization formats like
JSON-LD JSON-LD (JavaScript Object Notation for Linked Data) is a method of encoding linked data using JSON. One goal for JSON-LD was to require as little effort as possible from developers to transform their existing JSON to JSON-LD. JSON-LD allows data ...
or
Turtle Turtles are an order of reptiles known as Testudines, characterized by a special shell developed mainly from their ribs. Modern turtles are divided into two major groups, the Pleurodira (side necked turtles) and Cryptodira (hidden necked tu ...
. ShEx expressions can be used both to describe RDF and to automatically check the conformance of RDF data. The syntax of ShEx is similar to
Turtle Turtles are an order of reptiles known as Testudines, characterized by a special shell developed mainly from their ribs. Modern turtles are divided into two major groups, the Pleurodira (side necked turtles) and Cryptodira (hidden necked tu ...
and
SPARQL SPARQL (pronounced "sparkle" , a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description F ...
while the semantics is inspired by regular expression languages like
RelaxNG In computing, RELAX NG (REgular LAnguage for XML Next Generation) is a XML schema, schema language for XML—a RELAX NG schema specifies a pattern for the structure and content of an XML document. A RELAX NG schema is itself an XML document but R ...
.


Example

PREFIX : PREFIX schema: PREFIX xsd: :Person The previous example declares that nodes conforming to shape Person must have one property schema:name with a string value and zero or more properties schema:knows whose values must conform with shape Person.


Implementations


shex.js
JavaScript
shaclex
Scala library with support for
Jena (framework) Apache Jena is an open source Semantic Web framework for Java. It provides an API to extract data from and write to RDF graphs. The graphs are represented as an abstract "model". A model can be sourced with data from files, databases, URLs or a ...
and
RDF4J Eclipse RDF4J (formerly OpenRDF Sesame) is an open-source framework for storing, querying, and analysing RDF data. It was created by the Dutch software company Aduna as part of "On-To-Knowledge", a semantic web project that ran from 1999 to 2002 ...

PyShEx
Python
shexjava
Java
Ruby ShEx
Ruby
ShEx.ex
Elixir


Online playgrounds and demos



Online demo based o
shex.js

rdfshape
online demo based o
shaclex


References


Further reading

; Specification * *


See also

*
SHACL Shapes Constraint Language (SHACL) is a World Wide Web Consortium (W3C) standard language for describing Resource Description Framework (RDF) graphs. SHACL has been designed to enhance the semantic and technical interoperability layers of ontolog ...
*
Wikidata Wikidata is a collaboratively edited multilingual knowledge graph hosted by the Wikimedia Foundation. It is a common source of open data that Wikimedia projects such as Wikipedia, and anyone else, can use under the CC0 public domain license. ...
*
XML schema An XML schema is a description of a type of Extensible Markup Language, XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed ...
s {{Semantic Web Resource Description Framework Data modeling languages Declarative programming languages RDF data access Semantic Web World Wide Web Consortium standards SPARQL