SlideShare une entreprise Scribd logo
1  sur  20
RDF Validation tutorial
ShEx/SHACL by example
Eric Prud'hommeaux
World Wide Web, USA
Harold Solbrig
Mayo Clinic, USA
Jose Emilio Labra Gayo
WESO Research group
Spain
Iovka Boneva
LINKS, INRIA & CNRS, France
Contents
Overview of RDF data model
Motivation for RDF Validation and previous approaches
ShEx by example
SHACL by example
ShEx vs SHACL
RDF Data Model
Overview of RDF Data Model and simple exercise
Link to slides about
RDF Data Model
http://www.slideshare.net/jelabra/rdf-data-model
RDF, the good parts...
RDF as an integration language
RDF as a lingua franca for semantic web and linked data
RDF data stores & SPARQL
RDF flexibility
Data can be adapted to multiple environments
Open and reusable data by default
RDF, the other parts
Inference & knowledge representation
RDF should combine well with KR vocabularies (RDF Schema, OWL...)
Performance of RDF based systems with inference = challenging
Consuming & producing RDF
Multiple serializations: Turtle, RDF/XML, JSON-LD, ...
Embedding RDF in HTML
Describing and validating RDF content
Why describe & validate RDF?
For RDF producers
Developers can understand the contents they are going to produce
They can ensure they produce the expected structure
Advertise the structure
Generate interfaces
For RDF consumers
Understand the contents
Verify the structure before processing it
Query generation & optimization
Similar technologies
Technology Schema
Relational Databases DDL
XML DTD, XML Schema, RelaxNG
Json Json Schema
RDF ?
Our goal is to fill that gap
Understanding the problem
RDF is composed by nodes and arcs between nodes
We can describe/check
form of the node itself (node constraint)
number of possible arcs incoming/outgoing from a node
possible values associated with those arcs
:alice schema:name "Alice";
schema:knows :bob .
IRI schema:name string (1, 1) ;
schema:knows IRI (0, *)
RDF Node
Shape of RDF
Nodes that
represent Users
<User> IRI {
schema:name xsd:string ;
schema:knows IRI *
}
ShEx
Understanding the problem
RDF validation ≠ ontology definition ≠ instance data
Ontologies are usually focused on real world entities
RDF validation is focused on RDF graph features (lower level)
Ontology
Constraints
RDF Validation
Instance data
Different levels
:alice schema:name "Alice";
schema:knows :bob .
<User> IRI {
schema:name xsd:string ;
schema:knows IRI
}
schema:knows a owl:ObjectProperty ;
rdfs:domain schema:Person ;
rdfs:range schema:Person .
A user must have only two properties:
schema:name of value xsd:string
schema:knows with an IRI value
Understanding the problem
Shapes ≠ types
Nodes in RDF graphs can have zero, one or many rdf:type arcs
One type can be used for multiple purposes (foaf:Person)
Data doesn't need to be annotated with fully discriminating types
foaf:Person can represent friend, invitee, patient,...
Different meanings and different structure depending on the context
We should be able to define specific validation constraints in different contexts
Understanding the problem
RDF flexibility
Mixed use of objects & literals
schema:creator can be a string or schema:Person in the same data
:angie schema:creator "Keith Richards" ,
[ a schema:Person ;
schema:singleName "Mick" ;
schema:lastName "Jagger"
] .
See other examples from http://schema.org
Understanding the problem
Repeated properties
Sometimes, the same property is used for different purposes in the
same data
Example: A book record must have 2 codes with different structure
:book schema:productID "isbn:123-456-789";
schema:productID "code456" .
A practical example from FHIR
See: http://hl7-fhir.github.io/observation-example-bloodpressure.ttl.html
Previous RDF validation approaches
SPARQL based
Plain SPARQL
SPIN: http://spinrdf.org/
OWL based
Stardog ICV
http://docs.stardog.com/icv/icv-specification.html
Grammar based
OSLC Resource Shapes
https://www.w3.org/Submission/2014/SUBM-shapes-20140211/
Use SPARQL queries to detect errors
Pros:
Expressive
Ubiquitous
Cons
Expressive
Idiomatic - many ways to encode
the same constraint
ASK {{ SELECT ?Person {
?Person schema:name ?o .
} GROUP BY ?Person HAVING (COUNT(*)=1)
}
{ SELECT ?Person {
?Person schema:name ?o .
FILTER ( isLiteral(?o) &&
datatype(?o) = xsd:string )
} GROUP BY ?Person HAVING (COUNT(*)=1)
}
{ SELECT ?Person (COUNT(*) AS ?c1) {
?Person schema:gender ?o .
} GROUP BY ?Person HAVING (COUNT(*)=1)}
{ SELECT ?Person (COUNT(*) AS ?c2) {
?S schema:gender ?o .
FILTER ((?o = schema:Female ||
?o = schema:Male))
} GROUP BY ?Person HAVING (COUNT(*)=1)}
FILTER (?c1 = ?c2)
}
Example:
schema:name must be a xsd:string
schema:gender must be schema:Male or schema:Female
SPIN
SPARQL inferencing notation http://spinrdf.org/
Developed by TopQuadrant
Commercial product
Vocabulary associated with user-defined functions in SPARQL
SPIN has influenced SHACL (see later)
Stardog ICV
ICV - Integrity Constraint Validation
Commercial product
OWL with unique name assumption and closed world
Compiled to SPARQL
More info: http://docs.stardog.com/icv/icv-specification.html
OSLC Resource Shapes
OSLC Resource Shapes
https://www.w3.org/Submission/shapes/
Grammar based approach
Language for RDF validation
Less expressive than ShEx
:user a rs:ResourceShape ;
rs:property [
rs:name "name" ;
rs:propertyDefinition schema:name ;
rs:valueType xsd:string ;
rs:occurs rs:Exactly-one ;
] ;
rs:property [
rs:name "gender" ;
rs:propertyDefinition schema:gender ;
rs:allowedValue schema:Male, schema:Female ;
rs:occurs rs:Zero-or-one ;
].
Other approaches
Dublin Core Application profiles (K. Coyle, T. Baker)
http://dublincore.org/documents/dc-dsp/
RDF Data Descriptions (Fischer et al)
http://ceur-ws.org/Vol-1330/paper-33.pdf
RDFUnit (D. Kontokostas)
http://aksw.org/Projects/RDFUnit.html
...
ShEx and SHACL
2013 RDF Validation Workshop
Conclusions of the workshop:
There is a need of a higher level, concise language for RDF Validation
ShEx initially proposed by Eric Prud'hommeaux
2014 W3c Data Shapes WG chartered
2015 SHACL as a deliverable from the WG
Continue this tutorial with...
ShEx by example
SHACL by example
ShEx vs SHACL
Future work and
applications
http://www.slideshare.net/jelabra/shex-by-example
http://www.slideshare.net/jelabra/shacl-by-example
http://www.slideshare.net/jelabra/shex-vs-shacl
http://www.slideshare.net/jelabra/rdf-validation-future-work-and-applications

