SlideShare une entreprise Scribd logo
1  sur  29
Validating and Describing 
Linked Data Portals using 
RDF Shape Expressions 
Eric Prud'hommeaux 
World Wide Web 
Consortium 
MIT, Cambridge, MA, USA 
eric@w3.org 
Jose Emilio Labra Gayo 
WESO Research group 
University of Oviedo 
Spain 
labra@uniovi.es 
Harold Solbrig 
Mayo Clinic 
USA 
College of Medicine, Rochester, 
MN, USA 
Jose María Álvarez Rodríguez 
Dept. Computer Science 
Carlos III University 
Spain 
josemaria.alvarez@uc3m.es
This talk in one slide 
Shape Expressions 
Simple language to describe and validate RDF 
Can be applied to linked data portals 
Use case: WebIndex project
Web Index 
Measure WWW's contribution to development and 
human rights by country 
Developed by the Web Foundation 
81 countries, 116 indicators, 5 years (2007-12) 
Linked data portal 
http://data.webfoundation.org/webindex/2013
Webindex workflow 
Data 
(Excel) 
RDF 
Datastore 
Visualizations 
Linked data portal 
Conversion 
Excel  RDF 
Enrichment
WebIndex data model 
Observations have values by years 
Observations refer to indicators and countries 
ITU_B 2011 2012 2013 ... 
Germany 20.34 35.46 37.12 ... 
Spain 19.12 23.78 25.45 ... 
France 20.12 21.34 28.34 ... 
... ... ... ... ... 
ITU_B 2011 2012 2013 ... 
Germany 20.34 35.46 37.12 ... 
Spain 19.12 23.78 25.45 ... 
France 20.12 21.34 28.34 ... 
... ... ... ... ... 
ITU_B 2010 2011 2012 ... 
Germany 20.34 35.46 37.12 ... 
Spain 19.12 23.78 25.45 ... 
France 20.12 21.34 28.34 ... 
... ... ... ... ... 
Model based on RDF Data Cube 
Main entity = Observation 
DataSets are published by Organizations 
Datasets contain several slices 
Slices group observations 
Observation 
Indicator Years 
% Broadband subscribers 
Countries 
Slice 
DataSet 
Indicators are provided by Organizations 
Examples 
ITU = International Telecommunication Union 
UN = United Nations 
WB = World bank 
...
Main webIndex data model* 
1..n 
qb:slice 
Observation 
qb:observation 
rdf:type = qb:Observation 
cex:value: xsd:float 
dc:issued: xsd:dateTime 
rdfs:label: xsd:String 
cex:ref-year: xsd:gYear 
Organization 
rdf:type = org:Organization 
rdfs:label: xsd:String 
foaf:homepage: IRI 
Indicator 
rdf:type = cex:Primary 
| cex:Secondary 
rdfs:label: xsd:string 
rdfs:comment: xsd:string 
skos:notation: xsd:String 
Slice 
rdf:type = qb:Slice 
qb:sliceStructure: wf:sliceByArea 
Country 
rdf:type = wf:Country 
wf:iso2 : xsd:string 
wf:iso3 : xsd:string 
rdfs:label : xsd:String 
DataSet 
rdf:type = qb:DataSet 
qb:structure : wf:DSD 
rdfs:label : xsd:String 
qb:observation 
cex:ref-area cex:indicator 
wf:provider 
dc:publisher 
1..n 
*Simplified
Excel  RDF (Turtle) 
indicator:ITU_B 
a wf:SecondaryIndicator ; 
rdfs:label "Broadband subscribers %" 
. 
dataset:DITU a qb:DataSet ; 
rdfs:label "ITU Dataset" ; 
dc:publisher org:ITU ; 
qb:slice slice:ITU10B , 
slice:ITU11B, 
. ... 
... 
slice:ITU11B a qb:Slice ; 
qb:sliceStructure wf:sliceByYear ; 
qb:observation obs:obs8165, 
obs:obs8166, 
... 
... 
org:ITU a org:Organization ; 
rdfs:label "ITU" ; 
foaf:homepage <http://www.itu.int/> 
. 
country:Spain a wf:Country ; 
wf:iso2 "ES" ; wf:iso3 "ESP" ; 
rdfs:label "Spain" 
. 
interrelated 
linked 
data 
obs:obs8165 a qb:Observation ; 
rdfs:label "ITU B in ESP, 2011" ; 
cex:indicator indicator:ITU_B ; 
qb:dataSet dataset:DITU ; 
cex:value "23.78"^^xsd:float ; 
cex:ref-year 2011 ; 
cex:ref-area country:Spain ; 
dc:issued "2013-05-30"^^xsd:date ; 
... 
.
Description and Validation 
Lots of constraints 
Observations must be linked to some country 
Observations have a float value 
Observations are related with an indicator, a country 
and a year 
Dataset contains several slices and slices contain 
several observations 
....etc. 
Q: How can we express those constraints easily? 
Our proposal: Shape expressions
Shape Expressions 
A simple and intuitive language to: 
Describe the topology of RDF data 
Validate that an RDF graph matches a shape 
Two syntaxes 
- Compact syntax (inspired by RelaxNG, Turtle and SPARQL) 
- RDF 
More details about ShEx: 
Paper in Semantics-2014 (5th Sept, 10:30h) 
http://www.w3.org/2013/ShEx/Primer
Country 
A <Country> has at least the following properties: 
rdf:type with value wf:Country 
rdfs:label with value of type xsd:string 
wf:iso2 with value of type xsd:string 
wf:iso3 with value of type xsd:string 
Using shape Expressions: 
Label Open shape 
<Country> { 
rdf:type (wf:Country) 
, rdfs:label xsd:string 
, wf:iso2 xsd:string 
, wf:iso3 xsd:string 
} 
Conjunction
DataSets 
A <DataSet> has the shape: 
rdf:type with value qb:Dataset 
qb:structure with value wf:DSD 
Optional rdfs:label with value of type xsd:string 
One or more qb:slice with shape <Slice> 
<DataSet> { 
rdf:type (qb:DataSet) 
, qb:structure (wf:DSD) 
, dc:publisher @<Organization> 
, rdfs:label xsd:string ? 
, qb:slice @<Slice>+ 
} 
Cardinality posibilities: 
* (0 or more) 
? (0 or 1) 
+ (1 or more) 
{m,n} between m and n
Slices 
<Slice> has the properties: 
rdf:type with value qb:Slice 
qb:SliceStructure Whar does with it value mean? 
wf:sliceByYear 
Several qb:observation with shape <Observation> 
cex:indicator with shape <Indicator> 
<Slice> { 
rdf:type (qb:Slice) 
, qb:sliceStructure (wf:sliceByYear) 
, qb:observation @<Observation>+ 
, cex:indicator @<Indicator> 
}
Observations 
<Observation> { 
rdf:type (qb:Observation) 
, cex:value xsd:float ? 
, dc:issued xsd:dateTime 
, rdfs:label xsd:string ? 
, qb:dataSet @<DataSet> 
, cex:ref-area @<Country> 
, cex:indicator @<Indicator> 
, cex:ref-year xsd:gYear 
}
...and more 
Indicators 
<Indicator> { 
rdf:type (wf:PrimaryIndicator wf:SecondaryIndicator) 
, rdfs:label xsd:string 
, rdfs:comment xsd:string ? 
, skos:notation xsd:string ? 
} 
Organizations 
<Organization> { 
rdf:type (org:Organization) 
, rdfs:label xsd:string 
, foaf:homepage IRI 
, org:hasSubOrganization @<Organization> 
}
Current Use of shape expressions 
in WebIndex 
1. Documentation of linked data portal 
Human-readable 
Machine processable 
2. Team communication 
Tell the developers which shapes they must generate 
3. Validation 
For example: check if a value of type 
qb:Observation has shape <Observation>
OK, but...why not use SPARQL? 
1 CONSTRUCT { 
2 ?Organization shex:hasShape <Organization> . 
3 } WHERE { SELECT ?Organization { 
4 ?Organization a ?o . 
5 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
6 { SELECT ?Organization { 
7 ?Organization a ?o . FILTER ((?o = org:Organization)) 
8 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
9 { SELECT ?Organization { 
10 ?Organization rdfs:label ?o . 
11 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
12 { SELECT ?Organization { 
13 ?Organization rdfs:label ?o . 
14 FILTER ((isLiteral(?o) && datatype(?o) = xsd:string)) 
15 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
16 { SELECT ?Organization { 
17 ?Organization foaf:homepage ?o . 
18 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
19 { SELECT ?Organization { 
20 ?Organization foaf:homepage ?o . FILTER (isIRI(?o)) 
21 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 
22 { SELECT ?Organization (COUNT(*) AS ?Organization_c0) { 
23 ?Organization org:hasSubOrganization ?o . 
24 } GROUP BY ?Organization} 
25 { SELECT ?Organization (COUNT(*) AS ?Organization_c1) { 
26 ?Organization org:hasSubOrganization ?o . 
26 } GROUP BY ?Organization} 
28 FILTER (?Organization_c0 = ?Organization_c1) 
29 } 
SPARQL 
Opgnization shape 
Shape Expressions 
1 <Organization> { 
2 rdf:type (org:Organization) 
3 , rdfs:label xsd:string 
4 , foaf:homepage IRI 
5 , org:hasSubOrganization @<Organization> 
6 } 
Full example of WebIndex: 
61 lines ShEx vs 580 lines SPARQL
Implementations of 
Shape Expressions 
Name Main 
Developer 
Language Features 
FancyDemo Eric 
Prud'hommeaux 
Javascript First implementation 
Semantic Actions and Conversion to SPARQL 
http://www.w3.org/2013/ShEx/ 
JsShExTest Jesse van Dam Javascript Supports RDF and Compact syntax 
https://github.com/jessevdam/shextest 
ShExcala Jose E. Labra Scala Several extensions: 
negations, reverse arcs, relations,... 
Efficient implementation using Derivatives 
http://labra.github.io/ShExcala/ 
Haws Jose E. Labra Haskell Prototype to check Inference semantics 
http://labra.github.io/haws/
RDFShape: Online validation tool 
RDFShape = online validation tool 
Deployed at: http://rdfshape.weso.es 
Based on ShExcala 
Can validate by: 
URI 
File 
Textarea 
SPARQL endpoint 
Dereference
Shapes ≠ Types 
Types oriented to concepts 
Inference: RDF Schena, OWL 
Shapes oriented to RDF graphs 
Interface descriptions 
WebIndex 
<Observation> { 
rdf:type (qb:Observation) 
,cex:ref-year xsd:gYear 
...other properties from WebIndex 
} 
LandPortal 
<Observation> { 
rdf:type (qb:Observation) 
, lb:time @<Time> 
...other properties from LandPortal 
} 
RDF Data Cube 
qb:Observation a rdfs:Class, 
owl:Class; 
rdfs:label "Observation"@en; 
rdfs:comment "... "@en; 
rdfs:subClassOf qb:Attachable; 
owl:equivalentClass scovo:Item; 
rdfs:isDefinedBy ... 
Can be local to a data portal Types are global 
However, we can also define generic Shapes templates
Extensions & challenges 
Shape Expressions language has just been born 
It will be affected by W3c Charter group about 
RDF Data Shapes 
Mailing list: public-rdf-shapes@w3c.org 
"The discussion on public-rdf-shapes@w3.org is the 
best entertainment since years; 
Game of Thrones colors pale." @PaulZH
Alternatives, negations, etc. 
More expressiveness from regular expressions 
Alternatives 
Negations 
Groupings 
<Country> { a (wf:Country) 
, rdfs:label xsd:string 
, ( wf:iso2 xsd:string | wf:iso3 xsd:string ) 
, ! dc:creator . 
}
Open vs Closed shapes 
Open shapes allow remaining triples after validation 
<User> { 
a (foaf:Person) 
} 
:john a foaf:Person, 
foaf:name "John" . 
<User> [ 
a (foaf:Person) 
] 
:anna a foaf:Person . 
Open shape Closed shape 
 
 
 

Shape inclusions 
A shape includes/extends another shape 
Example: 
<Provider> extends <Organization> { 
wf:sourceURI IRI 
} 
A <Provider> has the same shape as an <Organization> 
plus the property wf:sourceURI
Reverse and relation arcs 
Shape Expressions describe subjects 
Can be extended to describe 
objects (reverse arcs) 
predicates (relation arcs) 
<Country> { 
rdf:type (wf:Country) 
, rdfs:label xsd:string 
, wf:iso2 xsd:string 
, wf:iso3 xsd:string 
, ^ cex:ref-area @<Observation> * 
} 
Reverse arc: a country has several incoming arcs with property cex:ref-area 
from subjects with shape <Observation>
Semantic actions 
Defines actions to be executed during validation 
%lang{ ...actions... %} 
Calls lang processor passing it the given actions 
<Country> { 
... 
wf:iso2 xsd:string %js{return /^[A-Z]{2}$/i.test(_.o.lex); %} 
, wf:iso3 xsd:string %js{return /^[A-Z]{3}$/i.test(_.o.lex); %} 
}
Variables and filters 
Add variable bindings to matched values 
Add FILTER rules similar to SPARQL 
<Country> { 
wf:iso2 (xsd:string AS ?iso2) 
wf:iso3 (xsd:string AS ?iso3) 
FILTER (regex(?iso2,"^[A-Z]{2}$","i") && 
regex(?iso3,"^[A-Z]{3}$","i")) 
}
Conclusions 
Shape Expressions: 
DSL to describe and validate RDF 
Role similar to DTDs or Schema languages for XML 
Quality of linked data portals 
Shape Expressions as interface descriptions 
Publishers: Understand what to publish 
Consumers: Check data before processing
Future Work 
Shape Expressions language 
Named graphs 
Implementations: Debugging and error messages 
Performance 
Applications to 
Other linked data use cases 
User interface generation 
Binding: generate parsers/tools from shapes 
...
End of presentation 
More info: 
Jose Emilio Labra Gayo 
http://www.weso.es

Contenu connexe

Tendances (18)

RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
SHACL by example
SHACL by exampleSHACL by example
SHACL by example
 
ShEx vs SHACL
ShEx vs SHACLShEx vs SHACL
ShEx vs SHACL
 
RDF data validation 2017 SHACL
RDF data validation 2017 SHACLRDF data validation 2017 SHACL
RDF data validation 2017 SHACL
 
SWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mappingSWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mapping
 
SWT Lecture Session 10 R2RML Part 1
SWT Lecture Session 10 R2RML Part 1SWT Lecture Session 10 R2RML Part 1
SWT Lecture Session 10 R2RML Part 1
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
 
SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020
 
Lesson5
Lesson5Lesson5
Lesson5
 
Structure&amp;union
Structure&amp;unionStructure&amp;union
Structure&amp;union
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
 
What is Pure Functional Programming, and how it can improve our application t...
What is Pure Functional Programming, and how it can improve our application t...What is Pure Functional Programming, and how it can improve our application t...
What is Pure Functional Programming, and how it can improve our application t...
 
Ch08 - Manipulating Data in Strings and Arrays
Ch08 - Manipulating Data in Strings and ArraysCh08 - Manipulating Data in Strings and Arrays
Ch08 - Manipulating Data in Strings and Arrays
 
Postgresql Server Programming
Postgresql Server ProgrammingPostgresql Server Programming
Postgresql Server Programming
 
Xml Overview
Xml OverviewXml Overview
Xml Overview
 
Bcp
BcpBcp
Bcp
 

Similaire à Validating Linked Data with Shapes

RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applicationsJose Emilio Labra Gayo
 
RSP-QL*: Querying Data-Level Annotations in RDF Streams
RSP-QL*: Querying Data-Level Annotations in RDF StreamsRSP-QL*: Querying Data-Level Annotations in RDF Streams
RSP-QL*: Querying Data-Level Annotations in RDF Streamskeski
 
Linked Data Hypercubes - Semtech London
Linked Data Hypercubes - Semtech LondonLinked Data Hypercubes - Semtech London
Linked Data Hypercubes - Semtech LondonDave Reynolds
 
Linked Data Hypercubes
Linked Data HypercubesLinked Data Hypercubes
Linked Data HypercubesDave Reynolds
 
Rdf data-model-and-storage
Rdf data-model-and-storageRdf data-model-and-storage
Rdf data-model-and-storage灿辉 葛
 
Data translation with SPARQL 1.1
Data translation with SPARQL 1.1Data translation with SPARQL 1.1
Data translation with SPARQL 1.1andreas_schultz
 
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4jExplicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4jConnected Data World
 
Connecting Stream Reasoners on the Web
Connecting Stream Reasoners on the WebConnecting Stream Reasoners on the Web
Connecting Stream Reasoners on the WebJean-Paul Calbimonte
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2Dimitris Kontokostas
 
Triplificating and linking XBRL financial data
Triplificating and linking XBRL financial dataTriplificating and linking XBRL financial data
Triplificating and linking XBRL financial dataRoberto García
 
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...Validating statistical Index Data represented in RDF using SPARQL Queries: Co...
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...Jose Emilio Labra Gayo
 
Representing verifiable statistical index computations as linked data
Representing verifiable statistical index computations as linked dataRepresenting verifiable statistical index computations as linked data
Representing verifiable statistical index computations as linked dataJose Emilio Labra Gayo
 
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 @ W3CIvan Herman
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQLLino Valdivia
 
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)Ankur Dave
 
Data integration with a façade. The case of knowledge graph construction.
Data integration with a façade. The case of knowledge graph construction.Data integration with a façade. The case of knowledge graph construction.
Data integration with a façade. The case of knowledge graph construction.Enrico Daga
 
List.MID: A MIDI-Based Benchmark for RDF Lists
List.MID: A MIDI-Based Benchmark for RDF ListsList.MID: A MIDI-Based Benchmark for RDF Lists
List.MID: A MIDI-Based Benchmark for RDF ListsAlbert Meroño-Peñuela
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsDr. Neil Brittliff
 
Optimized index structures for querying rdf from the web
Optimized index structures for querying rdf from the webOptimized index structures for querying rdf from the web
Optimized index structures for querying rdf from the webMahdi Atawneh
 

Similaire à Validating Linked Data with Shapes (20)

RDF Validation Future work and applications
RDF Validation Future work and applicationsRDF Validation Future work and applications
RDF Validation Future work and applications
 
RSP-QL*: Querying Data-Level Annotations in RDF Streams
RSP-QL*: Querying Data-Level Annotations in RDF StreamsRSP-QL*: Querying Data-Level Annotations in RDF Streams
RSP-QL*: Querying Data-Level Annotations in RDF Streams
 
Linked Data Hypercubes - Semtech London
Linked Data Hypercubes - Semtech LondonLinked Data Hypercubes - Semtech London
Linked Data Hypercubes - Semtech London
 
Linked Data Hypercubes
Linked Data HypercubesLinked Data Hypercubes
Linked Data Hypercubes
 
Rdf data-model-and-storage
Rdf data-model-and-storageRdf data-model-and-storage
Rdf data-model-and-storage
 
Data translation with SPARQL 1.1
Data translation with SPARQL 1.1Data translation with SPARQL 1.1
Data translation with SPARQL 1.1
 
HyperGraphQL
HyperGraphQLHyperGraphQL
HyperGraphQL
 
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4jExplicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
 
Connecting Stream Reasoners on the Web
Connecting Stream Reasoners on the WebConnecting Stream Reasoners on the Web
Connecting Stream Reasoners on the Web
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
Triplificating and linking XBRL financial data
Triplificating and linking XBRL financial dataTriplificating and linking XBRL financial data
Triplificating and linking XBRL financial data
 
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...Validating statistical Index Data represented in RDF using SPARQL Queries: Co...
Validating statistical Index Data represented in RDF using SPARQL Queries: Co...
 
Representing verifiable statistical index computations as linked data
Representing verifiable statistical index computations as linked dataRepresenting verifiable statistical index computations as linked data
Representing verifiable statistical index computations as linked data
 
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
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
 
Data integration with a façade. The case of knowledge graph construction.
Data integration with a façade. The case of knowledge graph construction.Data integration with a façade. The case of knowledge graph construction.
Data integration with a façade. The case of knowledge graph construction.
 
List.MID: A MIDI-Based Benchmark for RDF Lists
List.MID: A MIDI-Based Benchmark for RDF ListsList.MID: A MIDI-Based Benchmark for RDF Lists
List.MID: A MIDI-Based Benchmark for RDF Lists
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
 
Optimized index structures for querying rdf from the web
Optimized index structures for querying rdf from the webOptimized index structures for querying rdf from the web
Optimized index structures for querying rdf from the web
 

Plus de Jose Emilio Labra Gayo

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/doctoradoJose Emilio Labra Gayo
 
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 qualityJose Emilio Labra Gayo
 
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 technologiesJose Emilio Labra Gayo
 
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 enlazadosJose Emilio Labra Gayo
 
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 ServidorJose 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 data model
RDF data modelRDF data model
RDF data model
 
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

Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 

Dernier (20)

Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 

Validating Linked Data with Shapes

  • 1. Validating and Describing Linked Data Portals using RDF Shape Expressions Eric Prud'hommeaux World Wide Web Consortium MIT, Cambridge, MA, USA eric@w3.org Jose Emilio Labra Gayo WESO Research group University of Oviedo Spain labra@uniovi.es Harold Solbrig Mayo Clinic USA College of Medicine, Rochester, MN, USA Jose María Álvarez Rodríguez Dept. Computer Science Carlos III University Spain josemaria.alvarez@uc3m.es
  • 2. This talk in one slide Shape Expressions Simple language to describe and validate RDF Can be applied to linked data portals Use case: WebIndex project
  • 3. Web Index Measure WWW's contribution to development and human rights by country Developed by the Web Foundation 81 countries, 116 indicators, 5 years (2007-12) Linked data portal http://data.webfoundation.org/webindex/2013
  • 4. Webindex workflow Data (Excel) RDF Datastore Visualizations Linked data portal Conversion Excel  RDF Enrichment
  • 5. WebIndex data model Observations have values by years Observations refer to indicators and countries ITU_B 2011 2012 2013 ... Germany 20.34 35.46 37.12 ... Spain 19.12 23.78 25.45 ... France 20.12 21.34 28.34 ... ... ... ... ... ... ITU_B 2011 2012 2013 ... Germany 20.34 35.46 37.12 ... Spain 19.12 23.78 25.45 ... France 20.12 21.34 28.34 ... ... ... ... ... ... ITU_B 2010 2011 2012 ... Germany 20.34 35.46 37.12 ... Spain 19.12 23.78 25.45 ... France 20.12 21.34 28.34 ... ... ... ... ... ... Model based on RDF Data Cube Main entity = Observation DataSets are published by Organizations Datasets contain several slices Slices group observations Observation Indicator Years % Broadband subscribers Countries Slice DataSet Indicators are provided by Organizations Examples ITU = International Telecommunication Union UN = United Nations WB = World bank ...
  • 6. Main webIndex data model* 1..n qb:slice Observation qb:observation rdf:type = qb:Observation cex:value: xsd:float dc:issued: xsd:dateTime rdfs:label: xsd:String cex:ref-year: xsd:gYear Organization rdf:type = org:Organization rdfs:label: xsd:String foaf:homepage: IRI Indicator rdf:type = cex:Primary | cex:Secondary rdfs:label: xsd:string rdfs:comment: xsd:string skos:notation: xsd:String Slice rdf:type = qb:Slice qb:sliceStructure: wf:sliceByArea Country rdf:type = wf:Country wf:iso2 : xsd:string wf:iso3 : xsd:string rdfs:label : xsd:String DataSet rdf:type = qb:DataSet qb:structure : wf:DSD rdfs:label : xsd:String qb:observation cex:ref-area cex:indicator wf:provider dc:publisher 1..n *Simplified
  • 7. Excel  RDF (Turtle) indicator:ITU_B a wf:SecondaryIndicator ; rdfs:label "Broadband subscribers %" . dataset:DITU a qb:DataSet ; rdfs:label "ITU Dataset" ; dc:publisher org:ITU ; qb:slice slice:ITU10B , slice:ITU11B, . ... ... slice:ITU11B a qb:Slice ; qb:sliceStructure wf:sliceByYear ; qb:observation obs:obs8165, obs:obs8166, ... ... org:ITU a org:Organization ; rdfs:label "ITU" ; foaf:homepage <http://www.itu.int/> . country:Spain a wf:Country ; wf:iso2 "ES" ; wf:iso3 "ESP" ; rdfs:label "Spain" . interrelated linked data obs:obs8165 a qb:Observation ; rdfs:label "ITU B in ESP, 2011" ; cex:indicator indicator:ITU_B ; qb:dataSet dataset:DITU ; cex:value "23.78"^^xsd:float ; cex:ref-year 2011 ; cex:ref-area country:Spain ; dc:issued "2013-05-30"^^xsd:date ; ... .
  • 8. Description and Validation Lots of constraints Observations must be linked to some country Observations have a float value Observations are related with an indicator, a country and a year Dataset contains several slices and slices contain several observations ....etc. Q: How can we express those constraints easily? Our proposal: Shape expressions
  • 9. Shape Expressions A simple and intuitive language to: Describe the topology of RDF data Validate that an RDF graph matches a shape Two syntaxes - Compact syntax (inspired by RelaxNG, Turtle and SPARQL) - RDF More details about ShEx: Paper in Semantics-2014 (5th Sept, 10:30h) http://www.w3.org/2013/ShEx/Primer
  • 10. Country A <Country> has at least the following properties: rdf:type with value wf:Country rdfs:label with value of type xsd:string wf:iso2 with value of type xsd:string wf:iso3 with value of type xsd:string Using shape Expressions: Label Open shape <Country> { rdf:type (wf:Country) , rdfs:label xsd:string , wf:iso2 xsd:string , wf:iso3 xsd:string } Conjunction
  • 11. DataSets A <DataSet> has the shape: rdf:type with value qb:Dataset qb:structure with value wf:DSD Optional rdfs:label with value of type xsd:string One or more qb:slice with shape <Slice> <DataSet> { rdf:type (qb:DataSet) , qb:structure (wf:DSD) , dc:publisher @<Organization> , rdfs:label xsd:string ? , qb:slice @<Slice>+ } Cardinality posibilities: * (0 or more) ? (0 or 1) + (1 or more) {m,n} between m and n
  • 12. Slices <Slice> has the properties: rdf:type with value qb:Slice qb:SliceStructure Whar does with it value mean? wf:sliceByYear Several qb:observation with shape <Observation> cex:indicator with shape <Indicator> <Slice> { rdf:type (qb:Slice) , qb:sliceStructure (wf:sliceByYear) , qb:observation @<Observation>+ , cex:indicator @<Indicator> }
  • 13. Observations <Observation> { rdf:type (qb:Observation) , cex:value xsd:float ? , dc:issued xsd:dateTime , rdfs:label xsd:string ? , qb:dataSet @<DataSet> , cex:ref-area @<Country> , cex:indicator @<Indicator> , cex:ref-year xsd:gYear }
  • 14. ...and more Indicators <Indicator> { rdf:type (wf:PrimaryIndicator wf:SecondaryIndicator) , rdfs:label xsd:string , rdfs:comment xsd:string ? , skos:notation xsd:string ? } Organizations <Organization> { rdf:type (org:Organization) , rdfs:label xsd:string , foaf:homepage IRI , org:hasSubOrganization @<Organization> }
  • 15. Current Use of shape expressions in WebIndex 1. Documentation of linked data portal Human-readable Machine processable 2. Team communication Tell the developers which shapes they must generate 3. Validation For example: check if a value of type qb:Observation has shape <Observation>
  • 16. OK, but...why not use SPARQL? 1 CONSTRUCT { 2 ?Organization shex:hasShape <Organization> . 3 } WHERE { SELECT ?Organization { 4 ?Organization a ?o . 5 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 6 { SELECT ?Organization { 7 ?Organization a ?o . FILTER ((?o = org:Organization)) 8 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 9 { SELECT ?Organization { 10 ?Organization rdfs:label ?o . 11 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 12 { SELECT ?Organization { 13 ?Organization rdfs:label ?o . 14 FILTER ((isLiteral(?o) && datatype(?o) = xsd:string)) 15 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 16 { SELECT ?Organization { 17 ?Organization foaf:homepage ?o . 18 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 19 { SELECT ?Organization { 20 ?Organization foaf:homepage ?o . FILTER (isIRI(?o)) 21 } GROUP BY ?Organization HAVING (COUNT(*)=1)} 22 { SELECT ?Organization (COUNT(*) AS ?Organization_c0) { 23 ?Organization org:hasSubOrganization ?o . 24 } GROUP BY ?Organization} 25 { SELECT ?Organization (COUNT(*) AS ?Organization_c1) { 26 ?Organization org:hasSubOrganization ?o . 26 } GROUP BY ?Organization} 28 FILTER (?Organization_c0 = ?Organization_c1) 29 } SPARQL Opgnization shape Shape Expressions 1 <Organization> { 2 rdf:type (org:Organization) 3 , rdfs:label xsd:string 4 , foaf:homepage IRI 5 , org:hasSubOrganization @<Organization> 6 } Full example of WebIndex: 61 lines ShEx vs 580 lines SPARQL
  • 17. Implementations of Shape Expressions Name Main Developer Language Features FancyDemo Eric Prud'hommeaux Javascript First implementation Semantic Actions and Conversion to SPARQL http://www.w3.org/2013/ShEx/ JsShExTest Jesse van Dam Javascript Supports RDF and Compact syntax https://github.com/jessevdam/shextest ShExcala Jose E. Labra Scala Several extensions: negations, reverse arcs, relations,... Efficient implementation using Derivatives http://labra.github.io/ShExcala/ Haws Jose E. Labra Haskell Prototype to check Inference semantics http://labra.github.io/haws/
  • 18. RDFShape: Online validation tool RDFShape = online validation tool Deployed at: http://rdfshape.weso.es Based on ShExcala Can validate by: URI File Textarea SPARQL endpoint Dereference
  • 19. Shapes ≠ Types Types oriented to concepts Inference: RDF Schena, OWL Shapes oriented to RDF graphs Interface descriptions WebIndex <Observation> { rdf:type (qb:Observation) ,cex:ref-year xsd:gYear ...other properties from WebIndex } LandPortal <Observation> { rdf:type (qb:Observation) , lb:time @<Time> ...other properties from LandPortal } RDF Data Cube qb:Observation a rdfs:Class, owl:Class; rdfs:label "Observation"@en; rdfs:comment "... "@en; rdfs:subClassOf qb:Attachable; owl:equivalentClass scovo:Item; rdfs:isDefinedBy ... Can be local to a data portal Types are global However, we can also define generic Shapes templates
  • 20. Extensions & challenges Shape Expressions language has just been born It will be affected by W3c Charter group about RDF Data Shapes Mailing list: public-rdf-shapes@w3c.org "The discussion on public-rdf-shapes@w3.org is the best entertainment since years; Game of Thrones colors pale." @PaulZH
  • 21. Alternatives, negations, etc. More expressiveness from regular expressions Alternatives Negations Groupings <Country> { a (wf:Country) , rdfs:label xsd:string , ( wf:iso2 xsd:string | wf:iso3 xsd:string ) , ! dc:creator . }
  • 22. Open vs Closed shapes Open shapes allow remaining triples after validation <User> { a (foaf:Person) } :john a foaf:Person, foaf:name "John" . <User> [ a (foaf:Person) ] :anna a foaf:Person . Open shape Closed shape    
  • 23. Shape inclusions A shape includes/extends another shape Example: <Provider> extends <Organization> { wf:sourceURI IRI } A <Provider> has the same shape as an <Organization> plus the property wf:sourceURI
  • 24. Reverse and relation arcs Shape Expressions describe subjects Can be extended to describe objects (reverse arcs) predicates (relation arcs) <Country> { rdf:type (wf:Country) , rdfs:label xsd:string , wf:iso2 xsd:string , wf:iso3 xsd:string , ^ cex:ref-area @<Observation> * } Reverse arc: a country has several incoming arcs with property cex:ref-area from subjects with shape <Observation>
  • 25. Semantic actions Defines actions to be executed during validation %lang{ ...actions... %} Calls lang processor passing it the given actions <Country> { ... wf:iso2 xsd:string %js{return /^[A-Z]{2}$/i.test(_.o.lex); %} , wf:iso3 xsd:string %js{return /^[A-Z]{3}$/i.test(_.o.lex); %} }
  • 26. Variables and filters Add variable bindings to matched values Add FILTER rules similar to SPARQL <Country> { wf:iso2 (xsd:string AS ?iso2) wf:iso3 (xsd:string AS ?iso3) FILTER (regex(?iso2,"^[A-Z]{2}$","i") && regex(?iso3,"^[A-Z]{3}$","i")) }
  • 27. Conclusions Shape Expressions: DSL to describe and validate RDF Role similar to DTDs or Schema languages for XML Quality of linked data portals Shape Expressions as interface descriptions Publishers: Understand what to publish Consumers: Check data before processing
  • 28. Future Work Shape Expressions language Named graphs Implementations: Debugging and error messages Performance Applications to Other linked data use cases User interface generation Binding: generate parsers/tools from shapes ...
  • 29. End of presentation More info: Jose Emilio Labra Gayo http://www.weso.es