SlideShare a Scribd company logo
Guidance, Please!
Towards a Framework
for RDF-based Constraint Languages.
Thomas Bosch, GESIS – Lebniz Institute for the Social Sciences
Kai Eckert, Stuttgart Media University
Prerequisites
• For RDF data, we want to express constraints, as it is common for XML
files using for example XML Schema: „Every Book must have at least
one author.“
• Several languages exist or are in development that support this, for
instance Description Set Profiles, OWL 2 (despite not intended to be a
constraint language), Shape Expressions or Resource Shapes.
• For the further development of constraint languages, the DCMI RDF
Application Profiles task group collected requirements in a public
database.
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
2
http://purl.org/net/rdf-application-profiles
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
3
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
4
Disclaimer: This is not an
accurate visualization!
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
5
A publication needs an author!
OWL 2: Publication a owl:Restriction ;
owl:minQualifiedCardinality 1 ;
owl:onProperty author ;
owl:onClass Person .
ShEx: Publication { author @Person{1, } }
ReSh: Publication a rs:ResourceShape ; rs:property [
rs:propertyDefinition author ;
rs:valueShape Person ;
rs:occurs rs:One-or-many ; ] .
DSP: [ dsp:resourceClass Publication ; dsp:statementTemplate [
dsp:minOccur 1 ;
dsp:property author ;
dsp:nonLiteralConstraint [ dsp:valueClass Person ] ] ] .
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
6
Let‘s spin….
SPIN: CONSTRUCT { [ a spin:ConstraintViolation ... . ] } WHERE {
?this
a ?C1 ;
?p ?o .
BIND ( qualifiedCardinality( ?this, ?p, ?C2 ) AS ?c ) .
BIND( STRDT ( STR ( ?c ), xsd:nonNegativeInteger ) AS ?cardinality ) .
FILTER ( ?cardinality < 1 ) .
FILTER ( ?C1 = Publication ) .
FILTER ( ?C2 = Person ) .
FILTER ( ?p = author ) . }
SPIN function qualifiedCardinality:
SELECT ( COUNT ( ?arg1 ) AS ?c ) WHERE { ?arg1 ?arg2 ?o . ?o a ?arg3 . }
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
7
From high-level to low-level
Low Level Language: Constraint Validation
SPIN/SPARQL
High Level Languages: Constraint Formulation
DSP OWL 2 ReSh ShEx
SPIN
SPARQL
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
8
Mapping from DSP to SPIN using SPARQL
CONSTRUCT {
_:constraintViolation a spin:ConstraintViolation ;
rdfs:label ?violationMessage ;
spin:violationRoot ?this ;
spin:violationPath ?property ;
spin:violationSource ?violationSource . }
WHERE {
?this a ?resourceClass .
?descriptionTemplate dsp:resourceClass ?resourceClass ;
dsp:statementTemplate ?statementTemplate .
?statementTemplate dsp:minOccur ?minimum ;
dsp:property ?property ;
dsp:nonLiteralConstraint ?nonLiteralConstraint .
?nonLiteralConstraint dsp:valueClass ?valueClass .
BIND ( qualifiedCardinality( ?this, ?property, ?valueClass ) AS ?cardinality ) .
FILTER ( ?cardinality < ?minimum ) . }
SPIN
SPARQL
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
9
Step by step:
Constraint validation using DSP
1. Write down your data constraints:
:authorNeeded dsp:resourceClass Publication ; dsp:statementTemplate [
dsp:minOccur 1 ;
dsp:property author ;
dsp:nonLiteralConstraint [ dsp:valueClass Person ] ].
2. Create a mapping from DSP to SPARQL:
• As shown before.
• One mapping per DSP element.
• This only has to be done once for DSP.
3. Load constraints and mappings and execute the validation using SPIN.
 This was our approach in our DC-2014 paper and is implemented in our demo:
http://purl.org/net/rdfval-demo
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
10
Challenge 1
A SPIN mapping constitutes two different aspects:
1. The definition of each language element (e.g. dsp:minOccur).
2. The definition of the violation that is created when validation fails.
The latter might be application specific. A consistent violation representation
across mappings is desirable.
 How can we ensure that two semantically equivalent constraints are