Contenu connexe

Tendances

Tendances (20)

Building a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and OntologiesBuilding a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and Ontologies
 
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODOLinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
 
ESWC 2017 Tutorial Knowledge Graphs
ESWC 2017 Tutorial Knowledge GraphsESWC 2017 Tutorial Knowledge Graphs
ESWC 2017 Tutorial Knowledge Graphs
 
An Introduction to SPARQL
An Introduction to SPARQLAn Introduction to SPARQL
An Introduction to SPARQL
 
ShEx vs SHACL
ShEx vs SHACLShEx vs SHACL
ShEx vs SHACL
 
SHACL Overview
SHACL OverviewSHACL Overview
SHACL Overview
 
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)
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
 
SPARQL Cheat Sheet
SPARQL Cheat SheetSPARQL Cheat Sheet
SPARQL Cheat Sheet
 
SPARQL in a nutshell
SPARQL in a nutshellSPARQL in a nutshell
SPARQL in a nutshell
 
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 ...
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
 
Introduction to linked data
Introduction to linked dataIntroduction to linked data
Introduction to linked data
 
LOD (linked open data) part 2 lod 구축과 현황
LOD (linked open data) part 2   lod 구축과 현황LOD (linked open data) part 2   lod 구축과 현황
LOD (linked open data) part 2 lod 구축과 현황
 
Introduction to RDF
Introduction to RDFIntroduction to RDF
Introduction to RDF
 
New Concepts: Nomens and Appellations
New Concepts: Nomens and AppellationsNew Concepts: Nomens and Appellations
New Concepts: Nomens and Appellations
 
