ShEx (Shape Expressions) is a language for expressing constraints on RDF graphs. We consider the problem of SPARQL query containment in the presence of ShEx constraints. We first propose a sound and complete procedure for the problem of containment with ShEx, considering several SPARQL fragments. Particularly our procedure considers OPTIONAL query patterns, that turns out to be an important fragment to be studied with schemas. We then show the complexity bounds of our problem with respect to the fragments considered. To the best of our knowledge, this is the first work addressing SPARQL query containment in the presence of ShEx constraints.
The document describes the SHACL Test-Suite, which provides a framework for testing SHACL shape schemas and validators. The test-suite structure includes a main manifest file that includes other test folders, each with their own manifest. Manifest files follow the W3C standard practice and describe test entries that validate data against schemas, match nodes to shapes, and test schema formatting. The test-suite is available online and on GitHub, and the working group is seeking contributions to expand the included tests.
Towards an RDF Validation Language based on Regular Expression DerivativesJose Emilio Labra Gayo
Towards an RDF Validation Language based on Regular Expression Derivatives
Author: Jose Emilio Labra Gayo
Slides presented at: Linked Web Data Management Workshop
Brussels, 27th March, 2015
This document discusses using ShEx and SHACL to validate and describe RDF data shapes. It summarizes the WebIndex linked data portal which uses ShEx expressions to define and validate its data model. It also outlines some applications of SHACL for validation and future work on standardizing ShEx and SHACL.
ShEx is a language for validating RDF data. It allows defining shapes that specify constraints on nodes and triples. ShEx expressions can be used to validate if RDF graphs conform to the defined shapes. The ShEx language is inspired by languages like RelaxNG and provides different serialization formats like ShExC, ShExJ, and ShExR. There are open-source implementations of ShEx validators in languages like JavaScript, Scala, Ruby, Python, and Java. ShEx provides a concise way to define RDF shapes and validate instance data against those shapes.
- SPARQL is a query language for retrieving and manipulating data stored in RDF format. It is similar to SQL but for RDF data.
- SPARQL queries contain prefix declarations, specify a dataset using FROM, and include a graph pattern in the WHERE clause to match triples.
- The main types of SPARQL queries are SELECT, ASK, DESCRIBE, and CONSTRUCT. SELECT returns variable bindings, ASK returns a boolean, DESCRIBE returns a description of a resource, and CONSTRUCT generates an RDF graph.
Although RDF is a corner stone of semantic web and knowledge graphs, it has not been embraced by everyday programmers and software architects who need to safely create and access well-structured data. There is a lack of common tools and methodologies that are available in more conventional settings to improve data quality by defining schemas that can later be validated. Two technologies have recently been proposed for RDF validation: Shape Expressions (ShEx) and Shapes Constraint Language (SHACL). In the talk, we will review the history and motivation of both technologies. We will also and enumerate some challenges and future work with regards to RDF validation.
Semantic Web technologies (such as RDF and SPARQL) excel at bringing together diverse data in a world of independent data publishers and consumers. Common ontologies help to arrive at a shared understanding of the intended meaning of data.
However, they don’t address one critically important issue: What does it mean for data to be complete and/or valid? Semantic knowledge graphs without a shared notion of completeness and validity quickly turn into a Big Ball of Data Mud.
The Shapes Constraint Language (SHACL), an upcoming W3C standard, promises to help solve this problem. By keeping semantics separate from validity, SHACL makes it possible to resolve a slew of data quality and data exchange issues.
Presented at the Lotico Berlin Semantic Web Meetup.
The document describes the SHACL Test-Suite, which provides a framework for testing SHACL shape schemas and validators. The test-suite structure includes a main manifest file that includes other test folders, each with their own manifest. Manifest files follow the W3C standard practice and describe test entries that validate data against schemas, match nodes to shapes, and test schema formatting. The test-suite is available online and on GitHub, and the working group is seeking contributions to expand the included tests.
Towards an RDF Validation Language based on Regular Expression DerivativesJose Emilio Labra Gayo
Towards an RDF Validation Language based on Regular Expression Derivatives
Author: Jose Emilio Labra Gayo
Slides presented at: Linked Web Data Management Workshop
Brussels, 27th March, 2015
This document discusses using ShEx and SHACL to validate and describe RDF data shapes. It summarizes the WebIndex linked data portal which uses ShEx expressions to define and validate its data model. It also outlines some applications of SHACL for validation and future work on standardizing ShEx and SHACL.
ShEx is a language for validating RDF data. It allows defining shapes that specify constraints on nodes and triples. ShEx expressions can be used to validate if RDF graphs conform to the defined shapes. The ShEx language is inspired by languages like RelaxNG and provides different serialization formats like ShExC, ShExJ, and ShExR. There are open-source implementations of ShEx validators in languages like JavaScript, Scala, Ruby, Python, and Java. ShEx provides a concise way to define RDF shapes and validate instance data against those shapes.
- SPARQL is a query language for retrieving and manipulating data stored in RDF format. It is similar to SQL but for RDF data.
- SPARQL queries contain prefix declarations, specify a dataset using FROM, and include a graph pattern in the WHERE clause to match triples.
- The main types of SPARQL queries are SELECT, ASK, DESCRIBE, and CONSTRUCT. SELECT returns variable bindings, ASK returns a boolean, DESCRIBE returns a description of a resource, and CONSTRUCT generates an RDF graph.
Although RDF is a corner stone of semantic web and knowledge graphs, it has not been embraced by everyday programmers and software architects who need to safely create and access well-structured data. There is a lack of common tools and methodologies that are available in more conventional settings to improve data quality by defining schemas that can later be validated. Two technologies have recently been proposed for RDF validation: Shape Expressions (ShEx) and Shapes Constraint Language (SHACL). In the talk, we will review the history and motivation of both technologies. We will also and enumerate some challenges and future work with regards to RDF validation.
Semantic Web technologies (such as RDF and SPARQL) excel at bringing together diverse data in a world of independent data publishers and consumers. Common ontologies help to arrive at a shared understanding of the intended meaning of data.
However, they don’t address one critically important issue: What does it mean for data to be complete and/or valid? Semantic knowledge graphs without a shared notion of completeness and validity quickly turn into a Big Ball of Data Mud.
The Shapes Constraint Language (SHACL), an upcoming W3C standard, promises to help solve this problem. By keeping semantics separate from validity, SHACL makes it possible to resolve a slew of data quality and data exchange issues.
Presented at the Lotico Berlin Semantic Web Meetup.
These slides are a brief update on the status of the work of the current SPARQL Working Group. "SPARQL 1.1" collectively refers to the upcoming versions of the SPARQL query language, SPARQL update language, and other deliverables of the 2nd (current) SPARQL Working Group.
This presentation was given at the International Workshop on Interacting with Linked Data (ILD 2012) co-located with the 9th Extended Semantic Web Conference 2012, Heraklion, and is related the publication of the same title.
Much research has been done to combine the fields of Data-bases and Natural Language Processing. While many works focus on the problem of deriving a structured query for a given natural language question, the problem of query verbalization -- translating a structured query into natural language -- is less explored. In this work we describe our approach to verbalizing SPARQL queries in order to create natural language expressions that are readable and understandable by the human day-to-day user. These expressions are helpful when having search engines that generate SPARQL queries for user-provided natural language questions or keywords. Displaying verbalizations of generated queries to a user enables the user to check whether the right question has been understood. While our approach enables verbalization of only a subset of SPARQL 1.1, this subset applies to 90% of the 209 queries in our training set. These observations are based on a corpus of SPARQL queries consisting of datasets from the QALD-1 challenge and the ILD2012 challenge.
The publication is available at http://www.aifb.kit.edu/images/b/b7/VerbalizingSparqlQueries.pdf
An introduction to the XPath XML query possibilities. In particular, there is a focus on the abbreviations that makes XPath efficient to use. A larger section is allocated to explain and illustrated the use of axes in XPath
The document discusses the RDF data model. The key points are:
1. RDF represents data as a graph of triples consisting of a subject, predicate, and object. Triples can be combined to form an RDF graph.
2. The RDF data model has three types of nodes - URIs to identify resources, blank nodes to represent anonymous resources, and literals for values like text strings.
3. RDF graphs can be merged to integrate data from multiple sources in an automatic way due to RDF's compositional nature.
The document discusses RDF Shapes, which are used to describe and validate RDF data. It provides examples of using ShEx and SHACL to define shapes for RDF graphs and validate instance data against those shapes. Key points covered include the differences between ShEx and SHACL, such as ShEx focusing on defining structures while SHACL adds target declarations, and how both can be used to generate validation reports.
This document provides an introduction and examples for SHACL (Shapes Constraint Language), a W3C recommendation for validating RDF graphs. It defines key SHACL concepts like shapes, targets, and constraint components. An example shape validates nodes with a schema:name and schema:email property. Constraints like minCount, maxCount, datatype, nodeKind, and logical operators like and/or are demonstrated. The document is an informative tutorial for learning SHACL through examples.
SPIN is a vocabulary that represents SPARQL queries and constraints as RDF triples. This allows SPARQL queries to be stored and shared on the semantic web. SPIN can be used to define SPARQL constraints, rules, functions and reusable query templates. Storing SPARQL queries as RDF triples provides benefits like referential integrity, managing namespaces centrally, and facilitating the easy sharing of queries on the semantic web.
This document discusses and compares graph data structures represented as linked data/RDF and property graphs. It provides examples of linked data/RDF graphs using Turtle syntax and JSON-LD, and how they can be queried with SPARQL. It also demonstrates how to represent the same graph data as a property graph using TinkerPop and Gremlin, and how the graph can be queried using Gremlin and Cypher languages. Key graph concepts like nodes, edges, and properties are also introduced.
This document provides an overview of SHACL (Shapes Constraint Language), a W3C recommendation for defining constraints on RDF graphs. It defines key SHACL concepts like shapes, targets, node shapes, property shapes and constraint components. Examples are provided to illustrate shape definitions and how validation of an RDF graph works against the defined shapes. The document summarizes the motivation for SHACL and inputs that influenced its development.
The document discusses the W3C stack for representing metadata, with XML providing syntax but no semantics, RDF and RDF Schema defining a data model for relations between resources and a vocabulary definition language, and OWL adding more expressivity with concepts such as classes, properties, and cardinality restrictions. It also covers RDF syntaxes like Turtle and XML, and how RDF can represent implied claims from XML and facilitate interoperability between systems through its abstract model.
This document introduces Shape Expressions, a language for validating and transforming RDF data. Shape Expressions allows users to describe the topology of RDF data through shapes that define the structure and types of subjects, properties and objects. Shapes can then be used to validate if an RDF graph conforms to a given shape. The language is demonstrated through an example of representing issues and users in an issue tracking system using RDF, and defining shapes to validate the data and check for errors. Key features of Shape Expressions include the use of labels, conjunctions, references to other shapes, and cardinalities to describe RDF patterns to match against.
This document provides an outline for a WWW 2012 tutorial on schema mapping with SPARQL 1.1. The outline includes sections on why data integration is important, schema mapping, translating RDF data with SPARQL 1.1, and common mapping patterns. Mapping patterns discussed include simple renaming, structural patterns like renaming based on property existence or value, value transformation using SPARQL functions, and aggregation. The tutorial aims to show how SPARQL 1.1 can be used to express executable mappings between different data schemas and representations.
Two graph data models : RDF and Property Graphsandyseaborne
This document provides an overview of two graph data models: RDF and Property Graphs. It describes the key components of each model, including triples for RDF and nodes/edges/properties for Property Graphs. It also discusses Apache projects that work with each model like Apache Jena for RDF and Apache TinkerPop, Spark, Giraph and Flink for Property Graphs. Finally, it notes that while the models have different focuses, they could potentially share technologies like storage and query capabilities.
This document provides an overview of software architectures for semantic web applications, including local access, mixed access, and remote access architectures. Local access architectures involve storing and querying RDF data locally using a triplestore and API. Remote access architectures involve querying RDF data owned by a third party using the SPARQL Protocol over HTTP or SOAP. The SPARQL Protocol is an abstract specification for remotely executing SPARQL queries in a standards-based way.
Twinkle is a GUI tool for writing and running SPARQL queries against local files, remote files, Jena databases, and SPARQL endpoints. It allows inferencing using RDFS, OWL, and Jena rules. Configuration is done declaratively using the Jena assembler API. Twinkle utilizes the ARQ SPARQL query engine and provides additional functions and property libraries. Future plans include improved documentation, access control, caching, and syntax highlighting.
SPARQL Query Verbalization for Explaining Semantic Search Engine QueriesBasil Ell
This presentation was given at the 11th Extended Semantic Web Conference (ESWC '14), Anissaras/Heronissou, Crete, Greece, and is related the publication of the same title.
In this paper we introduce Spartiqulation, a system that translates SPARQL queries into English text. Our aim is to allow casual end users of semantic applications with limited to no expertise in the SPARQL query language to interact with these applications in a more intuitive way. The verbalization approach exploits domain-independent template-based natural language generation techniques, as well as linguistic cues in labels and URIs.
"SPARQL Cheat Sheet" is a short collection of slides intended to act as a guide to SPARQL developers. It includes the syntax and structure of SPARQL queries, common SPARQL prefixes and functions, and help with RDF datasets.
The "SPARQL Cheat Sheet" is intended to accompany the SPARQL By Example slides available at http://www.cambridgesemantics.com/2008/09/sparql-by-example/ .
SPARQL is a query language for retrieving and manipulating data stored in RDF format. It allows users to write queries against remote SPARQL endpoints to query RDF triples stored in a database. SPARQL queries are composed of triple patterns, similar to RDF triples, that can include variables to retrieve variable bindings from the queried data. Query results are returned as solutions that assign values to the variables. Common queries include SELECT, ASK, CONSTRUCT, and DESCRIBE. SPARQL endpoints provide programmatic access to issue SPARQL queries against remote SPARQL-accessible stores.
Selectivity Estimation for SPARQL Triple Patterns with Shape ExpressionsAbdullah Abbas
We optimize the evaluation of conjunctive SPARQL queries, on big RDF graphs, by taking advantage of ShEx schema constraints. Our optimization is based on computing ranks for query triple patterns, which indicates their order of execution. We first define a set of well-formed ShEx schemas, that possess interesting characteristics for SPARQL query optimization. We then define our optimization method by exploiting information extracted from a ShEx schema. The experimentations performed shows the advantages of applying our optimization on the top of an existing state-of-the-art query evaluation system.
This document provides an overview of SPARQL, the query language for the Semantic Web. SPARQL allows querying RDF data by matching triple patterns and combining them with operations like optional and union patterns. Key features discussed include the anatomy of SPARQL queries, matching RDF literals and numerical values, filtering solutions, and defining datasets with the FROM clause. The document also covers SPARQL result forms and resources for learning more about SPARQL implementations and extensions.
Comparison of features between ShEx (Shape Expressions) and SHACL (Shapes Constraint Language)
Changelog:
11/06/17
- Removed slides about compositionality
31/May/2017
- Added slide 30 about validation report
- Added slide 32 about stems
- Changed slides 7 and 8 adapting compact syntax to new operator .
23/05/2017:
Slide 14: Repaired typos in typos in sh:entailment, rdfs:range
21/05/2017:
- Slide 8. Changed the example to be an IRI and a datatype
- Added typically in slide 9
- Slide 10: Removed the phrase: "Target declarations can problematic when reusing/importing shapes"
and created slide 27 to talk about reuability
- Added slide 11 to talk about the differences in triggering validation
- Created slide 14 to talk about inference
- Renamed slide 15 as "Inference and triggering mechanism"
- Added slides 27 and 28 to talk about reuability
- Added slide 29 to talk about annotations
18/05/2017
- Slides 9 now includes an example using ShEx RDF vocabulary
- Slide 10 now says that target declarations are optional
- Slide 13 now says that some RDF Schema terms have special treatment in SHACL
- Example in slide 18 now uses sh:or instead of sh:and
- Added slides 22, 23 and 24 which show some features supported by SHACL but not supported by ShEx (property pair constraints, uniqueLang and owl:imports)
SPARQL introduction and training (130+ slides with exercices)Thomas Francart
Full SPARQL training
Covers all SPARQL : basic graph patterns, FILTERs, functions, property paths, optional, negation, assignation, aggregation, subqueries, federated queries.
Does not cover except SPARQL updates.
Includes exercices on DBPedia.
CC BY license
These slides are a brief update on the status of the work of the current SPARQL Working Group. "SPARQL 1.1" collectively refers to the upcoming versions of the SPARQL query language, SPARQL update language, and other deliverables of the 2nd (current) SPARQL Working Group.
This presentation was given at the International Workshop on Interacting with Linked Data (ILD 2012) co-located with the 9th Extended Semantic Web Conference 2012, Heraklion, and is related the publication of the same title.
Much research has been done to combine the fields of Data-bases and Natural Language Processing. While many works focus on the problem of deriving a structured query for a given natural language question, the problem of query verbalization -- translating a structured query into natural language -- is less explored. In this work we describe our approach to verbalizing SPARQL queries in order to create natural language expressions that are readable and understandable by the human day-to-day user. These expressions are helpful when having search engines that generate SPARQL queries for user-provided natural language questions or keywords. Displaying verbalizations of generated queries to a user enables the user to check whether the right question has been understood. While our approach enables verbalization of only a subset of SPARQL 1.1, this subset applies to 90% of the 209 queries in our training set. These observations are based on a corpus of SPARQL queries consisting of datasets from the QALD-1 challenge and the ILD2012 challenge.
The publication is available at http://www.aifb.kit.edu/images/b/b7/VerbalizingSparqlQueries.pdf
An introduction to the XPath XML query possibilities. In particular, there is a focus on the abbreviations that makes XPath efficient to use. A larger section is allocated to explain and illustrated the use of axes in XPath
The document discusses the RDF data model. The key points are:
1. RDF represents data as a graph of triples consisting of a subject, predicate, and object. Triples can be combined to form an RDF graph.
2. The RDF data model has three types of nodes - URIs to identify resources, blank nodes to represent anonymous resources, and literals for values like text strings.
3. RDF graphs can be merged to integrate data from multiple sources in an automatic way due to RDF's compositional nature.
The document discusses RDF Shapes, which are used to describe and validate RDF data. It provides examples of using ShEx and SHACL to define shapes for RDF graphs and validate instance data against those shapes. Key points covered include the differences between ShEx and SHACL, such as ShEx focusing on defining structures while SHACL adds target declarations, and how both can be used to generate validation reports.
This document provides an introduction and examples for SHACL (Shapes Constraint Language), a W3C recommendation for validating RDF graphs. It defines key SHACL concepts like shapes, targets, and constraint components. An example shape validates nodes with a schema:name and schema:email property. Constraints like minCount, maxCount, datatype, nodeKind, and logical operators like and/or are demonstrated. The document is an informative tutorial for learning SHACL through examples.
SPIN is a vocabulary that represents SPARQL queries and constraints as RDF triples. This allows SPARQL queries to be stored and shared on the semantic web. SPIN can be used to define SPARQL constraints, rules, functions and reusable query templates. Storing SPARQL queries as RDF triples provides benefits like referential integrity, managing namespaces centrally, and facilitating the easy sharing of queries on the semantic web.
This document discusses and compares graph data structures represented as linked data/RDF and property graphs. It provides examples of linked data/RDF graphs using Turtle syntax and JSON-LD, and how they can be queried with SPARQL. It also demonstrates how to represent the same graph data as a property graph using TinkerPop and Gremlin, and how the graph can be queried using Gremlin and Cypher languages. Key graph concepts like nodes, edges, and properties are also introduced.
This document provides an overview of SHACL (Shapes Constraint Language), a W3C recommendation for defining constraints on RDF graphs. It defines key SHACL concepts like shapes, targets, node shapes, property shapes and constraint components. Examples are provided to illustrate shape definitions and how validation of an RDF graph works against the defined shapes. The document summarizes the motivation for SHACL and inputs that influenced its development.
The document discusses the W3C stack for representing metadata, with XML providing syntax but no semantics, RDF and RDF Schema defining a data model for relations between resources and a vocabulary definition language, and OWL adding more expressivity with concepts such as classes, properties, and cardinality restrictions. It also covers RDF syntaxes like Turtle and XML, and how RDF can represent implied claims from XML and facilitate interoperability between systems through its abstract model.
This document introduces Shape Expressions, a language for validating and transforming RDF data. Shape Expressions allows users to describe the topology of RDF data through shapes that define the structure and types of subjects, properties and objects. Shapes can then be used to validate if an RDF graph conforms to a given shape. The language is demonstrated through an example of representing issues and users in an issue tracking system using RDF, and defining shapes to validate the data and check for errors. Key features of Shape Expressions include the use of labels, conjunctions, references to other shapes, and cardinalities to describe RDF patterns to match against.
This document provides an outline for a WWW 2012 tutorial on schema mapping with SPARQL 1.1. The outline includes sections on why data integration is important, schema mapping, translating RDF data with SPARQL 1.1, and common mapping patterns. Mapping patterns discussed include simple renaming, structural patterns like renaming based on property existence or value, value transformation using SPARQL functions, and aggregation. The tutorial aims to show how SPARQL 1.1 can be used to express executable mappings between different data schemas and representations.
Two graph data models : RDF and Property Graphsandyseaborne
This document provides an overview of two graph data models: RDF and Property Graphs. It describes the key components of each model, including triples for RDF and nodes/edges/properties for Property Graphs. It also discusses Apache projects that work with each model like Apache Jena for RDF and Apache TinkerPop, Spark, Giraph and Flink for Property Graphs. Finally, it notes that while the models have different focuses, they could potentially share technologies like storage and query capabilities.
This document provides an overview of software architectures for semantic web applications, including local access, mixed access, and remote access architectures. Local access architectures involve storing and querying RDF data locally using a triplestore and API. Remote access architectures involve querying RDF data owned by a third party using the SPARQL Protocol over HTTP or SOAP. The SPARQL Protocol is an abstract specification for remotely executing SPARQL queries in a standards-based way.
Twinkle is a GUI tool for writing and running SPARQL queries against local files, remote files, Jena databases, and SPARQL endpoints. It allows inferencing using RDFS, OWL, and Jena rules. Configuration is done declaratively using the Jena assembler API. Twinkle utilizes the ARQ SPARQL query engine and provides additional functions and property libraries. Future plans include improved documentation, access control, caching, and syntax highlighting.
SPARQL Query Verbalization for Explaining Semantic Search Engine QueriesBasil Ell
This presentation was given at the 11th Extended Semantic Web Conference (ESWC '14), Anissaras/Heronissou, Crete, Greece, and is related the publication of the same title.
In this paper we introduce Spartiqulation, a system that translates SPARQL queries into English text. Our aim is to allow casual end users of semantic applications with limited to no expertise in the SPARQL query language to interact with these applications in a more intuitive way. The verbalization approach exploits domain-independent template-based natural language generation techniques, as well as linguistic cues in labels and URIs.
"SPARQL Cheat Sheet" is a short collection of slides intended to act as a guide to SPARQL developers. It includes the syntax and structure of SPARQL queries, common SPARQL prefixes and functions, and help with RDF datasets.
The "SPARQL Cheat Sheet" is intended to accompany the SPARQL By Example slides available at http://www.cambridgesemantics.com/2008/09/sparql-by-example/ .
SPARQL is a query language for retrieving and manipulating data stored in RDF format. It allows users to write queries against remote SPARQL endpoints to query RDF triples stored in a database. SPARQL queries are composed of triple patterns, similar to RDF triples, that can include variables to retrieve variable bindings from the queried data. Query results are returned as solutions that assign values to the variables. Common queries include SELECT, ASK, CONSTRUCT, and DESCRIBE. SPARQL endpoints provide programmatic access to issue SPARQL queries against remote SPARQL-accessible stores.
Selectivity Estimation for SPARQL Triple Patterns with Shape ExpressionsAbdullah Abbas
We optimize the evaluation of conjunctive SPARQL queries, on big RDF graphs, by taking advantage of ShEx schema constraints. Our optimization is based on computing ranks for query triple patterns, which indicates their order of execution. We first define a set of well-formed ShEx schemas, that possess interesting characteristics for SPARQL query optimization. We then define our optimization method by exploiting information extracted from a ShEx schema. The experimentations performed shows the advantages of applying our optimization on the top of an existing state-of-the-art query evaluation system.
This document provides an overview of SPARQL, the query language for the Semantic Web. SPARQL allows querying RDF data by matching triple patterns and combining them with operations like optional and union patterns. Key features discussed include the anatomy of SPARQL queries, matching RDF literals and numerical values, filtering solutions, and defining datasets with the FROM clause. The document also covers SPARQL result forms and resources for learning more about SPARQL implementations and extensions.
Comparison of features between ShEx (Shape Expressions) and SHACL (Shapes Constraint Language)
Changelog:
11/06/17
- Removed slides about compositionality
31/May/2017
- Added slide 30 about validation report
- Added slide 32 about stems
- Changed slides 7 and 8 adapting compact syntax to new operator .
23/05/2017:
Slide 14: Repaired typos in typos in sh:entailment, rdfs:range
21/05/2017:
- Slide 8. Changed the example to be an IRI and a datatype
- Added typically in slide 9
- Slide 10: Removed the phrase: "Target declarations can problematic when reusing/importing shapes"
and created slide 27 to talk about reuability
- Added slide 11 to talk about the differences in triggering validation
- Created slide 14 to talk about inference
- Renamed slide 15 as "Inference and triggering mechanism"
- Added slides 27 and 28 to talk about reuability
- Added slide 29 to talk about annotations
18/05/2017
- Slides 9 now includes an example using ShEx RDF vocabulary
- Slide 10 now says that target declarations are optional
- Slide 13 now says that some RDF Schema terms have special treatment in SHACL
- Example in slide 18 now uses sh:or instead of sh:and
- Added slides 22, 23 and 24 which show some features supported by SHACL but not supported by ShEx (property pair constraints, uniqueLang and owl:imports)
SPARQL introduction and training (130+ slides with exercices)Thomas Francart
Full SPARQL training
Covers all SPARQL : basic graph patterns, FILTERs, functions, property paths, optional, negation, assignation, aggregation, subqueries, federated queries.
Does not cover except SPARQL updates.
Includes exercices on DBPedia.
CC BY license
SPARQL is a standardized query language for retrieving and manipulating data stored in RDF format. It was created by the RDF Data Access Working Group to provide querying of RDF stores. SPARQL supports four query forms: SELECT, CONSTRUCT, DESCRIBE, and ASK. It also defines a protocol for executing queries over HTTP. SPARQL has become a key technology for working with semantic data on the web.
This document proposes a hypergraph-based approach for optimizing SPARQL queries on RDF data. It first transforms an RDF graph into a hypergraph by grouping subjects and objects connected by the same predicate under a hyperedge for that predicate. It then rearranges the patterns in a SPARQL query based on the size of corresponding hyperedges to build a query path for efficient processing. The query is executed by looping through the rearranged patterns and extracting required subjects and objects from the hypergraph representation to find matching triples. Experimental results show this approach performs better than existing systems like RDF-3x, Jena and AllegroGraph.
Re-using Media on the Web: Media fragment re-mixing and playoutMediaMixerCommunity
A number of novel application ideas will be introduced based on the media fragment creation, specification and rights management technologies. Semantic search and retrieval allows us to organize sets of fragments by topical or conceptual relevance. These fragment sets can then be played out in a non-linear fashion to create a new media re-mix. We look at a server-client implementation supporting Media Fragments, before allowing the participants to take the sets of media they have selected and create their own re-mix.
[Master Thesis]: SPARQL Query Rewriting with PathsAbdullah Abbas
The Semantic Web provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries. It involves publishing in languages specifically designed for data like (RDF) Resource Description Framework. In order to access the published data, it offers a query language named SPARQL.
The goal of this study is to transform SPARQL queries to other SPARQL queries which can be executed more efficiently. Our main goal of transformation is to eliminate non-distinguished variables, which are source of extra complexity, where such elimination is possible. We rewrite SPARQL queries with property paths, which was introduced in SPARQL 1.1.
Optimized index structures for querying rdf from the webMahdi Atawneh
The document describes a paper that presents a new index structure for optimizing queries of RDF data from the web. It implemented the index structure in a software called YARS. The index contains a lexicon indexing strings and quad indexes for subject-predicate-object-context patterns. An experiment evaluated YARS' performance against other RDF stores on a dataset of 2.8 million triples, finding that YARS had better query response times than the other stores tested. The paper introduced an approach for optimizing RDF query processing from web data.
We propose a set of optimizations that can be applied to a given SPARQL query, and that guarantee that the optimized query has the same answers under bag semantics as the original query, provided that the queried RDF graph validates certain SHACL constraints. We prove the correctness of these optimizations and show how they can be propagated to larger queries while preserving answers. Further, we prove the confluence of rewritings that employ these optimizations, guaranteeing convergence to the same optimized query regardless of the rewriting order.
The formulation of constraints and the validation of RDF data against these constraints is a common requirement and a much sought-after feature, particularly as this is taken for granted in the XML world. Recently, RDF validation as a research field gained speed due to shared needs of data practitioners from a variety of domains. For constraint formulation and RDF data validation, several languages exist or are currently developed. Yet, none of the languages is able to meet all requirements raised by data professionals.
We have published a set of constraint types that are required by diverse stakeholders for data applications. We use these constraint types to gain a better understanding of the expressiveness of solutions, investigate the role that reasoning plays in practical data validation, and give directions for the further development of constraint languages.
We introduce a validation framework that enables to consistently execute RDF-based constraint languages on RDF data and to formulate constraints of any type in a way that mappings from high-level constraint languages to an intermediate generic representation can be created straight-forwardly. The framework reduces the representation of constraints to the absolute minimum, is based on formal logics, and consists of a very simple conceptual model with a small lightweight vocabulary. We demonstrate that using another layer on top of SPARQL ensures consistency regarding validation results and enables constraint transformations for each constraint type across RDF-based constraint languages.
Doctoral Examination at the Karlsruhe Institute of Technology (08.07.2016)Dr.-Ing. Thomas Hartmann
In this thesis, a validation framework is introduced that enables to consistently execute RDF-based constraint languages on RDF data and to formulate constraints of any type. The framework reduces the representation of constraints to the absolute minimum, is based on formal logics, consists of a small lightweight vocabulary, and ensures consistency regarding validation results and enables constraint transformations for each constraint type across RDF-based constraint languages.
In this webinar Thomas Cook, Sales Director, AnzoGraph DB, provides a history lesson on the origins of SPARQL, including its roots in the Semantic Web, and how linked open data is used to create Knowledge Graphs. Then, he dives into "What is RDF?", "What is a URI?" and "What is SPARQL?", wrapping up with a real-world demonstration via a Zeppelin notebook.
Federation and Navigation in SPARQL 1.1net2-project
This document discusses new features in SPARQL 1.1, including federation using the SERVICE operator and navigation using property paths. It provides an overview of the basics of SPARQL and the syntax and semantics of SPARQL 1.0 queries before explaining federation, which allows querying multiple datasets, and navigation, which allows navigating RDF graphs using regular expressions to match properties. It also discusses the evaluation procedures and complexity of these new features.
Semantics and optimisation of the SPARQL1.1 federation extensionOscar Corcho
Presentation done at ESWC2011 for the paper "Semantics and optimisation of the SPARQL1.1 federation extension". Buil-Aranda C, Arenas M, Corcho O. ESWC2011, May 2011, Hersonissos, Greece
The document discusses faceted search over ontology-enhanced RDF data. It formalizes faceted interfaces for querying RDF graphs that capture ontological information. It studies the expressivity and complexity of queries represented by faceted interfaces, and algorithms for generating and updating interfaces based on the underlying RDF and ontology information. The goal is to provide rigorous theoretical foundations for faceted search in the context of RDF and OWL 2 ontologies.
Abstract:
An increasing number of applications rely on RDF, OWL 2, and SPARQL for storing and querying data. SPARQL, however, is not targeted towards end-users, and suitable query interfaces are needed. Faceted search is a prominent approach for end-user data access, and several RDF-based faceted search systems have been developed. There is, however, a lack of rigorous theoretical underpinning for faceted search in the context of RDF and OWL 2. In this paper, we provide such solid foundations. We formalise faceted interfaces for this context, identify a fragment of first-order logic capturing the underlying queries, and study the complexity of answering such queries for RDF and OWL 2 profiles. We then study interface generation and update, and devise efficiently implementable algorithms. Finally, we have implemented and tested our faceted search algorithms for scalability, with encouraging results.
This document introduces SPARQL, the SPARQL query language used to retrieve and manipulate RDF data. It provides an example SPARQL query to return full names from a sample RDF graph. It then describes what a SPARQL Service Description is, which is a vocabulary for discovering and describing SPARQL services and endpoints. It outlines several properties and classes used in SPARQL Service Descriptions.
This presentation looks in detail at SPARQL (SPARQL Protocol and RDF Query Language) and introduces approaches for querying and updating semantic data. It covers the SPARQL algebra, the SPARQL protocol, and provides examples for reasoning over Linked Data. We use examples from the music domain, which can be directly tried out and ran over the MusicBrainz dataset. This includes gaining some familiarity with the RDFS and OWL languages, which allow developers to formulate generic and conceptual knowledge that can be exploited by automatic reasoning services in order to enhance the power of querying.
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language Biswanath Dutta
In this tutorial, we show how to query the RDF triple store. SPARQL is a RDF query language and also a protocol for SPARQL query on Web which enables the search on SPARQL endpoint.
Similar to SPARQL Query Containment with ShEx Constraints (20)
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Physiology and chemistry of skin and pigmentation, hairs, scalp, lips and nail, Cleansing cream, Lotions, Face powders, Face packs, Lipsticks, Bath products, soaps and baby product,
Preparation and standardization of the following : Tonic, Bleaches, Dentifrices and Mouth washes & Tooth Pastes, Cosmetics for Nails.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
SPARQL Query Containment with ShEx Constraints
1. SPARQL Query Containment with ShEx Constraints
SPARQL Query Containment with
ShEx Constraints
21st European Conference on Advances in Databases and
Information Systems (ADBIS 2017)
Abdullah Abbas
Pierre Genevès
Cécile Roisin
Nabil Layaïda
24 - 27 September 2017
1/32
13. SPARQL Query Containment with ShEx Constraints
Motivation:
SPARQL query containment is well studied in the
literature.
Query containment is useful for query planning and
optimization.
7/32
14. SPARQL Query Containment with ShEx Constraints
Motivation:
SPARQL query containment is well studied in the
literature.
Query containment is useful for query planning and
optimization.
RDF documents in real life applications are constrained.
ShEx is an emerging schema language (FHIR, WebIndex).
Containment without constraints → False negatives
7/32
15. SPARQL Query Containment with ShEx Constraints
Motivation:
SPARQL query containment is well studied in the
literature.
Query containment is useful for query planning and
optimization.
RDF documents in real life applications are constrained.
ShEx is an emerging schema language (FHIR, WebIndex).
Containment without constraints → False negatives
Purpose:
SPARQL query containment in the presence of ShEx
constraints.
7/32
16. SPARQL Query Containment with ShEx Constraints
Motivation:
SPARQL query containment is well studied in the
literature.
Query containment is useful for query planning and
optimization.
RDF documents in real life applications are constrained.
ShEx is an emerging schema language (FHIR, WebIndex).
Containment without constraints → False negatives
Purpose:
SPARQL query containment in the presence of ShEx
constraints.
How?
We benefit from existing containment solvers, and ShEx
validators. We apply novel query transformations that does
not increase the complexity of containment.
7/32
19. SPARQL Query Containment with ShEx Constraints
Introduction
Containment Overview
Containment Overview
Query 1 Query 2
For any dataset, the results of Query 1 are contained in the
results of Query 2.
10/32
20. SPARQL Query Containment with ShEx Constraints
Introduction
Containment Overview
Containment Overview
Query 1 Query 2
For any dataset, the results of Query 1 are contained in the
results of Query 2.
Containment Solver:
Q1
Q2
Containment
Solver
(𝑸 𝟏 ⊑ 𝑸 𝟐)
(𝑸 𝟏 ⋢ 𝑸 𝟐)
No
Yes
Input queries Results
10/32
21. SPARQL Query Containment with ShEx Constraints
Introduction
Containment Overview
Containment Overview
Query 1 Query 2
For any dataset, the results of Query 1 are contained in the
results of Query 2.
Example:
RDF Data (Big)
SELECT* {
?x name ?name.
?x role manager. }
Query 1
SELECT * {
?x name ?name.
?x role ?role. }
Query 2 Query 2 Results
Query 1 Results
10/32
22. SPARQL Query Containment with ShEx Constraints
Introduction
Containment Overview
Containment Overview
Query 1 Query 2
For any dataset, the results of Query 1 are contained in the
results of Query 2.
Example:
RDF Data (Big)
SELECT* {
?x name ?name.
?x role manager. }
Query 1
SELECT * {
?x name ?name.
?x role ?role. }
Query 2 Query 2 Results
Query 1 Results
10/32
23. SPARQL Query Containment with ShEx Constraints
Introduction
ShEx (Shape Expressions)
ShEx (Shape Expressions)
What is ShEx?
ShEx is an RDF constraint language.
Validate RDF documents
ShEx uses logical operators to define constraints inductively:
e ::= | Σ × Γ | e∗ | e[m;n] | (e|e ) | (e e )
11/32
24. SPARQL Query Containment with ShEx Constraints
Introduction
ShEx (Shape Expressions)
ShEx (Shape Expressions)
ShEx is an RDF constraint language.
Validate RDF documents
Definition (ShEx Expression)
Given a set of edge labels (Σ), and a set of types (Γ), then
Σ × Γ is a shape expression. ShEx uses logical operators to
define constraints inductively:
e ::= | Σ × Γ | e∗ | e[m;n] | (e|e ) | (e e )
Definition (ShEx Schema)
A ShEx schema is a tuple S = (Σ, Γ, δ), where δ is a type
definition function that maps elements of Γ to shape
expressions e over Σ × Γ.
12/32
25. SPARQL Query Containment with ShEx Constraints
Introduction
ShEx (Shape Expressions)
Containment with ShEx Definition
Containment with ShEx: Query 1 S Query 2
For any dataset valid with respect to the ShEx schema S, the
results of Query 1 are contained in the results of Query 2.
Containment Solver:
Q1
Q2
Containment
Solver
(𝑸 𝟏 ⊑ 𝑺 𝑸 𝟐)
(𝑸 𝟏 ⋢ 𝑺 𝑸 𝟐)
No
Yes
Input queries & schema Results
Schema (S)
13/32
26. SPARQL Query Containment with ShEx Constraints
Introduction
ShEx (Shape Expressions)
Containment with ShEx Definition
Containment with ShEx: Query 1 S Query 2
For any dataset valid with respect to the ShEx schema S, the
results of Query 1 are contained in the results of Query 2.
Containment Solver:
Q1
Q2
Containment
Solver
(𝑸 𝟏 ⊑ 𝑺 𝑸 𝟐)
(𝑸 𝟏 ⋢ 𝑺 𝑸 𝟐)
No
Yes
Input queries & schema Results
Schema (S)
Why query containment with ShEx?
More containment cases can be inferred.
13/32
29. SPARQL Query Containment with ShEx Constraints
Containment Examples with ShEx Constraints
SPARQL (Conjunctive)
SPARQL (Conjunctive)
Query 1 (No results)
SELECT * WHERE {
?p :named ?name .
?p :likes "tennis". }
Query 2
SELECT * WHERE {
?p :named ?name .
?p :plays "soccer" }
Query 1 Query 2
More Containment with ShEx?
ShEx Schema (S)
<Person> {
:named xsd:string ;
:plays xsd:string }
Query 1 S Query 2
15/32
30. SPARQL Query Containment with ShEx Constraints
Containment Examples with ShEx Constraints
SPARQL (with OPTIONALs)
SPARQL (with OPTIONALs)
OPTIONAL patterns in queries are more interesting for
query static analysis with constraints:
Semantics: Only get extended results if available.
16/32
35. SPARQL Query Containment with ShEx Constraints
Containment Examples with ShEx Constraints
SPARQL (with OPTIONALs)
Well-designed OPTIONAL Fragment
Definition:
For every subpattern q = (q1 OPT q2) of q and every variable
x occurring in q, it holds that: if x occurs inside q2 and outside
q , then x also occurs inside q1.
Containment of the w.d. OPT fragment is studied. A sound and
complete procedure is available [Leterlier et al., 2012].
+ UNION at top level.
Representation as pattern trees:
((P1 OPT (P11 OPT P111 OPT P112)) OPT P12) OPT P13
P1
P11 P12 P13
P111 P112 19/32
40. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
Query Transformation
Query Transformation
3- Validate Against Schema S (Part 1)
{
:x :producer :p1 .
:x :feature "feature 1"
}
OPTIONAL
{
:x :feature "feature 2" .
:x :expiryDate :d
}
Not Valid? → Query is equivalent to the empty query!
Valid? → Validate Against Schema S (Part 1 and 2)
22/32
41. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
Query Transformation
Query Transformation
3- Validate Against Schema S (Part 1 and 2)
{
:x :producer :p1 .
:x :feature "feature 1" .
}
OPTIONAL
{
:x :feature "feature 2" .
:x :expiryDate :d
}
Not Valid? → Eliminate (Part 2) only!
Valid? → Keep the query as it is!
22/32
42. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
ShEx Schema Transformation
ShEx Schema Transformation
Minimal cardinality constraints should be ignored since the
query is not a complete representation of the data.
Example
Assume a ShEx constraint: At least three skills for each person.
Assume a query pattern: {:p1 :skill ?x}
The presence of only one triple is not a violation, the RDF data may
still have three skills for :p1.
Thus minimal cardinality constraints must be ignored.
MIN0(.) is a transformation function that takes a ShEx
document and returns another ShEx document ignoring all
minimal cardinalities.
23/32
43. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
Containment Procedure Summary
Containment Procedure Summary
Step 1: (Transformation)
Eliminate pattern tree nodes that are not valid.
Minimal cardinalities are not considered.
Query 1 Query 2
Step 2: (Containment)
Check the new modified queries for containment.
24/32
44. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
Containment Procedure Summary
Containment Procedure Summary
Step 1: (Transformation)
Eliminate pattern tree nodes that are not valid.
Minimal cardinalities are not considered.
Query 1 Query 2
Step 2: (Containment)
Check the new modified queries for containment.
Results:
T(Query 1) T(Query 2) ≡ Query 1 S Query 2
24/32
45. SPARQL Query Containment with ShEx Constraints
Containment Procedure Definition
Complexity
Implementation and Theoretical Complexity
Implementation
Queries and ShEx documents transformation implemented using java.
ShEx validator, available from [Boneva et al., 2014] (NP-c)
Containment Solver, available from [Pichler and Skritek, 2014]. (ΠP
2-c)
Complexity of SPARQL containment with ShEx
SPARQL Fragment Without(ShEx) With(ShEx)
BGP [Chandra, 1977] NP-c NP-c
AND-OPT [Pichler, 2014] NP-c NP-c
AND-OPT-(UNION) [Pichler, 2014] ΠP
2-c ΠP
2-c
25/32
47. SPARQL Query Containment with ShEx Constraints
Alternative Method
Alternative Method
We reduce query containment with ShEx into:
FOL (First Order Logic) formula satisfiability.
FOL with only two variable is a decidable FOL fragment
with NEXP-c satisfiability complexity.
It supports SPARQL fragment extensions.
Q1
Q2
Queries encoding
function
Schema encoding
function
Schema (S)
FOLAutomated
Theorem Prover
(𝜻)
𝓐(𝑸 𝟏)⋀¬𝓐(𝑸 𝟐)
axioms
conjecture
FOL
(𝑸 𝟏 ⊑ 𝑺 𝑸 𝟐)
(𝑸 𝟏 ⋢ 𝑺 𝑸 𝟐)
Result
FOL Problem
satisfiable
FOL Problem
unsatisfiable
27/32
48. SPARQL Query Containment with ShEx Constraints
Alternative Method
Alternative Method
We reduce query containment with ShEx into:
FOL (First Order Logic) formula satisfiability.
FOL with only two variable is a decidable FOL fragment
with NEXP-c satisfiability complexity.
It supports SPARQL fragment extensions.
Method 1 Method 2 (FOL)
SPARQL Fragment Without/With(ShEx) Without/With(ShEx)
BGP NP-Complete NEXP
AND-OPT NP-Complete NEXP
AND-OPT-(UNION) ΠP
2-Complete NEXP
AND-OPT-(UNION)-Minus [not supported] NEXP
AND-OPT-(UNION)-FILTER [not supported] NEXP
AND-OPT-(UNION)-PP [not supported] NEXP
AND-OPT-(UNION)-MINUS-FILTER-PP [not supported] NEXP
27/32
49. SPARQL Query Containment with ShEx Constraints
Alternative Method
Alternative Method
We reduce query containment with ShEx into:
FOL (First Order Logic) formula satisfiability.
FOL with only two variable is a decidable FOL fragment
with NEXP-c satisfiability complexity.
It supports SPARQL fragment extensions.
Method 1 Method 2 (FOL)
SPARQL Fragment Without/With(ShEx) Without/With(ShEx)
BGP NP-Complete NEXP
AND-OPT NP-Complete NEXP
AND-OPT-(UNION) ΠP
2-Complete NEXP
AND-OPT-(UNION)-Minus [not supported] NEXP
AND-OPT-(UNION)-FILTER [not supported] NEXP
AND-OPT-(UNION)-PP [not supported] NEXP
AND-OPT-(UNION)-MINUS-FILTER-PP [not supported] NEXP
Method 2 is more complex but supports more fragments
27/32
50. SPARQL Query Containment with ShEx Constraints
Alternative Method
Implementations Tests
2 implementations:
Method 1 (Validation+Containment)
Method 2 (FOL)
Test Queries from the Berlin SPARQL Benchmark
Hand-crafted ShEx schemas
Execution Time (with Method 1) ≈ 800 ms
Execution Time (with Method 2) ≈ 400 ms
Available implementations of FOL automated theorem provers
are highly optimized and efficient!
28/32
52. SPARQL Query Containment with ShEx Constraints
Conclusion
Conclusion
Motivation: SPARQL query containment with ShEx
constraints is important (due to constrained databases).
With ShEx more containment cases can be inferred.
30/32
53. SPARQL Query Containment with ShEx Constraints
Conclusion
Conclusion
Motivation: SPARQL query containment with ShEx
constraints is important (due to constrained databases).
With ShEx more containment cases can be inferred.
Contribution 1: We defined a sound and complete
procedure for SPARQL query containment with ShEx
constraints.
30/32
54. SPARQL Query Containment with ShEx Constraints
Conclusion
Conclusion
Motivation: SPARQL query containment with ShEx
constraints is important (due to constrained databases).
With ShEx more containment cases can be inferred.
Contribution 1: We defined a sound and complete
procedure for SPARQL query containment with ShEx
constraints.
Contribution 2: We provided the complexity bounds of
the problem considered. (ΠP
2-c for AND-OPT-(UNION))
30/32
55. SPARQL Query Containment with ShEx Constraints
Conclusion
Conclusion
Motivation: SPARQL query containment with ShEx
constraints is important (due to constrained databases).
With ShEx more containment cases can be inferred.
Contribution 1: We defined a sound and complete
procedure for SPARQL query containment with ShEx
constraints.
Contribution 2: We provided the complexity bounds of
the problem considered. (ΠP
2-c for AND-OPT-(UNION))
Contribution 3: We implemented the procedure in a
java framework using an existing ShEx validator and an
existing containment solver.
30/32
56. SPARQL Query Containment with ShEx Constraints
Conclusion
Conclusion
Motivation: SPARQL query containment with ShEx
constraints is important (due to constrained databases).
With ShEx more containment cases can be inferred.
Contribution 1: We defined a sound and complete
procedure for SPARQL query containment with ShEx
constraints.
Contribution 2: We provided the complexity bounds of
the problem considered. (ΠP
2-c for AND-OPT-(UNION))
Contribution 3: We implemented the procedure in a
java framework using an existing ShEx validator and an
existing containment solver.
Contribution 4: Alternative method for extending the
SPARQL fragment (reducing to FOL satisfiability).
30/32
57. SPARQL Query Containment with ShEx Constraints
Conclusion
Further Perspectives
In Application:
There exist many FOL automated theorem provers that
participate annually in competitions.
Only 1 containment solver for the AND-OPT-(UNION)
fragment is available. [Pichler and Skritek, 2014]
Using available FOL automated theorem provers allowed
for more efficient problem solving implementations (even
for small fragments).
Perspective:
It is clear that there exists a space to make better
implementations of the containment solver and/or of
the ShEx validator.
31/32