SlideShare a Scribd company logo
ShEx & SHACL compared
RDF Validation tutorial
Eric Prud'hommeaux
World Wide Web Consortium
MIT, Cambridge, MA, USA
Harold Solbrig
Mayo Clinic, USA
Jose Emilio Labra Gayo
WESO Research group
University of Oviedo, Spain
Iovka Boneva
LINKS, INRIA & CNRS
University of Lille, France
Common features
Similar goal: describe and validate RDF graphs
Both employ the word "shape"
Node constraints similar in both languages
Constraints on incoming/outgoing arcs
Cardinalities
RDF syntax
Extension mechanism
Some differences
Underlying philosophy
Syntactic differences
Notion of a shape
Syntactic differences
Default cardinalities
Shapes and Classes
Recursion
Repeated properties
Property pair constraints
Uniqueness
Extension mechanism
Underlying philosophy
ShEx is schema based
Shapes schemas look like RDF grammars
More focus on validation results
After validation, an enriched graph is
usually obtained
It contains valid nodes with their shapes
SHACL is constraint based
Shapes ≈ collections of constraints
Focus mainly on validation errors
Usually, no info about valid nodes
Difficult to distinguish valid nodes from nodes that
haven't been validated
Semantic specification
ShEx semantics is based on mathematical
concepts
It has been proven to be well-founded
Support for recursión and negation
Inspired by type systems and RelaxNG
SHACL semantics = SPARQL + textual description
SHACL terms described in natural language
SPARQL fragments used as helpers
Recursion is implementation dependent
SHACL-SPARQL is based on pre-binding
Syntactic differences
ShEx design focused on human-readability
Followed programming language design
methodology
1. Abstract syntax
2. Different concrete syntaxes
Compact
RDF
...
SHACL design focused on RDF vocabulary
Design centered on RDF terms
Lots of rules to define valid shapes graphs
https://w3c.github.io/data-shapes/shacl/#syntax-rules
Compact syntax added as a WG Note for a
subset of SHACL core
SHACL compact syntax copied from ShEx
Syntactically similar
Semantically different
Compact Syntax
ShEx compact syntax has been designed
along the language
Difficult to create bad shapes
Test-suite contains lots of tests
It is fully round-trippable with ShExJ and
ShExR
SHACL compact syntax was designed
after the language
It covers a subset of SHACL core
Incorrect shapes can be defined that pass the
grammar
One extra-step: After parsing and converting
to RDF, check production rules from RDF
shapes graph
:User {
minLength = :unknown .
maxLength = [ true 1 ] .
}
It parses the gramar but is rejected by production rules
Compact syntax: similar but different meanings
ShEx contains Boolean operators and
grammar based operators
Boolean: AND, OR, NOT
Grammar: grouping (;), alternative (|)
SHACL contains Boolean operators (and,
or, not, xone)
Only top-level expressions
. means conjunction
:Product {
:code IRI ;
:code xsd:integer
}
It means a product with 2 codes
(one IRI, and one integer)
It means the code of a product
must be an IRI and an integer
:p1 :code <http://code.org/P123> ;
:code 123 .  = conforms to Shape
= doesn't conform
:Product {
:code IRI .
:code xsd:integer
}
RDF vocabulary
ShEx vocabulary ≈ abstract syntax
ShEx RDF vocabulary obtained from the
abstract syntax
ShEx RDF serializations typically more verbose
They can be round-tripped to Compact syntax
SHACL is designed as an RDF vocabulary
Some rdf:type declarations can be omitted
SHACL RDF serialization typically more readable
:User a sx:Shape;
sx:expression [ a sx:EachOf ;
sx:expressions (
[ a sx:TripleConstraint ;
sx:predicate schema:name ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:datatype xsd:string ]
]
[ a sx:TripleConstraint ;
sx:predicate schema:birthDate ;
sx:valueExpr [ a sx:NodeConstraint ;
sx:datatype xsd:date ] ;
sx:min 0
] )
].
:User a sh:NodeShape ;
sh:property [ sh:path schema:name ;
sh:minCount 1; sh:maxCount 1;
sh:datatype xsd:string
];
sh:property [ sh:path schema:birthDate ;
sh:maxCount 1;
sh:datatype xsd:date
] .
Notion of Shape
In ShEx, shapes define only structure of
nodes
Selection of focus nodes - shapes is made
by a different mechanism: shapes map
In SHACL, shapes define structure and
can have target declarations
Shapes can be associated with nodes or sets of
nodes through target declarations
:User a sh:NodeShape, rdfs:Class ;
sh:targetClass :Person ;
sh:targetNode :alice ;
sh:nodeKind sh:IRI ;
sh:property [
sh:path schema:name ;
sh:datatype xsd:string
] .
:User IRI {
schema:name xsd:string
}
target
declarations
structure
Triggering validation
ShEx uses Shape maps
Shape maps are external to schemas
Separation of concerns between validation
language and triggering mechanism
Differing possibilities to build the shapes map
can be explored
SHACL uses target declarations
Associate shapes with node sets
Possibilities:
Direct node: targetNode
Instance of some class: targetClass
Subjects of some predicate: targetSubjectsOf
Objects of some predicate: targetSubjectsOf
Target declarations can be part of the
shapes graph
Default cardinalities
ShEx: default = (1,1)
:User {
schema:givenName xsd:string
schema:lastName xsd:string
}
:User a sh:NodeShape ;
sh:property [ sh:path schema:givenName ;
sh:datatype xsd:string ;
];
sh:property [ sh:path schema:lastName ;
sh:datatype xsd:string ;
] .
:alice schema:givenName "Alice" ;
schema:lastName "Cooper" .
:bob schema:givenName "Bob", "Robert" ;
schema:lastName "Smith", "Dylan" .
:carol schema:lastName "King" .
:dave schema:givenName 23;
schema:lastName :Unknown .
SHACL: default = (0,unbounded)
 




  = conforms to Shape