Property graph vs. RDF Triplestore comparison in 2020
Property graph vs. RDF Triplestore comparison in 2020Property graph vs. RDF Triplestore comparison in 2020
Property graph vs. RDF Triplestore comparison in 2020
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
Linked Data의 RDF 어휘 이해하고 체험하기 - FOAF, SIOC, SKOS를 중심으로 -
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
 

Similaire à RDF validation tutorial

KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016
Dr.-Ing. Thomas Hartmann
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
Lino Valdivia
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n Bolts
Rinke Hoekstra
 

Similaire à RDF validation tutorial (20)

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
 
A year on the Semantic Web @ W3C
A year on the Semantic Web @ W3CA year on the Semantic Web @ W3C
A year on the Semantic Web @ W3C
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
SWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDFSWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDF
 
Rdf data-model-and-storage
Rdf data-model-and-storageRdf data-model-and-storage
Rdf data-model-and-storage
 
HyperGraphQL
HyperGraphQLHyperGraphQL
HyperGraphQL
 
Challenges and applications of RDF shapes
Challenges and applications of RDF shapesChallenges and applications of RDF shapes
Challenges and applications of RDF shapes
 
Sparql service-description
Sparql service-descriptionSparql service-description
Sparql service-description
 
KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016KIT Graduiertenkolloquium 11.05.2016
KIT Graduiertenkolloquium 11.05.2016
 
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioDo it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
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...
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
Introduction to Application Profiles
Introduction to Application ProfilesIntroduction to Application Profiles
Introduction to Application Profiles
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
 
CSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web TutorialCSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web Tutorial
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n Bolts
 
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)
 
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
 

Plus de Jose Emilio Labra Gayo

Plus de 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
 
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
 
Tecnologias Web Semantica
Tecnologias Web SemanticaTecnologias Web Semantica
Tecnologias Web Semantica
 

Dernier

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Dernier (20)

UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 