actually validated consistently?
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
11
Challenge 2
Many constraint languages exist. Semantically equivalent constraints
can be mapped from one language to another. But:
Supporting 5 languages requires 20 mappings,
10 languages require already 90 mappings,
generally 𝑛 ∙ 𝑛 − 1 mappings (both directions) are required.
Every single language element need to be mapped. This is not feasible
practically.
 How can we support the transformation of semantically equivalent
constraints from one constraint language to another?
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
12
Adding an additional layer
Low Level Language: Constraint Validation
SPIN/SPARQL
Intermediate Representation: Constraint Type (Requirement)
RDF Constraints Vocabulary (RDF-CV)
High Level Languages: Constraint Formulation
DSP OWL 2 ReSh ShEx
SPIN
SPARQL
SPIN
SPARQL
Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015
13
RDF-CV building blocks
Constraints are either…
• Simple Constraints or
• Complex Constraints.
Complex Constraints contain
Simple Constraints and/or other
Complex Constraints.
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
14
Representing simple constraints
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
15
„Syntactical“ description of the constraint based on a constraining element and up
to 5 parameters:
1. Context class: the class for which the constraint applies
2. Left property list: Depending on the constraining element the left side.
3. Right property list: the right side.
4. Classes: A class restriction for the constrained value.
5. Constraining value: a value to be used in the constraint.
Examples:
context class left p. list right p. list classes c. element c. value
Publication author - Person ≥ 1
context class left p. list right p. list classes c. element c. value
⊤ authorOf, genre authorOfGenre ⊤ property path -
RDF-CV specification
The list of all 103 constraining elements and the representation of all
81 constraint types using RDF-CV is available in a technical report:
Bosch, T., Nolle, A., Acar, E., & Eckert, K. (2015). RDF Validation
Requirements - Evaluation and Logical Underpinning. Computing
Research Repository (CoRR), abs/1501.03933.
(http://arxiv.org/abs/1501.03933)
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
16
Mapping implementation
Example constraint:
:Publication a owl:Restriction ;
owl:minQualifiedCardinality 1 ;
owl:onProperty :author ;
owl:onClass :Person .
RDF-CV:
[ a rdfcv:SimpleConstraint ;
rdfcv:contextClass :Publication ;
rdfcv:leftProperties ( :author ) ;
rdfcv:classes ( :Person ) ;
rdfcv:constrainingElement "minimum qualified
cardinality restriction" ;
rdfcv:constrainingValue 1 ] .
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
17
Mapping 1: To and from RDF-CV
• Using the usual SPARQL CONSTRUCT queries, we create the RDF-CV
representation (Mapping m).
• To support transformations from one constraint language to another,
another mapping m‘ from RDF-CV back to the constraint language is
added.
gc = mα (scα )
scβ = m´β (gc)
 This enables constraint transformations in a scalable way
(Challenge 2).
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
18
Mapping 2: From RDF-CV to SPIN
• From RDF-CV, the SPIN representation can be created as usual.
• This mapping only has to be created only once.
• It contains the definition how exactly the constraint violations are
created. Depending on the application, different mappings can of
course be used.
 This ensures that irrespective of the constraint language,
semantically equivalent constraints are validated consistently
(Challenge 1).
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
19
Conclusion
We think that this approach is suitable
• to implement the validation of constraints consistently across constraint
languages,
• to support the extension of constraint languages when additional
constraint types should be supported by means of a simple mapping, and
• to enhance or rather establish the interoperability of different constraint
languages.
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
20
Thank you!
Acknowledgements: Thanks to all participants in the DCMI RDF Application Profiles
task group and particularly the chairs, Karen Coyle and Antoine Isaac.
September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages.
21
Licence
These slides are licensed according to the Creative Commons
Attribution-ShareAlike Licence
http://creativecommons.org/licenses/by-sa/3.0
September, 2nd 2015Eckert: JudaicaLink
22

More Related Content

What's hot (19)

PDF
Global DSL workshop slides
ericupnorth
 
PDF
[DCSB] Torsten Roeder (BBAW), Yury Arzhanov (Ruhr­Universität Bochum) "The Gl...
Digital Classicist Seminar Berlin
 
PPT
Lecture 11
Abbas Ajmal
 
PPT
Object oriented slides
ahad nadeem
 
PPT
Open-DO Update
AdaCore
 
PPTX
C Language
TodayTutoring
 
DOCX
Criterion template
balham
 
PDF
Doppl development iteration #10
Diego Perini
 
PDF
In pursuit of expressivity: Groovy and Scala compared
Chris Richardson
 
PDF
The Rise of Dynamic Languages
greenwop
 
PDF
[LibreOffice Asia Conference 2019] CJK Issues on LibreOffice(based on Korean ...
DaeHyun Sung
 
PDF
Historical spelling normalization
rmarquilhas
 
PDF
Improving Interoperability of Text Mining Tools with BioC
The Children's Hospital of Philadelphia
 
PPTX
C language myths & secrets
ankush1510
 
PPTX
Interaction Choreography Models in BPEL:Choreographies on the Enterprise Serv...
Oliver Kopp
 
PDF
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
Rajarshi Guha
 
PPTX
Introduction to c programming
Sivant Kolhe
 
PPT
F# Sample and Resources
Rhonda Tipton
 
PDF
Idn root zone lgr workshop icann53
ICANN
 
Global DSL workshop slides
ericupnorth
 
[DCSB] Torsten Roeder (BBAW), Yury Arzhanov (Ruhr­Universität Bochum) "The Gl...
Digital Classicist Seminar Berlin
 
Lecture 11
Abbas Ajmal
 
Object oriented slides
ahad nadeem
 
Open-DO Update
AdaCore
 
C Language
TodayTutoring
 
Criterion template
balham
 
Doppl development iteration #10
Diego Perini
 
In pursuit of expressivity: Groovy and Scala compared
Chris Richardson
 
The Rise of Dynamic Languages
greenwop
 
[LibreOffice Asia Conference 2019] CJK Issues on LibreOffice(based on Korean ...
DaeHyun Sung
 
Historical spelling normalization
rmarquilhas
 
Improving Interoperability of Text Mining Tools with BioC
The Children's Hospital of Philadelphia
 
C language myths & secrets
ankush1510
 
Interaction Choreography Models in BPEL:Choreographies on the Enterprise Serv...
Oliver Kopp
 
R & CDK: A Sturdy Platform in the Oceans of Chemical Data}
Rajarshi Guha
 
Introduction to c programming
Sivant Kolhe
 
F# Sample and Resources
Rhonda Tipton
 
Idn root zone lgr workshop icann53
ICANN
 

Viewers also liked (10)

PDF
Linked Data nach dem Hype
Kai Eckert
 
PDF
Thesaurusvisualisierung mit ICE-Map und SEMTINEL
Kai Eckert
 
PDF
Bibliotheken und Linked Open Data - Erfahrungen und Ideen aus der UB Mannheim
Kai Eckert
 
PDF
LOHAI: Providing a baseline for KOS based automatic indexing
Kai Eckert
 
PDF
Metadata Provenance Tutorial at SWIB 13, Part 1
Kai Eckert
 
PDF
Extending DCAM for Metadata Provenance
Kai Eckert
 
PDF
The DM2E Data Model and the DM2E Ingestion Infrastructure
Kai Eckert
 
PDF
SWIB 2010: Linked Open Projects
Kai Eckert
 
PDF
Specialising the EDM for Digitised Manuscript (SWIB13)
Kai Eckert
 
PDF
RDF Application Profiles
Kai Eckert
 
Linked Data nach dem Hype
Kai Eckert
 
Thesaurusvisualisierung mit ICE-Map und SEMTINEL
Kai Eckert
 
Bibliotheken und Linked Open Data - Erfahrungen und Ideen aus der UB Mannheim
Kai Eckert
 
LOHAI: Providing a baseline for KOS based automatic indexing
Kai Eckert
 
Metadata Provenance Tutorial at SWIB 13, Part 1
Kai Eckert
 
Extending DCAM for Metadata Provenance
Kai Eckert
 
The DM2E Data Model and the DM2E Ingestion Infrastructure
Kai Eckert
 
SWIB 2010: Linked Open Projects
Kai Eckert
 
Specialising the EDM for Digitised Manuscript (SWIB13)
Kai Eckert
 
RDF Application Profiles
Kai Eckert
 
Ad

Similar to Guidance, Please! Towards a Framework for RDF-based Constraint Languages. (20)

PPTX
KIT Graduiertenkolloquium 11.05.2016
Dr.-Ing. Thomas Hartmann
 
PPTX
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)
Dr.-Ing. Thomas Hartmann
 
PPTX
2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...
Dr.-Ing. Thomas Hartmann
 
PPTX
2014.10 - How to Formulate and Validate Constraints (DC 2014)
Dr.-Ing. Thomas Hartmann
 
PPTX
RDF validation tutorial
Jose Emilio Labra Gayo
 
PPTX
SHACL: Shaping the Big Ball of Data Mud
Richard Cyganiak
 
PPTX
DM2E Project meeting Bergen: WP2 RDF Validation, Kai Eckert (University of Ma...
Digitised Manuscripts to Europeana
 
PPTX
SHACL Specification Draft
Holger Knublauch
 
PPTX
RDF data validation 2017 SHACL
Jean-Paul Calbimonte
 
PDF
RDF Constraint Checking using RDF Data Descriptions (RDD)
Alexander Schätzle
 
PDF
Rdf data-model-and-storage
灿辉 葛
 
PPTX
Apa itu RDF dan SPARQL sebagai alat bantu pada big Data
Eric199332
 
PDF
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Ontotext
 
PDF
Two graph data models : RDF and Property Graphs
andyseaborne
 
PPTX
Knowledge Graph Introduction
Sören Auer
 
PDF
semanticweb
Kevin Hutt
 
PDF
Optimizing SPARQL Queries with SHACL.pdf
Department of Informatics, University of Oslo
 
PPTX
SPIN and Shapes
Holger Knublauch
 
PPTX
RDF SHACL, Annotations, and Data Frames
Kurt Cagle
 
PPTX
SHACL by example
Jose Emilio Labra Gayo
 
KIT Graduiertenkolloquium 11.05.2016
Dr.-Ing. Thomas Hartmann
 
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)
Dr.-Ing. Thomas Hartmann
 
2016.02 - Validating RDF Data Quality using Constraints to Direct the Develop...
Dr.-Ing. Thomas Hartmann
 
2014.10 - How to Formulate and Validate Constraints (DC 2014)
Dr.-Ing. Thomas Hartmann
 
RDF validation tutorial
Jose Emilio Labra Gayo
 
SHACL: Shaping the Big Ball of Data Mud
Richard Cyganiak
 
DM2E Project meeting Bergen: WP2 RDF Validation, Kai Eckert (University of Ma...
Digitised Manuscripts to Europeana
 
SHACL Specification Draft
Holger Knublauch
 
RDF data validation 2017 SHACL
Jean-Paul Calbimonte
 
RDF Constraint Checking using RDF Data Descriptions (RDD)
Alexander Schätzle
 
Rdf data-model-and-storage
灿辉 葛
 
Apa itu RDF dan SPARQL sebagai alat bantu pada big Data
Eric199332
 
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Ontotext
 
Two graph data models : RDF and Property Graphs
andyseaborne
 
Knowledge Graph Introduction
Sören Auer
 
semanticweb
Kevin Hutt
 
Optimizing SPARQL Queries with SHACL.pdf
Department of Informatics, University of Oslo
 
SPIN and Shapes
Holger Knublauch
 
RDF SHACL, Annotations, and Data Frames
Kurt Cagle
 
SHACL by example
Jose Emilio Labra Gayo
 
Ad

More from Kai Eckert (12)

PDF
Judaica link und der FID Jüdische Studien
Kai Eckert
 
PDF
Linked Open Citation Database (LOC-DB)
Kai Eckert
 
PDF
JudaicaLink: Linked Data in the Jewish Studies FID
Kai Eckert
 
PPTX
JudaicaLink: Linked Data from Jewish Encyclopediae
Kai Eckert
 
PDF
Towards Interoperable Metadata Provenance
Kai Eckert
 
PDF
Linked Open Projects (DCMI Library Community)
Kai Eckert
 
PDF
Metadata Provenance
Kai Eckert
 
PDF
Linked Open Projects (DGI-Konferenz)
Kai Eckert
 
PDF
Linked Open Projects
Kai Eckert
 
PDF
Crowdsourcing the Assembly of Concept Hierarchies
Kai Eckert
 
PDF
A Unified Approach for Representing Metametadata
Kai Eckert
 
PDF
Semantic Web, SKOS und Linked Data
Kai Eckert
 
Judaica link und der FID Jüdische Studien
Kai Eckert
 
Linked Open Citation Database (LOC-DB)
Kai Eckert
 
JudaicaLink: Linked Data in the Jewish Studies FID
Kai Eckert
 
JudaicaLink: Linked Data from Jewish Encyclopediae
Kai Eckert
 
Towards Interoperable Metadata Provenance
Kai Eckert
 
Linked Open Projects (DCMI Library Community)
Kai Eckert
 
Metadata Provenance
Kai Eckert
 
Linked Open Projects (DGI-Konferenz)
Kai Eckert
 
Linked Open Projects
Kai Eckert
 
Crowdsourcing the Assembly of Concept Hierarchies
Kai Eckert
 
A Unified Approach for Representing Metametadata
Kai Eckert
 
Semantic Web, SKOS und Linked Data
Kai Eckert
 

Recently uploaded (20)

PDF
High-speedBouldersandtheDebrisFieldinDARTEjecta
Sérgio Sacani
 
PPTX
formations-of-rock-layers-grade 11_.pptx
GraceSarte
 
PPTX
Phage Therapy and Bacteriophage Biology.pptx
Prachi Virat
 
PDF
Phosphates reveal high pH ocean water on Enceladus
Sérgio Sacani
 
PDF
WUCHERIA BANCROFTI-converted-compressed.pdf
S.B.P.G. COLLEGE BARAGAON VARANASI
 
PPTX
Animal Reproductive Behaviors Quiz Presentation in Maroon Brown Flat Graphic ...
LynetteGaniron1
 
PDF
crestacean parasitim non chordates notes
S.B.P.G. COLLEGE BARAGAON VARANASI
 
PPT
Cell cycle,cell cycle checkpoint and control
DrMukeshRameshPimpli
 
PDF
Annual report 2024 - Inria - English version.pdf
Inria
 
PPTX
Lamarckism is one of the earliest theories of evolution, proposed before Darw...
Laxman Khatal
 
PPT
Human physiology and digestive system
S.B.P.G. COLLEGE BARAGAON VARANASI
 
PPT
Introduction of animal physiology in vertebrates
S.B.P.G. COLLEGE BARAGAON VARANASI
 
PPTX
MICROBIOLOGY PART-1 INTRODUCTION .pptx
Mohit Kumar
 
PDF
NRRM 330 Dynamic Equlibrium Presentation
Rowan Sales
 
PDF
Insect Behaviour : Patterns And Determinants
SheikhArshaqAreeb
 
PPTX
LESSON 2 PSYCHOSOCIAL DEVELOPMENT.pptx L
JeanCarolColico1
 
PDF
Continuous Model-Based Engineering of Software-Intensive Systems: Approaches,...
Hugo Bruneliere
 
PDF
Chemokines and Receptors Overview – Key to Immune Cell Signaling
Benjamin Lewis Lewis
 
PPTX
Structure and uses of DDT, Saccharin..pptx
harsimrankaur204
 
PPTX
Q1 - W1 - D2 - Models of matter for science.pptx
RyanCudal3
 
High-speedBouldersandtheDebrisFieldinDARTEjecta
Sérgio Sacani
 
formations-of-rock-layers-grade 11_.pptx
GraceSarte
 
Phage Therapy and Bacteriophage Biology.pptx
Prachi Virat
 
Phosphates reveal high pH ocean water on Enceladus
Sérgio Sacani
 
WUCHERIA BANCROFTI-converted-compressed.pdf
S.B.P.G. COLLEGE BARAGAON VARANASI
 
Animal Reproductive Behaviors Quiz Presentation in Maroon Brown Flat Graphic ...
LynetteGaniron1
 
crestacean parasitim non chordates notes
S.B.P.G. COLLEGE BARAGAON VARANASI
 
Cell cycle,cell cycle checkpoint and control
DrMukeshRameshPimpli
 
Annual report 2024 - Inria - English version.pdf
Inria
 
Lamarckism is one of the earliest theories of evolution, proposed before Darw...
Laxman Khatal
 
Human physiology and digestive system
S.B.P.G. COLLEGE BARAGAON VARANASI
 
Introduction of animal physiology in vertebrates
S.B.P.G. COLLEGE BARAGAON VARANASI
 
MICROBIOLOGY PART-1 INTRODUCTION .pptx
Mohit Kumar
 
NRRM 330 Dynamic Equlibrium Presentation
Rowan Sales
 
Insect Behaviour : Patterns And Determinants
SheikhArshaqAreeb
 
LESSON 2 PSYCHOSOCIAL DEVELOPMENT.pptx L
JeanCarolColico1
 
Continuous Model-Based Engineering of Software-Intensive Systems: Approaches,...
Hugo Bruneliere
 
Chemokines and Receptors Overview – Key to Immune Cell Signaling
Benjamin Lewis Lewis
 
Structure and uses of DDT, Saccharin..pptx
harsimrankaur204
 
Q1 - W1 - D2 - Models of matter for science.pptx
RyanCudal3
 

Guidance, Please! Towards a Framework for RDF-based Constraint Languages.

  • 1. Guidance, Please! Towards a Framework for RDF-based Constraint Languages. Thomas Bosch, GESIS – Lebniz Institute for the Social Sciences Kai Eckert, Stuttgart Media University
  • 2. Prerequisites • For RDF data, we want to express constraints, as it is common for XML files using for example XML Schema: „Every Book must have at least one author.“ • Several languages exist or are in development that support this, for instance Description Set Profiles, OWL 2 (despite not intended to be a constraint language), Shape Expressions or Resource Shapes. • For the further development of constraint languages, the DCMI RDF Application Profiles task group collected requirements in a public database. Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 2
  • 3. http://purl.org/net/rdf-application-profiles Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 3
  • 4. September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 4
  • 5. Disclaimer: This is not an accurate visualization! Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 5
  • 6. A publication needs an author! OWL 2: Publication a owl:Restriction ; owl:minQualifiedCardinality 1 ; owl:onProperty author ; owl:onClass Person . ShEx: Publication { author @Person{1, } } ReSh: Publication a rs:ResourceShape ; rs:property [ rs:propertyDefinition author ; rs:valueShape Person ; rs:occurs rs:One-or-many ; ] . DSP: [ dsp:resourceClass Publication ; dsp:statementTemplate [ dsp:minOccur 1 ; dsp:property author ; dsp:nonLiteralConstraint [ dsp:valueClass Person ] ] ] . Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 6
  • 7. Let‘s spin…. SPIN: CONSTRUCT { [ a spin:ConstraintViolation ... . ] } WHERE { ?this a ?C1 ; ?p ?o . BIND ( qualifiedCardinality( ?this, ?p, ?C2 ) AS ?c ) . BIND( STRDT ( STR ( ?c ), xsd:nonNegativeInteger ) AS ?cardinality ) . FILTER ( ?cardinality < 1 ) . FILTER ( ?C1 = Publication ) . FILTER ( ?C2 = Person ) . FILTER ( ?p = author ) . } SPIN function qualifiedCardinality: SELECT ( COUNT ( ?arg1 ) AS ?c ) WHERE { ?arg1 ?arg2 ?o . ?o a ?arg3 . } Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 7
  • 8. From high-level to low-level Low Level Language: Constraint Validation SPIN/SPARQL High Level Languages: Constraint Formulation DSP OWL 2 ReSh ShEx SPIN SPARQL Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 8
  • 9. Mapping from DSP to SPIN using SPARQL CONSTRUCT { _:constraintViolation a spin:ConstraintViolation ; rdfs:label ?violationMessage ; spin:violationRoot ?this ; spin:violationPath ?property ; spin:violationSource ?violationSource . } WHERE { ?this a ?resourceClass . ?descriptionTemplate dsp:resourceClass ?resourceClass ; dsp:statementTemplate ?statementTemplate . ?statementTemplate dsp:minOccur ?minimum ; dsp:property ?property ; dsp:nonLiteralConstraint ?nonLiteralConstraint . ?nonLiteralConstraint dsp:valueClass ?valueClass . BIND ( qualifiedCardinality( ?this, ?property, ?valueClass ) AS ?cardinality ) . FILTER ( ?cardinality < ?minimum ) . } SPIN SPARQL Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 9
  • 10. Step by step: Constraint validation using DSP 1. Write down your data constraints: :authorNeeded dsp:resourceClass Publication ; dsp:statementTemplate [ dsp:minOccur 1 ; dsp:property author ; dsp:nonLiteralConstraint [ dsp:valueClass Person ] ]. 2. Create a mapping from DSP to SPARQL: • As shown before. • One mapping per DSP element. • This only has to be done once for DSP. 3. Load constraints and mappings and execute the validation using SPIN.  This was our approach in our DC-2014 paper and is implemented in our demo: http://purl.org/net/rdfval-demo Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 10
  • 11. Challenge 1 A SPIN mapping constitutes two different aspects: 1. The definition of each language element (e.g. dsp:minOccur). 2. The definition of the violation that is created when validation fails. The latter might be application specific. A consistent violation representation across mappings is desirable.  How can we ensure that two semantically equivalent constraints are actually validated consistently? Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 11
  • 12. Challenge 2 Many constraint languages exist. Semantically equivalent constraints can be mapped from one language to another. But: Supporting 5 languages requires 20 mappings, 10 languages require already 90 mappings, generally 𝑛 ∙ 𝑛 − 1 mappings (both directions) are required. Every single language element need to be mapped. This is not feasible practically.  How can we support the transformation of semantically equivalent constraints from one constraint language to another? Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 12
  • 13. Adding an additional layer Low Level Language: Constraint Validation SPIN/SPARQL Intermediate Representation: Constraint Type (Requirement) RDF Constraints Vocabulary (RDF-CV) High Level Languages: Constraint Formulation DSP OWL 2 ReSh ShEx SPIN SPARQL SPIN SPARQL Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. September, 2nd 2015 13
  • 14. RDF-CV building blocks Constraints are either… • Simple Constraints or • Complex Constraints. Complex Constraints contain Simple Constraints and/or other Complex Constraints. September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 14
  • 15. Representing simple constraints September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 15 „Syntactical“ description of the constraint based on a constraining element and up to 5 parameters: 1. Context class: the class for which the constraint applies 2. Left property list: Depending on the constraining element the left side. 3. Right property list: the right side. 4. Classes: A class restriction for the constrained value. 5. Constraining value: a value to be used in the constraint. Examples: context class left p. list right p. list classes c. element c. value Publication author - Person ≥ 1 context class left p. list right p. list classes c. element c. value ⊤ authorOf, genre authorOfGenre ⊤ property path -
  • 16. RDF-CV specification The list of all 103 constraining elements and the representation of all 81 constraint types using RDF-CV is available in a technical report: Bosch, T., Nolle, A., Acar, E., & Eckert, K. (2015). RDF Validation Requirements - Evaluation and Logical Underpinning. Computing Research Repository (CoRR), abs/1501.03933. (http://arxiv.org/abs/1501.03933) September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 16
  • 17. Mapping implementation Example constraint: :Publication a owl:Restriction ; owl:minQualifiedCardinality 1 ; owl:onProperty :author ; owl:onClass :Person . RDF-CV: [ a rdfcv:SimpleConstraint ; rdfcv:contextClass :Publication ; rdfcv:leftProperties ( :author ) ; rdfcv:classes ( :Person ) ; rdfcv:constrainingElement "minimum qualified cardinality restriction" ; rdfcv:constrainingValue 1 ] . September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 17
  • 18. Mapping 1: To and from RDF-CV • Using the usual SPARQL CONSTRUCT queries, we create the RDF-CV representation (Mapping m). • To support transformations from one constraint language to another, another mapping m‘ from RDF-CV back to the constraint language is added. gc = mα (scα ) scβ = m´β (gc)  This enables constraint transformations in a scalable way (Challenge 2). September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 18
  • 19. Mapping 2: From RDF-CV to SPIN • From RDF-CV, the SPIN representation can be created as usual. • This mapping only has to be created only once. • It contains the definition how exactly the constraint violations are created. Depending on the application, different mappings can of course be used.  This ensures that irrespective of the constraint language, semantically equivalent constraints are validated consistently (Challenge 1). September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 19
  • 20. Conclusion We think that this approach is suitable • to implement the validation of constraints consistently across constraint languages, • to support the extension of constraint languages when additional constraint types should be supported by means of a simple mapping, and • to enhance or rather establish the interoperability of different constraint languages. September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 20
  • 21. Thank you! Acknowledgements: Thanks to all participants in the DCMI RDF Application Profiles task group and particularly the chairs, Karen Coyle and Antoine Isaac. September, 2nd 2015Bosch, Eckert: Guidance, please! Towards a Framework for RDF-based Constraint Languages. 21
  • 22. Licence These slides are licensed according to the Creative Commons Attribution-ShareAlike Licence http://creativecommons.org/licenses/by-sa/3.0 September, 2nd 2015Eckert: JudaicaLink 22