= doesn't conform
Property paths
ShEx shapes describe neighborhood of
focus nodes: direct/inverse properties
Examples with paths can be simulated by
nested shapes
Sometimes requiring auxiliary recursive shapes
SHACL shapes can also describe whole
property paths following SPARQL paths
:GrandSon a sh:NodeShape ;
sh:property [
sh:path (schema:parent schema:parent) ;
sh:minCount 1
];
sh:property [
sh:path [
sh:alternativePath (:father :mother) ]
];
sh:minCount 1
] ;
sh:property [
sh:path [sh:inversePath :knows ] ]
sh:node :Person ;
sh:minCount 1
]
.
:GrandSon {
:parent { :parent . + } + ;
(:father . | :mother .) + ;
^:knows :Person
}
Inference
ShEx doesn't interact with inference
Validation can be invoked before or after
inference
rdf:type is considered an arc as any other
No special meaning
The same for rdfs:Class, rdfs:subClassOf,
rdfs:domain, rdfs:range, ...
Some constructs have special meaning
The following constructs have special
meaning in SHACL
rdf:type
rdfs:Class
rdfs:subClassOf
owl:imports
Other constructs like rdfs:domain,
rdfs:range,... have no special meaning
sh:entailment can be used to indicate that
some inference is required
Inference and triggering mechanism
ShEx has no interaction with inference
It can be used to validate a reasoner
In SHACL, RDF Schema inference can affect
which nodes are validated
:User a sh:NodeShape, rdfs:Class ;
sh:property [ sh:path schema:name ;
sh:datatype xsd:string;
].

RDFS
inference
No RDFS
inference
:Teacher rdfs:subClassOf :User .
:teaches rdfs:domain :Teacher .
:alice a :Teacher ;
schema:name 23 .
:bob :teaches :Algebra ;
schema:name 34 .
:carol :teaches :Logic;
schema:name "King" .
Ignored
Ignored



With or without
RDFS inference
:User {
schema:name xsd:string
}



 = conforms to Shape
= doesn't conform
Some implicit RDFS inference but not all
Repeated properties
ShEx (;) operator handles repeated
properties
SHACL needs qualifiedValueShapes for
repeated properties
Direct approximation (wrong)::Person {
:parent {:gender [:Male ] } ;
:parent {:gender [:Female ] }
}
:Person a sh:NodeShape;
sh:property [ sh:path :parent;
sh:node [ sh:property [ sh:path :gender ;
sh:hasValue :Male ; ]] ;
];
sh:property [ sh:path :parent;
sh:node [ sh:property [ sh:path :gender ;
sh:hasValue :Female ]];
]
.
Exercise: Example. A person must have 2
parents, one male and another female
Repeated properties
ShEx (;) operator handles repeated
properties
SHACL needs qualifiedValueShapes for
repeated properties
Solution with qualifiedValueShapes::Person {
:parent {:gender [:Male ] } ;
:parent {:gender [:Female ] }
}
:Person a sh:NodeShape, rdfs:Class ;
sh:property [ sh:path :parent;
sh:qualifiedValueShape [ sh:property [ sh:path :gender ;
sh:hasValue :Male ] ] ;
sh:qualifiedMinCount 1; sh:qualifiedMaxCount 1
];
sh:property [ sh:path :parent;
sh:qualifiedValueShape [ sh:property [ sh:path :gender ;
sh:hasValue :Female ] ] ;
sh:qualifiedMinCount 1; sh:qualifiedMaxCount 1
] ;
sh:property [ sh:path :parent;
sh:minCount 2; sh:maxCount 2
]
.
Exercise: Example. A person must have 2 parents, one male and another female
It needs to count all
possibilities
Recursion
ShEx handles recursion
Well founded semantics
Recursive shapes are undefined in SHACL
Implementation dependent
Direct translation generates recursive shapes
:Person {
schema:name xsd:string ;
schema:knows @:Person*
}
:Person a sh:NodeShape ;
sh:property [ sh:path schema:name ;
sh:datatype xsd:string
];
sh:property [ sh:path schema:knows ;
sh:node :Person
]
.
Recursion (with target declarations)
ShEx handles recursion
Well founded semantics
Recursive shapes are undefined in SHACL
Implementation dependent
Can be simulated with target declarations
Example with target declatations
It needs discriminating arcs
:Person {
schema:name xsd:string ;
schema:knows @:Person*
}
:Person a sh:NodeShape, rdfs:Class ;
sh:property [ sh:path schema:name ;
sh:datatype xsd:string
];
sh:property [ sh:path schema:knows ;
sh:class :Person
]
. It requires all nodes to have rdf:type Person
Recursion (with property paths)
ShEx handles recursion
Well founded semantics
Recursive shapes are undefined in SHACL
Implementation dependent
Can be simulated property paths
:Person {
schema:name xsd:string ;
schema:knows @:Person*
}
:Person a sh:NodeShape ;
sh:property [
sh:path schema:name ; sh:datatype xsd:string ];
sh:property [
sh:path [sh:zeroOrMorePath schema:knows];
sh:node :PersonAux
].
:PersonAux a sh:NodeShape ;
sh:property [
sh:path schema:name ; sh:datatype xsd:string
].
:Person a sh:NodeShape ;
sh:targetNode :alice ;
sh:closed true ;
sh:or (
[ sh:path schema:name ; sh:datatype xsd:string ]
[ sh:path foaf:name ; sh:datatype xsd:string ]
) .
Closed shapes
In ShEx, closed affects all properties In SHACL, closed only affects properties
declared at top-level
Properties declared inside other shapes
are ignored
:Person CLOSED {
schema:name xsd:string
| foaf:name xsd:string
}
:alice schema:name "Alice" . 
 = conforms to Shape