RDF validation tutorial

  • 1. RDF Validation tutorial ShEx/SHACL by example Eric Prud'hommeaux World Wide Web, USA Harold Solbrig Mayo Clinic, USA Jose Emilio Labra Gayo WESO Research group Spain Iovka Boneva LINKS, INRIA & CNRS, France
  • 2. Contents Overview of RDF data model Motivation for RDF Validation and previous approaches ShEx by example SHACL by example ShEx vs SHACL
  • 3. RDF Data Model Overview of RDF Data Model and simple exercise Link to slides about RDF Data Model http://www.slideshare.net/jelabra/rdf-data-model
  • 4. RDF, the good parts... RDF as an integration language RDF as a lingua franca for semantic web and linked data RDF data stores & SPARQL RDF flexibility Data can be adapted to multiple environments Open and reusable data by default
  • 5. RDF, the other parts Inference & knowledge representation RDF should combine well with KR vocabularies (RDF Schema, OWL...) Performance of RDF based systems with inference = challenging Consuming & producing RDF Multiple serializations: Turtle, RDF/XML, JSON-LD, ... Embedding RDF in HTML Describing and validating RDF content
  • 6. Why describe & validate RDF? For RDF producers Developers can understand the contents they are going to produce They can ensure they produce the expected structure Advertise the structure Generate interfaces For RDF consumers Understand the contents Verify the structure before processing it Query generation & optimization
  • 7. Similar technologies Technology Schema Relational Databases DDL XML DTD, XML Schema, RelaxNG Json Json Schema RDF ? Our goal is to fill that gap
  • 8. Understanding the problem RDF is composed by nodes and arcs between nodes We can describe/check form of the node itself (node constraint) number of possible arcs incoming/outgoing from a node possible values associated with those arcs :alice schema:name "Alice"; schema:knows :bob . IRI schema:name string (1, 1) ; schema:knows IRI (0, *) RDF Node Shape of RDF Nodes that represent Users <User> IRI { schema:name xsd:string ; schema:knows IRI * } ShEx
  • 9. Understanding the problem RDF validation ≠ ontology definition ≠ instance data Ontologies are usually focused on real world entities RDF validation is focused on RDF graph features (lower level) Ontology Constraints RDF Validation Instance data Different levels :alice schema:name "Alice"; schema:knows :bob . <User> IRI { schema:name xsd:string ; schema:knows IRI } schema:knows a owl:ObjectProperty ; rdfs:domain schema:Person ; rdfs:range schema:Person . A user must have only two properties: schema:name of value xsd:string schema:knows with an IRI value
  • 10. Understanding the problem Shapes ≠ types Nodes in RDF graphs can have zero, one or many rdf:type arcs One type can be used for multiple purposes (foaf:Person) Data doesn't need to be annotated with fully discriminating types foaf:Person can represent friend, invitee, patient,... Different meanings and different structure depending on the context We should be able to define specific validation constraints in different contexts
  • 11. Understanding the problem RDF flexibility Mixed use of objects & literals schema:creator can be a string or schema:Person in the same data :angie schema:creator "Keith Richards" , [ a schema:Person ; schema:singleName "Mick" ; schema:lastName "Jagger" ] . See other examples from http://schema.org
  • 12. Understanding the problem Repeated properties Sometimes, the same property is used for different purposes in the same data Example: A book record must have 2 codes with different structure :book schema:productID "isbn:123-456-789"; schema:productID "code456" . A practical example from FHIR See: http://hl7-fhir.github.io/observation-example-bloodpressure.ttl.html
  • 13. Previous RDF validation approaches SPARQL based Plain SPARQL SPIN: http://spinrdf.org/ OWL based Stardog ICV http://docs.stardog.com/icv/icv-specification.html Grammar based OSLC Resource Shapes https://www.w3.org/Submission/2014/SUBM-shapes-20140211/
  • 14. Use SPARQL queries to detect errors Pros: Expressive Ubiquitous Cons Expressive Idiomatic - many ways to encode the same constraint ASK {{ SELECT ?Person { ?Person schema:name ?o . } GROUP BY ?Person HAVING (COUNT(*)=1) } { SELECT ?Person { ?Person schema:name ?o . FILTER ( isLiteral(?o) && datatype(?o) = xsd:string ) } GROUP BY ?Person HAVING (COUNT(*)=1) } { SELECT ?Person (COUNT(*) AS ?c1) { ?Person schema:gender ?o . } GROUP BY ?Person HAVING (COUNT(*)=1)} { SELECT ?Person (COUNT(*) AS ?c2) { ?S schema:gender ?o . FILTER ((?o = schema:Female || ?o = schema:Male)) } GROUP BY ?Person HAVING (COUNT(*)=1)} FILTER (?c1 = ?c2) } Example: schema:name must be a xsd:string schema:gender must be schema:Male or schema:Female
  • 15. SPIN SPARQL inferencing notation http://spinrdf.org/ Developed by TopQuadrant Commercial product Vocabulary associated with user-defined functions in SPARQL SPIN has influenced SHACL (see later)
  • 16. Stardog ICV ICV - Integrity Constraint Validation Commercial product OWL with unique name assumption and closed world Compiled to SPARQL More info: http://docs.stardog.com/icv/icv-specification.html
  • 17. OSLC Resource Shapes OSLC Resource Shapes https://www.w3.org/Submission/shapes/ Grammar based approach Language for RDF validation Less expressive than ShEx :user a rs:ResourceShape ; rs:property [ rs:name "name" ; rs:propertyDefinition schema:name ; rs:valueType xsd:string ; rs:occurs rs:Exactly-one ; ] ; rs:property [ rs:name "gender" ; rs:propertyDefinition schema:gender ; rs:allowedValue schema:Male, schema:Female ; rs:occurs rs:Zero-or-one ; ].
  • 18. Other approaches Dublin Core Application profiles (K. Coyle, T. Baker) http://dublincore.org/documents/dc-dsp/ RDF Data Descriptions (Fischer et al) http://ceur-ws.org/Vol-1330/paper-33.pdf RDFUnit (D. Kontokostas) http://aksw.org/Projects/RDFUnit.html ...
  • 19. ShEx and SHACL 2013 RDF Validation Workshop Conclusions of the workshop: There is a need of a higher level, concise language for RDF Validation ShEx initially proposed by Eric Prud'hommeaux 2014 W3c Data Shapes WG chartered 2015 SHACL as a deliverable from the WG
  • 20. Continue this tutorial with... ShEx by example SHACL by example ShEx vs SHACL Future work and applications http://www.slideshare.net/jelabra/shex-by-example http://www.slideshare.net/jelabra/shacl-by-example http://www.slideshare.net/jelabra/shex-vs-shacl http://www.slideshare.net/jelabra/rdf-validation-future-work-and-applications