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.
GraphFrames: DataFrame-based graphs for Apache® Spark™Databricks
These slides support the GraphFrames: DataFrame-based graphs for Apache Spark webinar. In this webinar, the developers of the GraphFrames package will give an overview, a live demo, and a discussion of design decisions and future plans. This talk will be generally accessible, covering major improvements from GraphX and providing resources for getting started. A running example of analyzing flight delays will be used to explain the range of GraphFrame functionality: simple SQL and graph queries, motif finding, and powerful graph algorithms.
In a world where compute is paramount, it is all too easy to overlook the importance of storage and IO in the performance and optimization of Spark jobs.
GraphFrames: DataFrame-based graphs for Apache® Spark™Databricks
These slides support the GraphFrames: DataFrame-based graphs for Apache Spark webinar. In this webinar, the developers of the GraphFrames package will give an overview, a live demo, and a discussion of design decisions and future plans. This talk will be generally accessible, covering major improvements from GraphX and providing resources for getting started. A running example of analyzing flight delays will be used to explain the range of GraphFrame functionality: simple SQL and graph queries, motif finding, and powerful graph algorithms.
In a world where compute is paramount, it is all too easy to overlook the importance of storage and IO in the performance and optimization of Spark jobs.
The presentation begins with an overview of the growth of non-structured data and the benefits NoSQL products provide. It then provides an evaluation of the more popular NoSQL products on the market including MongoDB, Cassandra, Neo4J, and Redis. With NoSQL architectures becoming an increasingly appealing database management option for many organizations, this presentation will help you effectively evaluate the most popular NoSQL offerings and determine which one best meets your business needs.
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
ORC files were originally introduced in Hive, but have now migrated to an independent Apache project. This has sped up the development of ORC and simplified integrating ORC into other projects, such as Hadoop, Spark, Presto, and Nifi. There are also many new tools that are built on top of ORC, such as Hive’s ACID transactions and LLAP, which provides incredibly fast reads for your hot data. LLAP also provides strong security guarantees that allow each user to only see the rows and columns that they have permission for.
This talk will discuss the details of the ORC and Parquet formats and what the relevant tradeoffs are. In particular, it will discuss how to format your data and the options to use to maximize your read performance. In particular, we’ll discuss when and how to use ORC’s schema evolution, bloom filters, and predicate push down. It will also show you how to use the tools to translate ORC files into human-readable formats, such as JSON, and display the rich metadata from the file including the type in the file and min, max, and count for each column.
The Semantic Web #9 - Web Ontology Language (OWL)Myungjin Lee
This is a lecture note #9 for my class of Graduate School of Yonsei University, Korea.
It describes Web Ontology Language (OWL) for authoring ontologies.
File Format Benchmarks - Avro, JSON, ORC, & ParquetOwen O'Malley
Hadoop Summit June 2016
The landscape for storing your big data is quite complex, with several competing formats and different implementations of each format. Understanding your use of the data is critical for picking the format. Depending on your use case, the different formats perform very differently. Although you can use a hammer to drive a screw, it isn’t fast or easy to do so. The use cases that we’ve examined are: * reading all of the columns * reading a few of the columns * filtering using a filter predicate * writing the data Furthermore, it is important to benchmark on real data rather than synthetic data. We used the Github logs data available freely from http://githubarchive.org We will make all of the benchmark code open source so that our experiments can be replicated.
The landscape for storing your big data is quite complex, with several competing formats and different implementations of each format. Understanding your use of the data is critical for picking the format. Depending on your use case, the different formats perform very differently. Although you can use a hammer to drive a screw, it isn’t fast or easy to do so.
The use cases that we’ve examined are:
* reading all of the columns
* reading a few of the columns
* filtering using a filter predicate
* writing the data
Furthermore, different kinds of data have distinct properties. We've used three real schemas:
* the NYC taxi data http://tinyurl.com/nyc-taxi-analysis
* the Github access logs http://githubarchive.org
* a typical sales fact table with generated data
Finally, the value of having open source benchmarks that are available to all interested parties is hugely important and all of the code is available from Apache.
Donald Miner will do a quick introduction to Apache Hadoop, then discuss the different ways Python can be used to get the job done in Hadoop. This includes writing MapReduce jobs in Python in various different ways, interacting with HBase, writing custom behavior in Pig and Hive, interacting with the Hadoop Distributed File System, using Spark, and integration with other corners of the Hadoop ecosystem. The state of Python with Hadoop is far from stable, so we'll spend some honest time talking about the state of these open source projects and what's missing will also be discussed.
Understanding InfluxDB’s New Storage EngineInfluxData
Learn more about InfluxDB’s new storage engine! The team developed a cloud-native, real-time, columnar database optimized for time series data. We built it all in Rust and it sits on top of Apache Arrow and DataFusion. We chose Apache Parquet as the persistent format, which is an open source columnar data file format. This new storage engine provides InfluxDB Cloud users with new functionality, including the removal of cardinality limits, so developers can bring in massive amounts of time series data at scale.
In this webinar, Anais Dotis-Georgiou will dive into:
Requirements for rebuilding InfluxDB’s core
Key product features and timeline
How Apache Arrow’s ecosystem is used to meet those requirements
Stick around for a demo and live Q&A
Curso DSpace - Desenvolvimento e Administração de Repositórios Digitais - Treinamento realizado pela Quatro Elementos, conforme site abaixo:
http://quatroelementos.com.br/dspace
Usage of Linked Data: Introduction and Application ScenariosEUCLID project
This presentation introduces the main principles of Linked Data, the underlying technologies and background standards. It provides basic knowledge for how data can be published over the Web, how it can be queried, and what are the possible use cases and benefits. As an example, we use the development of a music portal (based on the MusicBrainz dataset), which facilitates access to a wide range of information and multimedia resources relating to music.
This presentation focuses on providing means for exploring Linked Data. In particular, it gives an overview of current visualization tools and techniques, looking at semantic browsers and applications for presenting the data to the end used. We also describe existing search options, including faceted search, concept-based search and hybrid search, based on a mix of using semantic information and text processing. Finally, we conclude with approaches for Linked Data analysis, describing how available data can be synthesized and processed in order to draw conclusions.
The presentation begins with an overview of the growth of non-structured data and the benefits NoSQL products provide. It then provides an evaluation of the more popular NoSQL products on the market including MongoDB, Cassandra, Neo4J, and Redis. With NoSQL architectures becoming an increasingly appealing database management option for many organizations, this presentation will help you effectively evaluate the most popular NoSQL offerings and determine which one best meets your business needs.
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
ORC files were originally introduced in Hive, but have now migrated to an independent Apache project. This has sped up the development of ORC and simplified integrating ORC into other projects, such as Hadoop, Spark, Presto, and Nifi. There are also many new tools that are built on top of ORC, such as Hive’s ACID transactions and LLAP, which provides incredibly fast reads for your hot data. LLAP also provides strong security guarantees that allow each user to only see the rows and columns that they have permission for.
This talk will discuss the details of the ORC and Parquet formats and what the relevant tradeoffs are. In particular, it will discuss how to format your data and the options to use to maximize your read performance. In particular, we’ll discuss when and how to use ORC’s schema evolution, bloom filters, and predicate push down. It will also show you how to use the tools to translate ORC files into human-readable formats, such as JSON, and display the rich metadata from the file including the type in the file and min, max, and count for each column.
The Semantic Web #9 - Web Ontology Language (OWL)Myungjin Lee
This is a lecture note #9 for my class of Graduate School of Yonsei University, Korea.
It describes Web Ontology Language (OWL) for authoring ontologies.
File Format Benchmarks - Avro, JSON, ORC, & ParquetOwen O'Malley
Hadoop Summit June 2016
The landscape for storing your big data is quite complex, with several competing formats and different implementations of each format. Understanding your use of the data is critical for picking the format. Depending on your use case, the different formats perform very differently. Although you can use a hammer to drive a screw, it isn’t fast or easy to do so. The use cases that we’ve examined are: * reading all of the columns * reading a few of the columns * filtering using a filter predicate * writing the data Furthermore, it is important to benchmark on real data rather than synthetic data. We used the Github logs data available freely from http://githubarchive.org We will make all of the benchmark code open source so that our experiments can be replicated.
The landscape for storing your big data is quite complex, with several competing formats and different implementations of each format. Understanding your use of the data is critical for picking the format. Depending on your use case, the different formats perform very differently. Although you can use a hammer to drive a screw, it isn’t fast or easy to do so.
The use cases that we’ve examined are:
* reading all of the columns
* reading a few of the columns
* filtering using a filter predicate
* writing the data
Furthermore, different kinds of data have distinct properties. We've used three real schemas:
* the NYC taxi data http://tinyurl.com/nyc-taxi-analysis
* the Github access logs http://githubarchive.org
* a typical sales fact table with generated data
Finally, the value of having open source benchmarks that are available to all interested parties is hugely important and all of the code is available from Apache.
Donald Miner will do a quick introduction to Apache Hadoop, then discuss the different ways Python can be used to get the job done in Hadoop. This includes writing MapReduce jobs in Python in various different ways, interacting with HBase, writing custom behavior in Pig and Hive, interacting with the Hadoop Distributed File System, using Spark, and integration with other corners of the Hadoop ecosystem. The state of Python with Hadoop is far from stable, so we'll spend some honest time talking about the state of these open source projects and what's missing will also be discussed.
Understanding InfluxDB’s New Storage EngineInfluxData
Learn more about InfluxDB’s new storage engine! The team developed a cloud-native, real-time, columnar database optimized for time series data. We built it all in Rust and it sits on top of Apache Arrow and DataFusion. We chose Apache Parquet as the persistent format, which is an open source columnar data file format. This new storage engine provides InfluxDB Cloud users with new functionality, including the removal of cardinality limits, so developers can bring in massive amounts of time series data at scale.
In this webinar, Anais Dotis-Georgiou will dive into:
Requirements for rebuilding InfluxDB’s core
Key product features and timeline
How Apache Arrow’s ecosystem is used to meet those requirements
Stick around for a demo and live Q&A
Curso DSpace - Desenvolvimento e Administração de Repositórios Digitais - Treinamento realizado pela Quatro Elementos, conforme site abaixo:
http://quatroelementos.com.br/dspace
Usage of Linked Data: Introduction and Application ScenariosEUCLID project
This presentation introduces the main principles of Linked Data, the underlying technologies and background standards. It provides basic knowledge for how data can be published over the Web, how it can be queried, and what are the possible use cases and benefits. As an example, we use the development of a music portal (based on the MusicBrainz dataset), which facilitates access to a wide range of information and multimedia resources relating to music.
This presentation focuses on providing means for exploring Linked Data. In particular, it gives an overview of current visualization tools and techniques, looking at semantic browsers and applications for presenting the data to the end used. We also describe existing search options, including faceted search, concept-based search and hybrid search, based on a mix of using semantic information and text processing. Finally, we conclude with approaches for Linked Data analysis, describing how available data can be synthesized and processed in order to draw conclusions.
This presentation covers the whole spectrum of Linked Data production and exposure. After a grounding in the Linked Data principles and best practices, with special emphasis on the VoID vocabulary, we cover R2RML, operating on relational databases, Open Refine, operating on spreadsheets, and GATECloud, operating on natural language. Finally we describe the means to increase interlinkage between datasets, especially the use of tools like Silk.
This presentation addresses the main issues of Linked Data and scalability. In particular, it provides gives details on approaches and technologies for clustering, distributing, sharing, and caching data. Furthermore, it addresses the means for publishing data trough could deployment and the relationship between Big Data and Linked Data, exploring how some of the solutions can be transferred in the context of Linked Data.
Big Linked Data - Creating Training CurriculaEUCLID project
This presentation includes an overview of the basic rules to follow when developing training and education curricula for Linked Data and Big Linked Data
This presentation gives details on technologies and approaches towards exploiting Linked Data by building LD applications. In particular, it gives an overview of popular existing applications and introduces the main technologies that support implementation and development. Furthermore, it illustrates how data exposed through common Web APIs can be integrated with Linked Data in order to create mashups.
Manager une boite de Geeks est très particulier. Ces salariés d'un genre à part veulent des nouvelles technos, du temps pour expérimenter, partager la connaissance, faire du Pair Programming, participer à la stratégie d'entreprise et une vraie liberté de parole.
Speaker : Luc Legardeur, Président de Xebia, à Devoxx France 2015
Introduction to the Data Web, DBpedia and the Life-cycle of Linked DataSören Auer
Over the past 4 years, the Semantic Web activity has gained momentum with the widespread publishing of structured data as RDF. The Linked Data paradigm has therefore evolved from a practical research idea into
a very promising candidate for addressing one of the biggest challenges
of computer science: the exploitation of the Web as a platform for data
and information integration. To translate this initial success into a
world-scale reality, a number of research challenges need to be
addressed: the performance gap between relational and RDF data
management has to be closed, coherence and quality of data published on
the Web have to be improved, provenance and trust on the Linked Data Web
must be established and generally the entrance barrier for data
publishers and users has to be lowered. This tutorial will discuss
approaches for tackling these challenges. As an example of a successful
Linked Data project we will present DBpedia, which leverages Wikipedia
by extracting structured information and by making this information
freely accessible on the Web. The tutorial will also outline some recent advances in DBpedia, such as the mappings Wiki, DBpedia Live as well as
the recently launched DBpedia benchmark.
This is a lecture note #10 for my class of Graduate School of Yonsei University, Korea.
It describes SPARQL to retrieve and manipulate data stored in Resource Description Framework format
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference InformationKai Schlegel
Presentation for 5th International Workshop on
Data Engineering meets the Semantic Web (DESWeb)
In conjunction with ICDE 2014, Chicago IL, USA, March 31, 2014 held by Kai Schlegel
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
3. Agenda
1. Introduction to SPARQL
2. Querying Linked Data with SPARQL
3. SPARQL Algebra
4. Updating Linked Data with SPARQL 1.1
5. SPARQL Protocol
6. Reasoning over Linked Data
3EUCLID - Querying Linked Data
5. SPARQL
EUCLID - Querying Linked Data 5
Semantic Web Stack
Berners-Lee (2006)
* Protocol and RDF Query Language
Declarative query language
6. SPARQL
EUCLID - Querying Linked Data 6
• SPARQL Query
– Declarative query language for RDF data
– http://www.w3.org/TR/rdf-sparql-query/
• SPARQL Algebra
– Standard for communication between SPARQL services and clients
– http://www.w3.org/2001/sw/DataAccess/rq23/rq24-algebra.html
• SPARQL Update
– Declarative manipulation language for RDF data
– http://www.w3.org/TR/sparql11-update/
• SPARQL Protocol
– Standard for communication between SPARQL services and clients
– http://www.w3.org/TR/sparql11-protocol/
7. SPARQL Query 1.1
EUCLID - Querying Linked Data 7
• SPARQL 1.0 only allows accessing the data (query)
• SPARQL 1.1 introduces:
Query extensions
Updates
• Data management:
Insert, Delete, Delete/Insert
• Graph management:
Create, Load, Clear, Drop, Copy, Move, A
dd
• Aggregates, Subqueries, Negation, E
xpressions in the SELECT
clause, Property
paths, assignment, short form for
CONSTRUCT, expanded set of
functions and operators
Federation extension • Service, values, service variables
(informative) CH 5
8. SPARQL Basics
EUCLID - Querying Linked Data 8
• RDF triple: Basic building block, of the form
subject, predicate, object. Example:
• RDF triple pattern: Contains one or more variables.
Examples:
• RDF quad pattern: Contains graph name: URI or variable.
Examples:
dbpedia:The_Beatles foaf:name "The Beatles" .
dbpedia:The_Beatles foaf:made ?album.
?album mo:track ?track .
?album ?p ?o .
GRAPH <:g> {:s :p :o .}
GRAPH ?g {dbpedia:The_Beatles foaf:name ?o.}
9. SPARQL Basics
EUCLID - Querying Linked Data 9
• RDF graph: Set of RDF assertions, manipulated as
a labeled directed graph.
• RDF data set: set of RDF triples. It is comprised of:
• One default graph
• Zero or more named graphs
• SPARQL protocol client: HTTP client that sends requests for
SPARQL Protocol operations (queries or updates)
• SPARQL protocol service: HTTP server that services requests for
SPARQL Protocol operations
• SPARQL endpoint: The URI at which a SPARQL Protocol service
listens for requests from SPARQL clients
11. SPARQL Query
EUCLID - Querying Linked Data 11
Main idea: Pattern matching
• Queries describe sub-graphs of the queried graph
• Graph patterns are RDF graphs specified in Turtle
syntax, which contain variables (prefixed by either “?” or “$”)
• Sub-graphs that match the graph patterns yield a
result
?albumdbpedia:
The_Beatles
foaf:made
15. SPARQL Query: Components
EUCLID - Querying Linked Data 15
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
FROM <http://musicbrainz.org/20130302>
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album a mo:Record ; dc:title ?title
}
ORDER BY ?title
Prologue:
• Prefix definitions
• Subtly different from Turtle syntax - the final period is not used
16. SPARQL Query: Components
EUCLID - Querying Linked Data 16
Query form:
• ASK, SELECT, DESCRIBE or CONSTRUCT
• SELECT retrieves variables and their bindings as a table
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
FROM <http://musicbrainz.org/20130302>
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album a mo:Record ; dc:title ?title
}
ORDER BY ?title
17. SPARQL Query: Components
EUCLID - Querying Linked Data 17
Data set specification:
• This clause is optional
• FROM or FROM NAMED
• Indicates the sources for the data against which to find matches
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
FROM <http://musicbrainz.org/20130302>
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album a mo:Record ; dc:title ?title
}
ORDER BY ?title
18. SPARQL Query: Components
EUCLID - Querying Linked Data 18
Query pattern:
• Defines patterns to match against the data
• Generalises Turtle with variables and keywords – N.B. final period optional
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
FROM <http://musicbrainz.org/20130302>
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album a mo:Record ; dc:title ?title
}
ORDER BY ?title
19. Solution modifier:
• Modify the result set
• ORDER BY, LIMIT or OFFSET re-organise rows;
• GROUP BY combines them
SPARQL Query: Components
EUCLID - Querying Linked Data 19
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album
FROM <http://musicbrainz.org/20130302>
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album a mo:Record ; dc:title ?title
}
ORDER BY ?title
20. Query Forms
EUCLID - Querying Linked Data 20
SPARQL supports different query forms:
• ASK tests whether or not a query pattern has a
solution. Returns yes/no
• SELECT returns variables and their bindings
directly
• CONSTRUCT returns a single RDF graph specified
by a graph template
• DESCRIBE returns a single RDF graph containing
RDF data about resource
21. Query Form: ASK
EUCLID - Querying Linked Data 21
• Namespaces are added with the ‘PREFIX’ directive
• Statement patterns that make up the graph are
specified between brackets (“{}”)
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpedia-ont: <http://dbpedia.org/ontology/>
PREFIX mo: http://purl.org/ontology/mo/
ASK WHERE { dbpedia:The_Beatles mo:member
dbpedia:Paul_McCartney.}
Is Paul McCartney member of ‘The Beatles’?Query:
true
Results:
Is Elvis Presley member of ‘The Beatles’?Query:
false
Results:
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpedia-ont: <http://dbpedia.org/ontology/>
PREFIX mo: http://purl.org/ontology/mo/
ASK WHERE { dbpedia:The_Beatles mo:member
dbpedia:Elvis_Presley.}
22. Query Form: SELECT
EUCLID - Querying Linked Data 22
• The solution modifier projection nominates which
components of the matches should be returned
• “*” means all components should be returned
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album_name ?track_title
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name ;
mo:track ?track .
?track dc:title ?track_title .}
Query: What albums and tracks did ‘The Beatles’ make?
23. Filter expressions
• Different types of filters and functions may be used
Query Form: SELECT (2)
EUCLID - Querying Linked Data 23
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album_name ?track_title ?date ?duration
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name ;
mo:track ?track .
?track dc:title ?track_title ;
mo:duration ?duration;
FILTER (?duration>300000 && ?duration<400000) }
Query:
Filter: Comparison and logical operators
Retrieve the albums and tracks recorded by ‘The Beatles’, where the
duration of the song is more than 300 secs. and no longer than 400 secs.
24. Query Form: SELECT (3)
EUCLID - Querying Linked Data 24
Elimination of duplicates
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT MODIFIER ?album_name
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name .
mo:track ?track1 .
mo:track ?track2 .
FILTER (?track1 != ?track2) }
Retrieve the name of the albums recorded by ‘The Beatles’
which have at least two different songs.
Query:
?album
“Revolver”
“Sessions”
“Abbey Road”
?album
“Revolver”
“Revolver”
“Revolver”
“Sessions”
“Abbey Road”
“Abbey Road”
DISTINCT
Results:
REDUCED
MODIFIER= MODIFIER=
25. Aggregates
• Calculate aggregate values: COUNT, SUM, MIN, MAX, AVG,
GROUP_CONCAT and SAMPLE
• Built around the GROUP BY operator
• Prune at group level (cf. FILTER) using HAVING
Query Form: SELECT (4)
EUCLID - Querying Linked Data 25
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
SELECT ?album (SUM(?track_duration) AS ?album_duration)
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track .
?track mo:duration ?track_duration .
} GROUP BY ?album
HAVING (SUM(?track_duration) > 3600000)
Retrieve the duration of the albums recorded by ‘The Beatles’.Query:
26. Query Form: DESCRIBE
EUCLID - Querying Linked Data 26
Takes the resources within the solution, and provides
information about them as RDF statements. They can
be identified by:
• Specifying explicit IRIs
• Bindings of variables in the WHERE clause
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX mo: <http://purl.org/ontology/mo/>
DESCRIBE ?member
WHERE {
dbpedia:The_Beatles mo:member ?member .}
PREFIX dbpedia: <http://dbpedia.org/resource/>
DESCRIBE dbpedia:Paul_McCartney
27. EUCLID - Querying Linked Data 27
• CONSTRUCT WHERE: In order to query for a
subgraph, without change, it is no longer necessary
to repeat the graph pattern in the template
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track .}
Example:
Query Form: CONSTRUCT
29. EUCLID - Querying Linked Data 29
• Returns RDF statements created from variable
bindings
• Template: graph pattern with variables from the
query pattern
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT {
?album dc:creator dbpedia:The_Beatles .
?track dc:creator dbpedia:The_Beatles .}
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track .}
Create the dc:creator descriptions for albums and their tracks
recorded by ‘The Beatles’.Query:
Query Form: CONSTRUCT (2b)
30. Query Form: CONSTRUCT (3)
EUCLID - Querying Linked Data 30
Subsets of results
• It is possible to combine the query with solution modifiers
(ORDER BY, LIMIT, OFFSET)
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT {
?album dc:creator dbpedia:The_Beatles .
?track dc:creator dbpedia:The_Beatles .}
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track ;
dc:date ?date .
} ORDER BY DESC(?date)
LIMIT 10
Create the dc:creator descriptions for the 10 most recent
albums and their tracks recorded by ‘The Beatles’.Query:
31. Union Graph Pattern
• Allows the specification of alternatives (disjunctions)
EUCLID - Querying Linked Data 31
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: http://xmlns.com/foaf/0.1/
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT {
?album dc:creator dbpedia:The_Beatles .
?track dc:creator dbpedia:The_Beatles .}
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name .
{?album dbpedia-ont:recordedIn dbpedia:Abbey_Road_Studios .}
UNION
{?album dbpedia-ont:recordedIn dbpedia:Trident_Studios .}}
Create the dc:creator descriptions for the albums recorded by
‘The Beatles’ in ‘Abbey Road Studios’ or ‘Trident Studios’
Query:
Query Form: CONSTRUCT (4)
32. Filter expressions
• Different types of filters and functions may be used
EUCLID - Querying Linked Data 32
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
CONSTRUCT {?album dc:creator dbpedia:The_Beatles .}
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name ;
FILTER (REGEX(?album_name, ".*love.*", i)) }
Query:
Filter: Regular expressions over strings
Create the dc:creator descriptions of the albums recorded by
‘The Beatles’ whose title contains the word ‘love .
Query Form: CONSTRUCT (5)
33. Type of function Function Result type
Functional Forms
bound
IF
COALESCE
NOT EXISTS, EXISTS
or, and
RDFTerm-equal (=), sameTerm
IN, NOT IN
xsd:boolean
rdfTerm
rdfTerm
xsd:boolean
xsd:boolean
xsd:boolean
boolean
Functions on RDF Terms
isIRI, isBlank, isLiteral, isNumeric
str, lang,
datatype
IRI
BNODE
xsd:boolean
simple literal
iri
iri
blank node
Functions on Numerics ABS, ROUND, CEIL, FLOOR
RAND
numeric
xsd:double
Filter expressions
EUCLID - Querying Linked Data 33
Source:http://www.w3.org/TR/sparql11-query/#SparqlOps
Query Form: CONSTRUCT (6)
34. Type of function Function Result type
Functions on Strings STRLEN
SUBSTR, UCASE, LCASE
STRSTARTS, STRENDS, CONTAINS
STRBEFORE, STRAFTER
ENCODE_FOR_URI
CONCAT
langMatches
REGEX
REPLACE
xsd:integer
string literal
xsd:boolean
literal
simple literal
string literal
xsd:boolean
xsd:boolean
string literal
Functions on Dates and
Times
now
year, month, day, hours, minutes
seconds
timezone
tz
xsd:dateTime
xsd:integer
xsd:decimal
xsd:dayTimeDuration
simple literal
Filter expressions
EUCLID - Querying Linked Data 34
Source:http://www.w3.org/TR/sparql11-query/#SparqlOps
Query Form: CONSTRUCT (7)
35. Optional Graph Pattern
• OPTIONAL clause encloses the optional parts
• If variables in the construct clause are not bound in the optional,
the triple patterns with these variables are not generated
EUCLID - Querying Linked Data 35
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
CONSTRUCT {
?album dc:creator ?artist .
?picture dc:depicts ?artist . }
WHERE {
?artist foaf:made ?album .
OPTIONAL {?artist foaf:depiction ?picture .}}
Create the dc:creator and dc:depicts descriptions of artists.Query:
Query Form: CONSTRUCT (8)
36. Optional Graph Pattern
• Can test if variables are bound in filter expressions
• Solutions that meet the OPTIONAL clause can be filtered out by
using the logical filter NOT (!)
EUCLID - Querying Linked Data 36
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
CONSTRUCT { ?album dc:creator ?artist . }
WHERE {
?artist foaf:made ?album .
OPTIONAL {?artist dbpedia-owl:deathPlace ?place_of_death .}
FILTER (!BOUND(?place_of_death))
}
Create the dc:creator descriptions of those artists who are not
dead.
Query:
Query Form: CONSTRUCT (9)
NOT EXISTS {?artist dbpedia-owl:deathPlace ?place_of_death .}
37. Assigning Variables
• The value of an expression can be added to a solution mapping by
binding a new variable (which can be further used and returned)
• The BIND form allows to assign a value to a variable from a BGP
EUCLID - Querying Linked Data 37
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX dbpedia-ont: <http://dbpedia.org/ontology/>
CONSTRUCT { ?track dbpedia-ont:runtime ?secs .}
WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track .
?track mo:duration ?duration .
BIND((?duration/1000) AS ?secs) .}
Calculate the duration of the tracks from ms to s, and store the
value using the dbpedia-ont:runtime property .
Query:
Query Form: CONSTRUCT (10)
38. Sub-queries and Aggregate Values
• To combine the CONSTRUCT query form with aggregate values, a
sub-query should be created inside the WHERE clause
EUCLID - Querying Linked Data 38
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX mo: <http://purl.org/ontology/mo/>
CONSTRUCT {?album music-ont:duration ?album_duration .}
WHERE {
SELECT ?album (SUM(?track_duration) AS ?album_duration) {
dbpedia:The_Beatles foaf:made ?album .
?album mo:track ?track .
?track mo:duration ?track_duration .
} GROUP BY ?album
HAVING (SUM(?track_duration) > 3600000)}
Materialize the duration of the albums recorded by ‘The Beatles’.Query:
Query Form: CONSTRUCT (11)
40. Data Management
EUCLID - Querying Linked Data 40
SPARQL 1.1 provides data update operations:
• INSERT data: adds some triples, given inline in the request,
into a graph
• DELETE data: removes some triples, given inline in the
request, if the respective graphs contains those
• DELETE/INSERT data: uses in parallel INSERT and
DELETE
CH 1
CH 1
41. Data Management (2)
EUCLID - Querying Linked Data 41
INSERT data
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
INSERT DATA { GRAPH { <http://musicbrainz.org/20130302>
<http://musicbrainz.org/artist/b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d>
foaf:made <http://musicbrainz.org/release/3a685770-7326-34fc-9f18-e5f5626f3dc5> ,
< http://musicbrainz.org/release/cb6f8798-d51e-4fa5-a4d1-2c0602bfe1b6 > .
<http://musicbrainz.org/release/3a685770-7326-34fc-9f18-e5f5626f3dc5>
dc:title "Please Please Me".
< http://musicbrainz.org/release/cb6f8798-d51e-4fa5-a4d1-2c0602bfe1b6 >
dc:title "Something New". } }
Insert the following albums recorded byThe Beatles into the graph
http://musicbrainz.org/20130209-004702
CH 1
42. Data Management (3)
EUCLID - Querying Linked Data 42
DELETE data
Delete all the information about the album Casualities of The Beatles.
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
DELETE { ?album ?predicate ?object . }
WHERE {
<http://musicbrainz.org/artist/b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d>
foaf:made ?album .
?album dc:title "Casualities".
?album ?predicate ?object .}
CH 1
43. Data Management (4)
EUCLID - Querying Linked Data 43
DELETE/INSERT data
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX db-ont: <http://dbpedia.org/ontology/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
DELETE { dbpedia:The_Beatles db-ont:currentMember ?x . }
INSERT { GRAPH <http://musicbrainz.org/20130209-004702> {
dbpedia:The_Beatles db-ont:formerBandMember ?x .}
}
WHERE {
dbpedia:The_Beatles db-ont:currentMember ?x .
?x foaf:name "Peter Best" .}
Delete the status of ‘Peter Best’ as current member of´The Beatles´,
and insert his status as former member of the band.
44. Graph Management
EUCLID - Querying Linked Data 44
SPARQL 1.1 provides graph update operations:
• CREATE: creates an empty graph in the Graph Store
• LOAD: reads the content of a document into a graph in
the Graph Store
• CLEAR: removes all triples in one or more graphs
• DROP: removes the graph from the Graph Store
• Other operations: COPY, MOVE, ADD
45. Graph Management (2)
EUCLID - Querying Linked Data 45
CREATE
• Creates a new named graph
• Can be used with the DEFAULT and ALL keywords
LOAD
• An RDF graph can be loaded from a URL
• LOAD can be used with the SILENT keyword
CREATE GRAPH <http://musicbrainz.org/20130302>
LOAD <http://xmlns.com/foaf/spec/20100809.rdf>
LOAD <http://xmlns.com/foaf/spec/20100809.rdf>
INTO <http://xmlns.com/foaf/0.1/>
Named graph
46. Graph Management (3)
EUCLID - Querying Linked Data 46
CLEAR
• Removes all triples in the graph (it is emptied but not deleted!)
• The graph(s) can be specified with the following keywords:
DEFAULT, NAMED, ALL, GRAPH
• Can be used with the SILENT keyword
DROP
• The given graph is removed from the Graph Store, including its
content
• Can be used with the DEFAULT and ALL keywords
CLEAR GRAPH <http://musicbrainz.org/20130302>
DROP GRAPH <http://musicbrainz.org/20130302>
47. Graph Management (4)
EUCLID - Querying Linked Data 47
SPARQL 1.1 provides other graph management operations:
• COPY …TO …
• MOVE …TO …
• ADD …TO …
COPY GRAPH <http://musicbrainz.org/20130302>
TO GRAPH <http://musicbrainz.org/20130303>
MOVE GRAPH <http://musicbrainz.org/temp>
TO GRAPH <http://musicbrainz.org/20130303>
ADD GRAPH <http://musicbrainz.org/20130302>
TO GRAPH <http://musicbrainz.org/20130303>
49. SPARQL 1.1. Protocol
EUCLID - Querying Linked Data 49
• Consists of two operations: query and update
• An operation defines:
• The HTTP method (GET or POST)
• The HTTP query string parameters
• The message content included in the HTTP request body
• The message content included in the HTTP response body
SPARQL Client SPARQL Endpoint
Request
alt [no errors]
[else]
Success Response
Failure Response
50. EUCLID - Querying Linked Data 50
• Sends a SPARQL query to a service and receives the results of
the query
• The response is:
• May be invoked using HTTP GET or HTTP POST. The method
POST with URL encoding is mostly used when the query string
is too long
Query Operation
XML, JSON, CSV/TSV from a SELECT query
RDF/XML, Turtle from a CONSTRUCT query
51. EUCLID - Querying Linked Data 51
Example:
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX dbpedia-ont: <http://dbpedia.org/ontology/>
SELECT ?album
WHERE { ?album dbpedia-ont:artist dbpedia:The_Beatles .}
LIMIT 3
SPARQL Query:
Query Operation (2)
HTTP GET request:
Try this query!
(Click on the hurl icon)
52. Update Operation
EUCLID - Querying Linked Data 52
• Sends a SPARQL update request to a service
• Should be invoked using the HTTP PATCH/POST
method
• The response consists of a HTTP response status
code, which indicates success or failure of the
operation
54. Reasoning for
Linked Data Integration
EUCLID - Querying Linked Data 54
• Example: Integration of the MusicBrainz data set and
the DBpedia data set
Integration
Data set Data set
55. Reasoning for
Linked Data Integration
EUCLID - Querying Linked Data 55
mo:b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d
foaf:name The Beatles;
mo:member
mo:ba550d0e-adac-4864-b88b-407cab5e76af;
mo:member
mo:4d5447d7-c61c-4120-ba1b-d7f471d385b9;
mo:member
mo:42a8f507-8412-4611-854f-926571049fa0;
mo:member
mo:300c4c73-33ac-4255-9d57-4e32627f5e13.
dbpedia:The_Beatles
dbpedia-ont:origin dbpedia:Liverpool;
dbpedia-ont:genre dbpedia:Rock_music;
foaf:depiction .
Integration
Data set Data set
same
56. Reasoning for
Linked Data Integration
EUCLID - Querying Linked Data 56
mo:b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d
foaf:name The Beatles;
mo:member
mo:ba550d0e-adac-4864-b88b-407cab5e76af;
mo:member
mo:4d5447d7-c61c-4120-ba1b-d7f471d385b9;
mo:member
mo:42a8f507-8412-4611-854f-926571049fa0;
mo:member
mo:300c4c73-33ac-4255-9d57-4e32627f5e13.
dbpedia:The_Beatles
dbpedia-ont:origin dbpedia:Liverpool;
dbpedia-ont:genre dbpedia:Rock_music;
foaf:depiction .
same
SELECT ?m ?g WHERE {
dbpedia:The_Beatles
dbpedia-ont:genre ?g;
mo:member ?m.}
Query: ?m ?g
mo:ba550d0e-adac-4864-b88b-
407cab5e76af
dbpedia:Rock_music
mo:4d5447d7-c61c-4120-ba1b-
d7f471d385b9
dbpedia:Rock_music
mo42a8f507-8412-4611-854f-
926571049fa0;
dbpedia:Rock_music
mo300c4c73-33ac-4255-9d57-
4e32627f5e13
dbpedia:Rock_music
Result set:
57. SPARQL 1.1:
Entailment Regimes
EUCLID - Querying Linked Data 57
• SPARQL 1.0 was defined only for simple entailment
(pattern matching )
• SPARQL 1.1 is extended with entailment regimes other
than simple entailment:
– RDF entailment
– RDFS entailment
– D-Entailment
– OWL RL entailment
– OWL Full entailment
– OWL 2 DL, EL, and QL entailment
– RIF entailment
Source: http://www.w3.org/TR/rdf-mt/#RDFSRules
58. RDFS
EUCLID - Querying Linked Data 58
Resource Description Framework Schema
Semantic Web Stack
Berners-Lee (2006)
Taxonomies and inferences
60. rdfs2 – rdfs:domain
EUCLID - Querying Linked Data 60
dbpedia:
The_Beatles
dbpedia:
Paul_McCartney
SELECT ?x WHERE {
?x a mo:MusicGroup.}
mo:member rdfs:domain
mo:MusicGroup .
?x ?x
dbpedia:The_Beatles …
mo:member
Schema: Query:
Result set: Result set with inference:
dbpedia:
John_Lennon
dbpedia:
George_Harrison
dbpedia:
Ringo_Starr
mo:member mo:member
mo:member
61. rdfs3 – rdfs:range
EUCLID - Querying Linked Data 61
dbpedia:
The_Beatles
dbpedia:
Paul_McCartney
SELECT ?x WHERE {
?x a foaf:Agent.}
mo:member rdfs:range
foaf:Agent .
?x ?x
dbpedia:Paul_McCartney
dbpedia:John_Lennon
dbpedia:Ringo_Starr
dbpedia:George_Harrison …
dbpedia-ont:
bandMember
Schema: Query:
Result set: Result set with inference:
dbpedia:
John_Lennon
dbpedia:
George_Harrison
dbpedia:
Ringo_Starr
dbpedia-ont:
bandMember
dbpedia-ont:
bandMember
dbpedia-ont:
bandMember
62. rdfs7 – rdfs:subPropertyOf
EUCLID - Querying Linked Data 62
dbpedia:
Yesterday
dbpedia:
Paul_McCartney
SELECT ?x WHERE {
dbpedia:Yesterday mo:performer ?x.}
mo:singer rdfs:subPropertyOf
mo:performer .
?x
dbpedia:John_Lennon
dbpedia:Ringo_Starr
dbpedia:George_Harrison
?x
dbpedia:John_Lennon
dbpedia:Ringo_Starr
dbpedia:George_Harrison
dbpedia:Paul_McCartney
mo:singer
Schema: Query:
Result set: Result set with inference:
dbpedia:
John_Lennon
dbpedia:
George_Harrison
dbpedia:
Ringo_Starr
mo:performer mo:performermo:performer
mo:performer
63. rdfs9 – rdfs:subClassOf
EUCLID - Querying Linked Data 63
dbpedia:
The_Beatles
SELECT ?x WHERE {
?x a mo:MusicArtist.}
mo:MusicGroup rdfs:subClassOf
mo:MusicArtist .
?x ?x
dbpedia:The_Beatles …
Schema: Query:
Result set: Result set with inference:
mo:
MusicArtist
rdf:type
mo:
MusicGroup
rdf:type
64. Inference from Schema
EUCLID - Querying Linked Data 64
• Knowledge encoded in the schema leads to infer new
facts
• This is also captured in the set of axiomatic triples,
which provide basic meaning for all the vocabulary terms
mo:MusicGroup rdfs:subClassOf mo:MusicArtist .
mo:MusicGroup a rdfs:Class .
mo:MusicArtist a rdfs:Class .
Schema:
Inferred
facts:
rdfs:subClassOf rdfs:domain rdfs:Class .
rdfs:subClassOf rdfs:range rdfs:Class .
65. RDFS:
Lack of Consistency Check
EUCLID - Querying Linked Data 65
• It is possible to infer facts that seem incorrect facts,
but RDFS cannot prevent this:
Schema: mo:member rdfs:domain mo:MusicGroup ;
rdfs:range foaf:Agent .
Existing :PaulMcCartney a :SoloMusicArtist ;
facts: :member :TheBeatles .
Inferred :PaulMcCartney a :MusicGroup .
facts: No contradiction!:
The mis-modeling is
not diagnosed
rdfs2
66. • We might wish further inferences, but these are
beyond the entailment rules implemented by RDFS
RDFS:
Inference Limitations
EUCLID - Querying Linked Data 66
foaf:knows rdfs:domain foaf:Person ;
rdfs:range foaf:Person .
foaf:made rdfs:domain foaf:Agent .
:PaulMcCartney foaf:made :Yesterday ;
foaf:knows :RingoStarr .
:PaulMcCartney a foaf:Agent ;
a foaf:Person .
:RingoStarr a foaf:Person .
Schema:
Existing
fact:
Inferred
facts:
:Yesterday dc:creator :PaulMcCartney.
:RingoStarr foaf:knows :PaulMcCartney .
These inferences require OWL!
NOT
inferred:
Cannot model with
RDFS that ‘x knows y’
implies ‘y knows x’
Cannot model with
RDFS that if ‘x makes
y’ implies that ‘the
creator of y is x’
67. OWL
EUCLID - Querying Linked Data 67
Web Ontology Language
Semantic Web Stack
Berners-Lee (2006)
Ontologies and inferences
68. Introduction to OWL
EUCLID - Querying Linked Data 68
• Provides more ontological constructs and avoids some of
the potential confusion in RDFS
• OWL 2 is divided into sub-languages denominated
profiles:
– OWL 2 EL: Limited to basic
classification, but with polynomial-time
reasoning
– OWL 2 QL: Designed to be translatable
to relational database querying
– OWL 2 RL: Designed to be efficiently
implementable in rule-based systems
• Most triple stores concentrate on the use of RDFS with a
subset of OWL features, called OWL-Horst or RDFS++
More restrictive
than OWL DL
69. OWL Properties
EUCLID - Querying Linked Data 69
OWL distinguishes between two types of properties:
• OWL ObjectProperties: resources as values
• OWL DatatypeProperties: literals as values
:plays rdf:type owl:ObjectProperty;
rdfs:domain :Musician;
rdfs:range :Instrument .
:hasMembers rdf:type owl:DatatypeProperty;
rdfs:domain :MusicGroup
rdfs:range xsd:int .
70. PropertyAxioms
EUCLID - Querying Linked Data 70
• Property axioms include those from RDF Schema
• OWL allows for property equivalence. Example:
EquivalentObjectProperties(dbpedia-ont:bandMember mo:member)
dbpedia-ont:bandMember owl:equivalentProperty mo:member.
≡
dbpedia:
The_Beatles
dbpedia:
Paul_McCartney
mo:member
dbpedia:
John_Lennon
dbpedia:
George_Harrison
dbpedia:
Ringo_Starr
mo:member
mo:member
mo:member
SELECT ?x {dbpedia:The_Beatles
dbpedia-ont:bandMember ?x.}
Query:
?x
Result set:
?x
dbpedia:Paul_McCartney
dbpedia:John_Lennon
dbpedia:Ringo_Starr
dbpedia:George_Harrison
Result set with inference:
71. PropertyAxioms
EUCLID - Querying Linked Data 71
• Property axioms include those from RDF Schema
• OWL allows for property equivalence. Example:
EquivalentObjectProperties(dbpedia-ont:bandMember mo:member)
dbpedia-ont:bandMember owl:equivalentProperty mo:member.
• OWL allows for property disjointness. Example:
DisjointObjectProperty(dbpedia-ont:length mo:duration)
dbpedia-ont:length owl:propertyDisjointWith mo:duration.
• There is no standard for implementing inconsistency
reports under SPARQL
≡
≡
72. PropertyAxioms (2)
EUCLID - Querying Linked Data 72
OWL allows the definition of property characteristics to infer new
facts relating to instances and their properties
• Symmetry
• Transitivity
• Inverse
• Functional
• Inverse Functional
73. Property Axioms:
Symmetry
EUCLID - Querying Linked Data 73
dbpedia:
The_Beatles
dbpedia:
Billy_Preston
dbpedia:
Plastic_Ono_
Band :associatedMusicalArtist
a owl:SymmetricProperty .
?genre
dbpedia:Plastic_Ono_Band
?genre
dbpedia:Plastic_Ono_Band
dbpedia:Billy_Preston
:associatedMusicalArtist
Schema:
Result set: Result set with inference:
SELECT ?x WHERE {
dbpedia:The_Beatles
:associatedMusicalArtist ?x.}
Query:
:associatedMusicalArtist
74. Property Axioms:
Transitivity
EUCLID - Querying Linked Data 74
:Rock
:Heavy_
metal
:Black_
metal
:Punk_
rock
SELECT ?genre WHERE {
:Rock :subgenre ?genre .}
:subgenre a owl:TransitiveProperty .
?genre
:Heavy_metal
:Punk_rock
?genre
:Heavy_metal
:Punk_rock
:Black_metal
:subgenre :subgenre
:subgenre :subgenre
Schema:
Query:
Result set: Result set with inference:
75. Property Axioms:
Inverse
EUCLID - Querying Linked Data 75
SELECT ?x WHERE {
?x mo:member_of
dbpedia:The_Beatles .}
mo:member_of owl:inverseOf mo:member.
?x
dbpedia:John_Lennon
dbpedia:George_Harrison
?x
dbpedia:John_Lennon
dbpedia:George_Harrison
dbpedia:Paul_McCartney
dbpedia:Ringo_Starr
Schema:
Query:
Result set: Result set with inference:
dbpedia:
The_Beatles
dbpedia:
Paul_McCartney
mo:member_of
dbpedia:
John_Lennon
dbpedia:
George_Harrison
dbpedia:
Ringo_Starr
mo:member
mo:member_of
mo:member
mo:member_of mo:member_of
76. Example: Every artist primarily plays
only one musical instrument
mo:primary_instrument rdf:type owl:FunctionalProperty .
dbpedia:Jimi_Hendrix mo:primary_instrument dbpedia:Electric_Guitar.
dbpedia:Jimi_Hendrix mo:primary_instrument dbpedia:E-Guitar.
Conclusion dbpedia:Electric_Guitar
owl:sameAs dbpedia:E-Guitar .
Property Axioms:
Functional
EUCLID - Querying Linked Data 76
It refers to a property that can have only one (unique)
value for each instance
r2
same
r1
77. Example: Every recording has a unique ISRC
(International Standard Recording Code)
mo:isrc rdf:type owl:InverseFunctionalProperty .
mo:21047249-7b3f-4651-acca-246669c081fd mo:isrc "GBAYE6300412" .
dbpedia:She_Loves_You mo:isrc "GBAYE6300412" .
Conclusion mo:21047249-7b3f-4651-acca-246669c081fd
owl:sameAs :dbpedia:She_Loves_You .
Property Axioms:
Inverse Functional
EUCLID - Querying Linked Data 77
It is useful for specifying unique properties identifying
an individual
r2
same
r1
78. Individual Axioms
EUCLID - Querying Linked Data 78
OWL Individuals represent instances of classes. They are related to
their class by the rdf:type property
• We can state that two individuals are the same
SameIndividual(<artist/ba550d0e-adac-4864-b88b-407cab5e76af#_> dbpedia:PaulMcCartney)
<artist/ba550d0e-adac-4864-b88b-407cab5e76af#_> owl:sameAs dbpedia:PaulMcCartney .
• We can state that two individuals are different
DifferentIndividuals(:TheBeatles_band :TheBeatles_TVseries)
:TheBeatles_band owl:differentFrom :TheBeatles_Tvseries .
≡
≡
79. Class Axioms
EUCLID - Querying Linked Data 79
Axioms declare general statements about concepts which are used
in logical inference (reasoning). Class axioms:
• Sub-class relationship (from RDF Schema)
• Equivalent relationship: classes have the same individuals
EquivalentClass(:Musician :MusicArtist)
:Musician owl:equivalentClass :MusicArtist .
• Disjointness: classes have no shared individuals
DisjointClasses(:SoloMusicArtist :MusicGroup)
:SoloMusicArtist owl:disjointWith :MusicGroup .
≡
≡
80. Class Construction
EUCLID - Querying Linked Data 80
• OWL classes are defined by the OWL term owl:Class
• OWL classes can be subclassed as in RDFS:
• OWL classes may be combined with class constructs to
build new classes
Music Artist
Artist
:MusicArtist rdfs:subClassOf :Artist .
81. Class Construction (2)
EUCLID - Querying Linked Data 81
These class constructs are available in OWL, not in RDFS
The class of female music artists
ObjectIntersectionOf(:Female :MusicArtist)
[a owl:Class;
owl:intersectionOf(:Female :MusicArtist)]
The class of music artists
ObjectUnionOf(:SoloMusicArtist :MusicGroup)
[a owl:Class;
owl:unionOf(:SoloMusicArtist :MusicGroup)]
Everything that’s not instrumental music
ObjectComplementOf(:InstrumentalMusic)
[a owl:Class;
owl:complementOf(:InstrumentalMusic)]
Female
Music Artist
Solo
Group
Instrumental
≡
≡
≡
NOTE: Anonymous classes!
82. Naming Class Constructions
EUCLID - Querying Linked Data 82
• Direct naming can be achieved via owl:equivalentClass
• This construction provides necessary and sufficient conditions
for class membership
• Class naming can be also achieved using rdfs:subClassOf,
it provides a necessary but insufficient condition for class
membership
Music Artist
Solo
Group
EquivalentClass(:MusicArtist
ObjectUnionOf(:SoloMusicArtist
:MusicGroup))
:MusicArtist owl:equivalentClass
[owl:unionOf (:SoloMusicArtist :MusicGroup)]
≡
84. Summary (2)
EUCLID - Querying Linked Data 84
• Reasoning over Linked Data:
• SPARQL 1.1 entailment regimes
• RDFS: entailment regimes, lacks of consistency check, inference
limitations
• OWL: properties, property axioms
(symmetry, transitivity, inverse, functional, inverse
functional), individual axioms, class axioms, class
constructions, naming classes …
ReasoningoverLinkedData
In this chapter we studied:
85. For exercises, quiz and further material visit our website:
EUCLID - Providing Linked Data 85
@euclid_project euclidproject euclidproject
http://www.euclid-project.eu
Other channels:
eBook Course
86. Acknowledgements
• Alexander Mikroyannidis
• Alice Carpentier
• Andreas Harth
• Andreas Wagner
• Andriy Nikolov
• Barry Norton
• Daniel M. Herzig
• Elena Simperl
• Günter Ladwig
• Inga Shamkhalov
• Jacek Kopecky
• John Domingue
• Juan Sequeda
• Kalina Bontcheva
• Maria Maleshkova
• Maria-Esther Vidal
• Maribel Acosta
• Michael Meier
• Ning Li
• Paul Mulholland
• Peter Haase
• Richard Power
• Steffen Stadtmüller
86
Editor's Notes
NOTE: the “CH 1” means that these topics were covered in EUCLID Chapter 1 already.
NOTE: the “CH 1” means that these topics were covered in EUCLID Chapter 1 already.
NOTE: the “CH 1” means that these topics were covered in EUCLID Chapter 1 already.
NOTE: the “CH 1” means that these topics were covered in EUCLID Chapter 1 already.
NOTE: the “CH 1” means that these topics were covered in EUCLID Chapter 1 already.