= doesn't conform
Closed shapes and paths
Closed in ShEx acts on all properties In SHACL, closed ignores properties
mentioned inside paths
:Person a sh:NodeShape ;
sh:closed true ;
sh:property [
sh:path [
sh:alternativePath
( schema:name foaf:name )
] ;
sh:minCount 1; sh:maxCount 1;
sh:datatype xsd:string ] ;
.
:Person CLOSED {
schema:name xsd:string |
foaf:name xsd:string
}
:alice schema:name "Alice".   = conforms to Shape
= doesn't conform
Property pair constraints
This feature was posponed in ShEx 2.0
ShEx 2.1 is expected to add support for
value comparisons
SHACL supports equals, disjoint, lessThan, ...
:UserShape a sh:NodeShape ;
sh:property [
sh:path schema:givenName ;
sh:datatype xsd:string ;
sh:disjoint schema:lastName
] ;
sh:property [
sh:path foaf:firstName ;
sh:equals schema:givenName ;
] ;
sh:property [
sh:path schema:birthDate ;
sh:datatype xsd:date ;
sh:lessThan :loginDate
] .
:UserShape {
$<givenName> schema:givenName xsd:string ;
$<firstName> schema:firstName xsd:string ;
$<birthDate> schema:birthDate xsd:date ;
$<loginDate> :loginDate xsd:date ;
$<givenName> = $<firstName> ;
$<givenName> != $<lastName> ;
$<birthDate> < $<loginDate>
}
Uniqueness (defining unique Keys)
This feature was postponed in ShEx 2.0 No support for generic unique keys
sh:uniqueLang offers partial support for a
very common use case
Uniqueness can be done with SHACL-SPARQL:UserShape {
schema:givenName xsd:string ;
schema:lastName xsd:string ;
UNIQUE(schema:givenName, schema:lastName)
}
:Country a sh:NodeShape ;
sh:property [
sh:path schema:name ;
sh:uniqueLang true
] .
:Country {
schema:name . + ;
UNIQUE(LANGTAG(schema:name))
}
Modularity
ShEx has EXTERNAL keyword
EXTERNAL declares that a shape
definition should be retrieved
elsewhere
No mechanism to import/export
shapes/schemas
SHACL supports owl:imports
SHACL processors follow owl:imports
declarations
<> owl:imports <http://example.org/UserShapes>
:TeacherShape a sh:NodeShape;
sh:node :UserShape ;
sh:property [ sh:path :teaches ;
sh:minCount 1;
] ;
:UserShape a sh:NodeShape ;
sh:property [ sh:path schema:name ;
sh:datatype xsd:string
] .
http://example.org/UserShapes
Reusability - Extending shapes (1)
ShEx shapes can be extended by composition SHACL shapes can be extended by
composition and by leveraging subclasses
:Product a sh:NodeShape, rdfs:Class ;
sh:property [ sh:path schema:productId ;
sh:datatype xsd:string
];
sh:property [ sh:path schema:price ;
sh:datatype xsd:decimal
].
:SoldProduct a sh:NodeShape, rdfs:Class ;
sh:and (
:Product
[ sh:path schema:purchaseDate ;
sh:datatype xsd:date]
[ sh:path schema:productId ;
sh:pattern "^[A-Z]" ]
) .
Extending by composition
:Product {
schema:productId xsd:string
schema:price xsd:decimal
}
:SoldProduct @:Product AND {
schema:purchaseDate xsd:date ;
schema:productId /^[A-Z]/
}
Reusability - Extending shapes (2)
In ShEx, there is no special treatment for
rdfs:Class, rdfs:subClassOf, ...
By design, ShEx has no concept of Class
It is not possible to extend by declaring subClass
relationships
No interaction with inference engines
SHACL shapes can also be extended by
leveraging subclasses
:Product a sh:NodeShape, rdfs:Class ;
...as before...
:SoldProduct a sh:NodeShape, rdfs:Class ;
rdfs:subClassOf :Product ;
sh:property [ sh:path schema:productId ;
sh:pattern "^[A-Z]"
] ;
sh:property [ sh:path schema:purchaseDate ;
sh:datatype xsd:date
] .
Extending by leveraging subclasses
SHACL subclasses may differ from RDFS/OWL subclases
Annotations
ShEx allows annotations but doesn't
have built-in annotations
Annotations can be declared by //
SHACL allows any kind of annotations
and also has built-in annotations
Built-in properties: sh:name, sh:description,
sh:defaultValue, sh:order, sh:group
:Person {
// rdfs:label "Name"
// rdfs:comment "Name of person"
schema:name xsd:string ;
}
:Person a sh:NodeShape ;
sh:property [
sh:path schema:name ;
sh:datatype xsd:string ;
sh:name "Name" ;
sh:description "Name of person"
rdfs:label "Name";
] .
Apart of the built-in annotations,
SHACL can also use any other annotation
Validation report
ShEx 2.0 doesn't define a validation report
Work in progress
SHACL defines a validation report
Describes structure of errors
Some properties can be used to control
which information is shown
sh:message
sh:severity
Extension mechanism
ShEx uses semantic actions
Semantic actions allow any future
processor
They can be used also to transform RDF
SHACL has SHACL-SPARQL
SHACL-SPARQL allows new constraint
components defined in SPARQL
[See example in next slide]
It is possible to define constraint
components in other languages, e.g.
Javascript
Stems
ShEx can describe stems Stems are not built-in
:Employee {
:homePage [ <http://company.com/> ~ ]
}
:StemConstraintComponent
a sh:ConstraintComponent ;
sh:parameter [ sh:path :stem ] ;
sh:validator [ a sh:SPARQLAskValidator ;
sh:message "Value does not have stem {$stem}";
sh:ask """
ASK {
FILTER (!isBlank($value) &&
strstarts(str($value),str($stem)))
}"""
] . :Employee a sh:NodeShape ;
sh:targetClass :Employee ;
sh:property [
sh:path :homePage ;
:stem <http://company.com/>
] .
Stems are built into the language
Example:
The value of :homePage starts by
<http://company.com/>
Can be defined using SHACL-SParql
Further info
Further reading:
• SHACL WG wiki: https://www.w3.org/2014/data-shapes/wiki/SHACL-ShEx-Comparison
• Phd Thesis: Thomas Hartmann, Validation framework of RDF-based constraint
languages. 2016, https://publikationen.bibliothek.kit.edu/1000056458
End
This presentation is part of the set:
https://www.slideshare.net/jelabra/rdf-validation-tutorial

More Related Content

What's hot

What's hot (20)

JSON-LD and SHACL for Knowledge Graphs
JSON-LD and SHACL for Knowledge GraphsJSON-LD and SHACL for Knowledge Graphs
JSON-LD and SHACL for Knowledge Graphs
 
SPARQL Cheat Sheet
SPARQL Cheat SheetSPARQL Cheat Sheet
SPARQL Cheat Sheet
 
BLOGIC. (ISWC 2009 Invited Talk)
BLOGIC.  (ISWC 2009 Invited Talk)BLOGIC.  (ISWC 2009 Invited Talk)
BLOGIC. (ISWC 2009 Invited Talk)
 
An Introduction to SPARQL
An Introduction to SPARQLAn Introduction to SPARQL
An Introduction to SPARQL
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
SPARQL Tutorial
SPARQL TutorialSPARQL Tutorial
SPARQL Tutorial
 
JSON-LD and MongoDB
JSON-LD and MongoDBJSON-LD and MongoDB
JSON-LD and MongoDB
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
DBpedia InsideOut
DBpedia InsideOutDBpedia InsideOut
DBpedia InsideOut
 
RDF data model
RDF data modelRDF data model
RDF data model
 
SPARQL 사용법
SPARQL 사용법SPARQL 사용법
SPARQL 사용법
 
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
FAIR Workflows and Research Objects get a Workout
FAIR Workflows and Research Objects get a Workout FAIR Workflows and Research Objects get a Workout
FAIR Workflows and Research Objects get a Workout
 
Resource description framework
Resource description frameworkResource description framework
Resource description framework
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and Semantics
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
 
Building Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraBuilding Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and Hydra
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
 
Getting Started with Knowledge Graphs
Getting Started with Knowledge GraphsGetting Started with Knowledge Graphs
Getting Started with Knowledge Graphs
 

Similar to ShEx vs SHACL

KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016
Dr.-Ing. Thomas Hartmann
 
Find your way in Graph labyrinths
Find your way in Graph labyrinthsFind your way in Graph labyrinths
Find your way in Graph labyrinths
Daniel Camarda
 

Similar to ShEx vs SHACL (20)

Part04_SHACL By Example presentation.pptx
Part04_SHACL By Example presentation.pptxPart04_SHACL By Example presentation.pptx
Part04_SHACL By Example presentation.pptx
 
Presentation shexer
Presentation shexerPresentation shexer
Presentation shexer
 
SHACL Specification Draft
SHACL Specification DraftSHACL Specification Draft
SHACL Specification Draft
 
Optimizing SPARQL Queries with SHACL.pdf
Optimizing SPARQL Queries with SHACL.pdfOptimizing SPARQL Queries with SHACL.pdf
Optimizing SPARQL Queries with SHACL.pdf
 
SPARQL Query Containment with ShEx Constraints
SPARQL Query Containment with ShEx ConstraintsSPARQL Query Containment with ShEx Constraints
SPARQL Query Containment with ShEx Constraints
 
KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016
 
Towards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression DerivativesTowards an RDF Validation Language based on Regular Expression Derivatives
Towards an RDF Validation Language based on Regular Expression Derivatives
 
Validating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape ExpressionsValidating and Describing Linked Data Portals using RDF Shape Expressions
Validating and Describing Linked Data Portals using RDF Shape Expressions
 
2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...
2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...
2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...
 
Rdf data-model-and-storage
Rdf data-model-and-storageRdf data-model-and-storage
Rdf data-model-and-storage
 
2015.09. - The Role of Reasoning for RDF Validation (SEMANTiCS 2015)
2015.09. - The Role of Reasoning for RDF Validation (SEMANTiCS 2015)2015.09. - The Role of Reasoning for RDF Validation (SEMANTiCS 2015)
2015.09. - The Role of Reasoning for RDF Validation (SEMANTiCS 2015)
 
Design patterns through refactoring
Design patterns through refactoringDesign patterns through refactoring
Design patterns through refactoring
 
Semantic web Technology
Semantic web TechnologySemantic web Technology
Semantic web Technology
 
Semantic web
Semantic webSemantic web
Semantic web
 
EC-WEB: Validator and Preview for the JobPosting Data Model of Schema.org
EC-WEB: Validator and Preview for the JobPosting Data Model of Schema.orgEC-WEB: Validator and Preview for the JobPosting Data Model of Schema.org
EC-WEB: Validator and Preview for the JobPosting Data Model of Schema.org
 
Challenges and applications of RDF shapes
Challenges and applications of RDF shapesChallenges and applications of RDF shapes
Challenges and applications of RDF shapes
 
Find your way in Graph labyrinths
Find your way in Graph labyrinthsFind your way in Graph labyrinths
Find your way in Graph labyrinths
 
SHACL shortly (ELAG 2018)
SHACL shortly (ELAG 2018)SHACL shortly (ELAG 2018)
SHACL shortly (ELAG 2018)
 
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)
 
JSON-LD Update
JSON-LD UpdateJSON-LD Update
JSON-LD Update
 

More from Jose Emilio Labra Gayo

More from Jose Emilio Labra Gayo (20)

Publicaciones de investigación
Publicaciones de investigaciónPublicaciones de investigación
Publicaciones de investigación
 
Introducción a la investigación/doctorado
Introducción a la investigación/doctoradoIntroducción a la investigación/doctorado
Introducción a la investigación/doctorado
 
Legislative data portals and linked data quality
Legislative data portals and linked data qualityLegislative data portals and linked data quality
Legislative data portals and linked data quality
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
 
Wikidata
WikidataWikidata
Wikidata
 
Legislative document content extraction based on Semantic Web technologies
Legislative document content extraction based on Semantic Web technologiesLegislative document content extraction based on Semantic Web technologies
Legislative document content extraction based on Semantic Web technologies
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Introducción a la Web Semántica
Introducción a la Web SemánticaIntroducción a la Web Semántica
Introducción a la Web Semántica
 
2017 Tendencias en informática
2017 Tendencias en informática2017 Tendencias en informática
2017 Tendencias en informática
 
19 javascript servidor
19 javascript servidor19 javascript servidor
19 javascript servidor
 
Como publicar datos: hacia los datos abiertos enlazados
Como publicar datos: hacia los datos abiertos enlazadosComo publicar datos: hacia los datos abiertos enlazados
Como publicar datos: hacia los datos abiertos enlazados
 
16 Alternativas XML
16 Alternativas XML16 Alternativas XML
16 Alternativas XML
 
XSLT
XSLTXSLT
XSLT
 
XPath
XPathXPath
XPath
 
Arquitectura de la Web y Computación en el Servidor
Arquitectura de la Web y Computación en el ServidorArquitectura de la Web y Computación en el Servidor
Arquitectura de la Web y Computación en el Servidor
 
RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applications
 
Máster en Ingeniería Web
Máster en Ingeniería WebMáster en Ingeniería Web
Máster en Ingeniería Web
 
2016 temuco tecnologias_websemantica
2016 temuco tecnologias_websemantica2016 temuco tecnologias_websemantica
2016 temuco tecnologias_websemantica
 
2015 bogota datos_enlazados
2015 bogota datos_enlazados2015 bogota datos_enlazados
2015 bogota datos_enlazados
 
17 computacion servidor
17 computacion servidor17 computacion servidor
17 computacion servidor
 

Recently uploaded

Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
Kamal Acharya
 
grop material handling.pdf and resarch ethics tth
grop material handling.pdf and resarch ethics tthgrop material handling.pdf and resarch ethics tth
grop material handling.pdf and resarch ethics tth
AmanyaSylus
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
Kamal Acharya
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
Kamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 

Recently uploaded (20)

Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 
grop material handling.pdf and resarch ethics tth
grop material handling.pdf and resarch ethics tthgrop material handling.pdf and resarch ethics tth
grop material handling.pdf and resarch ethics tth
 
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
NO1 Pandit Black Magic Removal in Uk kala jadu Specialist kala jadu for Love ...
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Online blood donation management system project.pdf
Online blood donation management system project.pdfOnline blood donation management system project.pdf
Online blood donation management system project.pdf
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data StreamKIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
KIT-601 Lecture Notes-UNIT-3.pdf Mining Data Stream
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Furniture showroom management system project.pdf
Furniture showroom management system project.pdfFurniture showroom management system project.pdf
Furniture showroom management system project.pdf
 

ShEx vs SHACL

  • 1. ShEx & SHACL compared RDF Validation tutorial Eric Prud'hommeaux World Wide Web Consortium MIT, Cambridge, MA, USA Harold Solbrig Mayo Clinic, USA Jose Emilio Labra Gayo WESO Research group University of Oviedo, Spain Iovka Boneva LINKS, INRIA & CNRS University of Lille, France
  • 2. Common features Similar goal: describe and validate RDF graphs Both employ the word "shape" Node constraints similar in both languages Constraints on incoming/outgoing arcs Cardinalities RDF syntax Extension mechanism
  • 3. Some differences Underlying philosophy Syntactic differences Notion of a shape Syntactic differences Default cardinalities Shapes and Classes Recursion Repeated properties Property pair constraints Uniqueness Extension mechanism
  • 4. Underlying philosophy ShEx is schema based Shapes schemas look like RDF grammars More focus on validation results After validation, an enriched graph is usually obtained It contains valid nodes with their shapes SHACL is constraint based Shapes ≈ collections of constraints Focus mainly on validation errors Usually, no info about valid nodes Difficult to distinguish valid nodes from nodes that haven't been validated
  • 5. Semantic specification ShEx semantics is based on mathematical concepts It has been proven to be well-founded Support for recursión and negation Inspired by type systems and RelaxNG SHACL semantics = SPARQL + textual description SHACL terms described in natural language SPARQL fragments used as helpers Recursion is implementation dependent SHACL-SPARQL is based on pre-binding
  • 6. Syntactic differences ShEx design focused on human-readability Followed programming language design methodology 1. Abstract syntax 2. Different concrete syntaxes Compact RDF ... SHACL design focused on RDF vocabulary Design centered on RDF terms Lots of rules to define valid shapes graphs https://w3c.github.io/data-shapes/shacl/#syntax-rules Compact syntax added as a WG Note for a subset of SHACL core SHACL compact syntax copied from ShEx Syntactically similar Semantically different
  • 7. Compact Syntax ShEx compact syntax has been designed along the language Difficult to create bad shapes Test-suite contains lots of tests It is fully round-trippable with ShExJ and ShExR SHACL compact syntax was designed after the language It covers a subset of SHACL core Incorrect shapes can be defined that pass the grammar One extra-step: After parsing and converting to RDF, check production rules from RDF shapes graph :User { minLength = :unknown . maxLength = [ true 1 ] . } It parses the gramar but is rejected by production rules
  • 8. Compact syntax: similar but different meanings ShEx contains Boolean operators and grammar based operators Boolean: AND, OR, NOT Grammar: grouping (;), alternative (|) SHACL contains Boolean operators (and, or, not, xone) Only top-level expressions . means conjunction :Product { :code IRI ; :code xsd:integer } It means a product with 2 codes (one IRI, and one integer) It means the code of a product must be an IRI and an integer :p1 :code <http://code.org/P123> ; :code 123 .  = conforms to Shape = doesn't conform :Product { :code IRI . :code xsd:integer }
  • 9. RDF vocabulary ShEx vocabulary ≈ abstract syntax ShEx RDF vocabulary obtained from the abstract syntax ShEx RDF serializations typically more verbose They can be round-tripped to Compact syntax SHACL is designed as an RDF vocabulary Some rdf:type declarations can be omitted SHACL RDF serialization typically more readable :User a sx:Shape; sx:expression [ a sx:EachOf ; sx:expressions ( [ a sx:TripleConstraint ; sx:predicate schema:name ; sx:valueExpr [ a sx:NodeConstraint ; sx:datatype xsd:string ] ] [ a sx:TripleConstraint ; sx:predicate schema:birthDate ; sx:valueExpr [ a sx:NodeConstraint ; sx:datatype xsd:date ] ; sx:min 0 ] ) ]. :User a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:minCount 1; sh:maxCount 1; sh:datatype xsd:string ]; sh:property [ sh:path schema:birthDate ; sh:maxCount 1; sh:datatype xsd:date ] .
  • 10. Notion of Shape In ShEx, shapes define only structure of nodes Selection of focus nodes - shapes is made by a different mechanism: shapes map In SHACL, shapes define structure and can have target declarations Shapes can be associated with nodes or sets of nodes through target declarations :User a sh:NodeShape, rdfs:Class ; sh:targetClass :Person ; sh:targetNode :alice ; sh:nodeKind sh:IRI ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ] . :User IRI { schema:name xsd:string } target declarations structure
  • 11. Triggering validation ShEx uses Shape maps Shape maps are external to schemas Separation of concerns between validation language and triggering mechanism Differing possibilities to build the shapes map can be explored SHACL uses target declarations Associate shapes with node sets Possibilities: Direct node: targetNode Instance of some class: targetClass Subjects of some predicate: targetSubjectsOf Objects of some predicate: targetSubjectsOf Target declarations can be part of the shapes graph
  • 12. Default cardinalities ShEx: default = (1,1) :User { schema:givenName xsd:string schema:lastName xsd:string } :User a sh:NodeShape ; sh:property [ sh:path schema:givenName ; sh:datatype xsd:string ; ]; sh:property [ sh:path schema:lastName ; sh:datatype xsd:string ; ] . :alice schema:givenName "Alice" ; schema:lastName "Cooper" . :bob schema:givenName "Bob", "Robert" ; schema:lastName "Smith", "Dylan" . :carol schema:lastName "King" . :dave schema:givenName 23; schema:lastName :Unknown . SHACL: default = (0,unbounded)         = conforms to Shape = doesn't conform
  • 13. Property paths ShEx shapes describe neighborhood of focus nodes: direct/inverse properties Examples with paths can be simulated by nested shapes Sometimes requiring auxiliary recursive shapes SHACL shapes can also describe whole property paths following SPARQL paths :GrandSon a sh:NodeShape ; sh:property [ sh:path (schema:parent schema:parent) ; sh:minCount 1 ]; sh:property [ sh:path [ sh:alternativePath (:father :mother) ] ]; sh:minCount 1 ] ; sh:property [ sh:path [sh:inversePath :knows ] ] sh:node :Person ; sh:minCount 1 ] . :GrandSon { :parent { :parent . + } + ; (:father . | :mother .) + ; ^:knows :Person }
  • 14. Inference ShEx doesn't interact with inference Validation can be invoked before or after inference rdf:type is considered an arc as any other No special meaning The same for rdfs:Class, rdfs:subClassOf, rdfs:domain, rdfs:range, ... Some constructs have special meaning The following constructs have special meaning in SHACL rdf:type rdfs:Class rdfs:subClassOf owl:imports Other constructs like rdfs:domain, rdfs:range,... have no special meaning sh:entailment can be used to indicate that some inference is required
  • 15. Inference and triggering mechanism ShEx has no interaction with inference It can be used to validate a reasoner In SHACL, RDF Schema inference can affect which nodes are validated :User a sh:NodeShape, rdfs:Class ; sh:property [ sh:path schema:name ; sh:datatype xsd:string; ].  RDFS inference No RDFS inference :Teacher rdfs:subClassOf :User . :teaches rdfs:domain :Teacher . :alice a :Teacher ; schema:name 23 . :bob :teaches :Algebra ; schema:name 34 . :carol :teaches :Logic; schema:name "King" . Ignored Ignored    With or without RDFS inference :User { schema:name xsd:string }     = conforms to Shape = doesn't conform Some implicit RDFS inference but not all
  • 16. Repeated properties ShEx (;) operator handles repeated properties SHACL needs qualifiedValueShapes for repeated properties Direct approximation (wrong)::Person { :parent {:gender [:Male ] } ; :parent {:gender [:Female ] } } :Person a sh:NodeShape; sh:property [ sh:path :parent; sh:node [ sh:property [ sh:path :gender ; sh:hasValue :Male ; ]] ; ]; sh:property [ sh:path :parent; sh:node [ sh:property [ sh:path :gender ; sh:hasValue :Female ]]; ] . Exercise: Example. A person must have 2 parents, one male and another female
  • 17. Repeated properties ShEx (;) operator handles repeated properties SHACL needs qualifiedValueShapes for repeated properties Solution with qualifiedValueShapes::Person { :parent {:gender [:Male ] } ; :parent {:gender [:Female ] } } :Person a sh:NodeShape, rdfs:Class ; sh:property [ sh:path :parent; sh:qualifiedValueShape [ sh:property [ sh:path :gender ; sh:hasValue :Male ] ] ; sh:qualifiedMinCount 1; sh:qualifiedMaxCount 1 ]; sh:property [ sh:path :parent; sh:qualifiedValueShape [ sh:property [ sh:path :gender ; sh:hasValue :Female ] ] ; sh:qualifiedMinCount 1; sh:qualifiedMaxCount 1 ] ; sh:property [ sh:path :parent; sh:minCount 2; sh:maxCount 2 ] . Exercise: Example. A person must have 2 parents, one male and another female It needs to count all possibilities
  • 18. Recursion ShEx handles recursion Well founded semantics Recursive shapes are undefined in SHACL Implementation dependent Direct translation generates recursive shapes :Person { schema:name xsd:string ; schema:knows @:Person* } :Person a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ]; sh:property [ sh:path schema:knows ; sh:node :Person ] .
  • 19. Recursion (with target declarations) ShEx handles recursion Well founded semantics Recursive shapes are undefined in SHACL Implementation dependent Can be simulated with target declarations Example with target declatations It needs discriminating arcs :Person { schema:name xsd:string ; schema:knows @:Person* } :Person a sh:NodeShape, rdfs:Class ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ]; sh:property [ sh:path schema:knows ; sh:class :Person ] . It requires all nodes to have rdf:type Person
  • 20. Recursion (with property paths) ShEx handles recursion Well founded semantics Recursive shapes are undefined in SHACL Implementation dependent Can be simulated property paths :Person { schema:name xsd:string ; schema:knows @:Person* } :Person a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ]; sh:property [ sh:path [sh:zeroOrMorePath schema:knows]; sh:node :PersonAux ]. :PersonAux a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ].
  • 21. :Person a sh:NodeShape ; sh:targetNode :alice ; sh:closed true ; sh:or ( [ sh:path schema:name ; sh:datatype xsd:string ] [ sh:path foaf:name ; sh:datatype xsd:string ] ) . Closed shapes In ShEx, closed affects all properties In SHACL, closed only affects properties declared at top-level Properties declared inside other shapes are ignored :Person CLOSED { schema:name xsd:string | foaf:name xsd:string } :alice schema:name "Alice" .   = conforms to Shape = doesn't conform
  • 22. Closed shapes and paths Closed in ShEx acts on all properties In SHACL, closed ignores properties mentioned inside paths :Person a sh:NodeShape ; sh:closed true ; sh:property [ sh:path [ sh:alternativePath ( schema:name foaf:name ) ] ; sh:minCount 1; sh:maxCount 1; sh:datatype xsd:string ] ; . :Person CLOSED { schema:name xsd:string | foaf:name xsd:string } :alice schema:name "Alice".   = conforms to Shape = doesn't conform
  • 23. Property pair constraints This feature was posponed in ShEx 2.0 ShEx 2.1 is expected to add support for value comparisons SHACL supports equals, disjoint, lessThan, ... :UserShape a sh:NodeShape ; sh:property [ sh:path schema:givenName ; sh:datatype xsd:string ; sh:disjoint schema:lastName ] ; sh:property [ sh:path foaf:firstName ; sh:equals schema:givenName ; ] ; sh:property [ sh:path schema:birthDate ; sh:datatype xsd:date ; sh:lessThan :loginDate ] . :UserShape { $<givenName> schema:givenName xsd:string ; $<firstName> schema:firstName xsd:string ; $<birthDate> schema:birthDate xsd:date ; $<loginDate> :loginDate xsd:date ; $<givenName> = $<firstName> ; $<givenName> != $<lastName> ; $<birthDate> < $<loginDate> }
  • 24. Uniqueness (defining unique Keys) This feature was postponed in ShEx 2.0 No support for generic unique keys sh:uniqueLang offers partial support for a very common use case Uniqueness can be done with SHACL-SPARQL:UserShape { schema:givenName xsd:string ; schema:lastName xsd:string ; UNIQUE(schema:givenName, schema:lastName) } :Country a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:uniqueLang true ] . :Country { schema:name . + ; UNIQUE(LANGTAG(schema:name)) }
  • 25. Modularity ShEx has EXTERNAL keyword EXTERNAL declares that a shape definition should be retrieved elsewhere No mechanism to import/export shapes/schemas SHACL supports owl:imports SHACL processors follow owl:imports declarations <> owl:imports <http://example.org/UserShapes> :TeacherShape a sh:NodeShape; sh:node :UserShape ; sh:property [ sh:path :teaches ; sh:minCount 1; ] ; :UserShape a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ] . http://example.org/UserShapes
  • 26. Reusability - Extending shapes (1) ShEx shapes can be extended by composition SHACL shapes can be extended by composition and by leveraging subclasses :Product a sh:NodeShape, rdfs:Class ; sh:property [ sh:path schema:productId ; sh:datatype xsd:string ]; sh:property [ sh:path schema:price ; sh:datatype xsd:decimal ]. :SoldProduct a sh:NodeShape, rdfs:Class ; sh:and ( :Product [ sh:path schema:purchaseDate ; sh:datatype xsd:date] [ sh:path schema:productId ; sh:pattern "^[A-Z]" ] ) . Extending by composition :Product { schema:productId xsd:string schema:price xsd:decimal } :SoldProduct @:Product AND { schema:purchaseDate xsd:date ; schema:productId /^[A-Z]/ }
  • 27. Reusability - Extending shapes (2) In ShEx, there is no special treatment for rdfs:Class, rdfs:subClassOf, ... By design, ShEx has no concept of Class It is not possible to extend by declaring subClass relationships No interaction with inference engines SHACL shapes can also be extended by leveraging subclasses :Product a sh:NodeShape, rdfs:Class ; ...as before... :SoldProduct a sh:NodeShape, rdfs:Class ; rdfs:subClassOf :Product ; sh:property [ sh:path schema:productId ; sh:pattern "^[A-Z]" ] ; sh:property [ sh:path schema:purchaseDate ; sh:datatype xsd:date ] . Extending by leveraging subclasses SHACL subclasses may differ from RDFS/OWL subclases
  • 28. Annotations ShEx allows annotations but doesn't have built-in annotations Annotations can be declared by // SHACL allows any kind of annotations and also has built-in annotations Built-in properties: sh:name, sh:description, sh:defaultValue, sh:order, sh:group :Person { // rdfs:label "Name" // rdfs:comment "Name of person" schema:name xsd:string ; } :Person a sh:NodeShape ; sh:property [ sh:path schema:name ; sh:datatype xsd:string ; sh:name "Name" ; sh:description "Name of person" rdfs:label "Name"; ] . Apart of the built-in annotations, SHACL can also use any other annotation
  • 29. Validation report ShEx 2.0 doesn't define a validation report Work in progress SHACL defines a validation report Describes structure of errors Some properties can be used to control which information is shown sh:message sh:severity
  • 30. Extension mechanism ShEx uses semantic actions Semantic actions allow any future processor They can be used also to transform RDF SHACL has SHACL-SPARQL SHACL-SPARQL allows new constraint components defined in SPARQL [See example in next slide] It is possible to define constraint components in other languages, e.g. Javascript
  • 31. Stems ShEx can describe stems Stems are not built-in :Employee { :homePage [ <http://company.com/> ~ ] } :StemConstraintComponent a sh:ConstraintComponent ; sh:parameter [ sh:path :stem ] ; sh:validator [ a sh:SPARQLAskValidator ; sh:message "Value does not have stem {$stem}"; sh:ask """ ASK { FILTER (!isBlank($value) && strstarts(str($value),str($stem))) }""" ] . :Employee a sh:NodeShape ; sh:targetClass :Employee ; sh:property [ sh:path :homePage ; :stem <http://company.com/> ] . Stems are built into the language Example: The value of :homePage starts by <http://company.com/> Can be defined using SHACL-SParql
  • 32. Further info Further reading: • SHACL WG wiki: https://www.w3.org/2014/data-shapes/wiki/SHACL-ShEx-Comparison • Phd Thesis: Thomas Hartmann, Validation framework of RDF-based constraint languages. 2016, https://publikationen.bibliothek.kit.edu/1000056458
  • 33. End This presentation is part of the set: https://www.slideshare.net/jelabra/rdf-validation-tutorial