SlideShare a Scribd company logo
SPARQL-DL
Theory & Practice
Adriel Café
aac3@cin.ufpe.br
Summary
1. OWL Basics
2. SPARQL
3. SPARQL-DL
4. Comparison: SPARQL x SPARQL-DL
5. Reasoner's Support for DL
6. Practice
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Important
This document was based on W3C specifications
• http://w3.org/2001/sw/wiki/SPARQL-DL
• http://w3.org/TR/sparql11-query
• http://w3.org/TR/sparql11-overview
• http://w3.org/TR/rdf-sparql-query
• http://w3.org/TR/owl-guide
• http://w3.org/TR/owl-features
• http://w3.org/TR/owl-ref
• http://w3.org/TR/owl2-overview
• http://w3.org/TR/owl2-profiles
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
OWL Basics
Ontology Web Language
• Is an ontology language for the Semantic Web with formally defined
meaning
• Is a W3C standard since 2004
• Written in XML
• Derived from the DAML+OIL
• Developed as a vocabulary extension of RDF
• Provide classes, properties, individuals, data values and are stored as
Semantic Web documents
• OWL Tools
• OWL Syntax Converter (http://owl.cs.manchester.ac.uk/converter)
• OWL Validator (http://owl.cs.manchester.ac.uk/validator)
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
OWL 1
• Compatible with RDF
• Profiles
• OWL Full (Not DL)
• OWL DL (DL SHOIN(D))
• OWL Lite (DL SHIF(D))
OWL Versions
OWL 2
• Compatible with OWL 1 and RDF
• Profiles
• OWL 2 EL (DL EL++)
• OWL 2 QL (DL-Lite)
• OWL 2 RL (DLP)
• OWL 2 DL (DL SROIQ(D))
Is used informally to refer to ontologies
interpreted using the Direct Semantics
http://w3.org/TR/owl2-direct-semantics
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
OWL 2 Structure
http://w3.org/TR/owl2-overview/OWL2-structure2-800.png
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL
SPARQL Protocol and RDF Query Language
• Is a SQL-Like language for querying RDF data
• Is a protocol
• Is a W3C standard since 2008
• Queries consist of triple patterns, conjunctions, disjunctions, and optional
patterns
"SPARQL will make a huge difference“
(Berners-Lee, 2006)
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL in Semantic Web Stack
http://upload.wikimedia.org/wikipedia/en/3/37/Semantic-web-stack.png
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL Query Types
• SELECT
Returns all, or a subset of, the variables bound in a query pattern match.
• ASK
Returns a boolean indicating whether a query pattern matches or not.
• CONSTRUCT
Returns an RDF graph constructed by substituting variables in a set of triple templates.
• DESCRIBE
Returns an RDF graph that describes the resources found.
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?name
FROM <http://xmlns.com/foaf/spec/index.rdf>
WHERE {
?x foaf:name ?name
}
ORDER BY ?name
LIMIT 5
OFFSET 10
Anatomy of a SPARQL Query
Triple patterns to be localized
Subject, Predicate and Object
Prefix label associated with an
IRI
Returns all possible bindings of
the provided variables
DISTINCT keyword removes
all redundant bindings
Data sources that should be
consulted
Solution sequences and
modifiers
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
RDF Definitions
• RDF Triple
Contains three components: subject, predicate and object
<http://com.ex/people#adrielcafe> <http://com.ex/contact#name> “Adriel Café"
• RDF Graph
Is a set of RDF triples
• Triple Pattern
Is like an RDF triple, but with the option of a variable in place of RDF terms (i.e.,
IRIs, literals or blank nodes) in the subject, predicate or object positions
?people <http://com.ex/contact#name> ?name
• Basic Graph Pattern (BGP)
Is a conjunction of a finite set of triple patterns
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL Subgraph Matching
• The SPARQL query processor will search for sets of triples that match
these triple patterns, binding the variables in the query to the
corresponding parts of each triple.
• Subgraph matching (a.k.a. simple entailment) considers only the graph
structure of RDF for computing query results
• Entailment Regimes
RDFS Entailment Regime, D-Entailment Regime, OWL 2 RDF-Based Semantics, OWL
2 Direct Semantics
“The main mechanism for computing query results in SPARQL is subgraph matching:
RDF triples in both the queried RDF data and the query pattern are interpreted as
nodes and edges of directed graphs, and the resulting query graph is matched to the
data graph using variables as wild cards.”
(Glimm; Krötzsch, 2010)
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL-DL
SPARQL Protocol and RDF Query Language – Description Logics
• Is a distinct subset of SPARQL
• Uses SPARQL syntax
• Is tailored to ontology specific questions
• Is not yet a W3C standard
• Quite expressive language which allows to mix TBox, RBox, and ABox
queries
• Fully aligned with the OWL 2 standard
• Settled on top of the OWL API
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
http://www.derivo.de/uploads/pics/SPARQL-DL_01.png
SPARQL-DL Abstract Syntax
• A SPARQL-DL query Q is a finite set of SPARQL-DL query atoms and the
query is interpreted as the conjunction of the elements in the set.
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Query Type of the query An example query
Q1 Standard TBox query SubClassOf(?c, ex:Student)
Q2 Standard ABox query
Type(?x, and(ex:Student, ex:Employee)),
PropertyValue(?x, ex:name, ?y)
Q3
ABox query with non-
distinguished variables
PropertyValue(?x, ex:hasPublication, _:y),
PropertyValue(:y, ex:publishedAt, _:z),
Type(_:z, not(ex:Workshop))
Q4 Mixed ABox/TBox query
Type(?x, ex:Student),
Type(?x, ?c),
SubClassOf(?c, ex:Employee),
Q5 Mixed ABox/RBox query
ObjectProperty(?p),
PropertyValue(ex:John, ?p, ?v)
(Parsia & Sirin, 2007)
SPARQL-DL Supported Query Patterns
Class(a)
Property(a)
Individual(a)
Type(a, b)
PropertyValue(a, b, c)
EquivalentClass(a, b)
SubClassOf(a, b)
EquivalentProperty(a, b)
SubPropertyOf(a, b)
InverseOf(a, b)
ObjectProperty(a)
DataProperty(a)
Functional(a)
InverseFunctional(a)
Transitive(a)
Symmetric(a)
Reflexive(a)
Irreflexive(a)
SameAs(a, b)
DisjointWith(a, b)
DifferentFrom(a, b)
ComplementOf(a, b)
Annotation(a, b, c)
StrictSubClassOf(a, b)
DirectSubClassOf(a, b)
DirectType(a, b)
StrictSubPropertyOf(a, b)
DirectSubPropertyOf(a, b)
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL-DL Syntax
• Query Types: ASK and SELECT
• Supports union-like statements called "OR WHERE“
• Primitives
• Variable: ?[a-zA-Z]+ (for example ?a, ?myVar)
• Full IRI: <http://example.com>
• Prefixed IRI: [the prefix]:[the suffix]
• Literal: "this is a literal" (escape the character " inside a literal with ")
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
SPARQL-DL Query Examples
SELECT ?c WHERE { Class(?c) }
SELECT ?x WHERE {
Transitive(?p),
PropertyValue(<http://example.com#myClass>, ?p, ?x)
}
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?i WHERE {
Type(?i, wine:PinotBlanc)
} OR WHERE {
Type(?i, wine:DryRedWine)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Query Comparison: SPARQL x SPARQL-DL
• SPARQL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine ?region WHERE {
?wine wine:locatedIn ?region
}
• SPARQL-DL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine ?region WHERE {
PropertyValue(?wine, wine:locatedIn, ?region)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Query Comparison: SPARQL x SPARQL-DL
• SPARQL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine ?flavor WHERE {
?wine wine:locatedIn wine:NewZealandRegion .
?wine wine:hasFlavor ?flavor
}
• SPARQL-DL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine ?flavor WHERE {
PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion),
PropertyValue(?wine, wine:hasFlavor, ?flavor)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Query Comparison: SPARQL x SPARQL-DL
• SPARQL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine WHERE {
{
?wine wine:locatedIn wine:NapaRegion
}
UNION
{
?wine wine:locatedIn wine:NewZealandRegion
}
}
• SPARQL-DL
PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine#
SELECT ?wine WHERE {
PropertyValue(?wine, wine:locatedIn, wine:NapaRegion)
} OR WHERE {
PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion )
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Reasoner's Support for DL
Pellet RacerPro FaCT++ HermiT
OWL-DL Support Yes Yes Yes Yes
OWL 2 Support Yes Yes Partially Yes
Supported
expressivity
SROIQ(D) SRIQ(D-) SROIQ(D) SHOIQ+
Reasoning
algorithm
Tableau Tableau Tableau Hypertableau
Rule Support
Yes (SWRL - DL Safe
Rules)
Yes (SWRL - not
fully supported) &
own rule format
No
Yes (SWRL - DL Safe
Rules)
Licensing
Free / open-source
& Non-Free/ closed-
source
Non-Free/ closed-
source
Free / open-source Free / open-source
Adapted from http://en.wikipedia.org/wiki/Semantic_reasoner
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Practice
• Eclipse IDE (Java Project)
http://eclipse.org
• OWL API
http://derivo.de/en/resources/owl-api.html
• SPARQL-DL API
http://derivo.de/en/resources/sparql-dl-api.html
• HermiT OWL Reasoner
http://hermit-reasoner.com
• Wine Ontology
http://krono.act.uji.es/Links/ontologies/wine.owl
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Practice
Queries
• Prefix
PREFIX wine: <http://krono.act.uji.es/Links/ontologies/wine.owl#>
• Query 1
SELECT ?class WHERE {
Class(?class)
}
• Query 2
SELECT ?subClass WHERE {
SubClassOf(?subClass, wine:Wine)
}
• Query 3
SELECT ?wine WHERE {
PropertyValue(?wine, wine:locatedIn, wine:GermanyRegion)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Practice
Queries
• Query 4
SELECT ?wine ?region WHERE {
PropertyValue(?wine, wine:locatedIn, ?region)
}
• Query 5
SELECT ?wine ?region WHERE {
Type(?wine, wine:Wine),
PropertyValue(?wine, wine:locatedIn, ?region)
}
• Query 6
SELECT ?wine ?flavor WHERE {
PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion),
PropertyValue(?wine, wine:hasFlavor, ?flavor)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Practice
Queries
• Query 7 (DISTINCT Keyword)
SELECT DISTINCT ?producer ?wine WHERE {
PropertyValue(?producer, wine:producesWine, ?wine)
}
• Query 8 (OR WHERE Statement)
SELECT ?wine WHERE {
Type(?wine, wine:PinotBlanc)
} OR WHERE {
Type(?wine, wine:DryRedWine)
}
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
Practice
OWL API + SPARQL-DL API + HermiT Reasoner
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
// Ontology
IRI ontIRI = IRI.create("http://krono.act.uji.es/Links/ontologies/wine.owl");
OWLOntologyManager ontManager = OWLManager.createOWLOntologyManager();
OWLOntology ont = ontManager.loadOntologyFromOntologyDocument(ontIRI);
// Reasoners
OWLReasoner rStructural = new StructuralReasonerFactory().createReasoner(ont);
OWLReasoner rHermit = new Reasoner.ReasonerFactory().createReasoner(ont);
// Query
QueryEngine queryEngine = QueryEngine.create(ontManager, rHermit);
Query query = Query.create(query1);
String result = queryEngine.execute(query).toString();
System.out.println(result);
References
• HORROCKS, I.; PEREZ-URBINA, H.; MOTIK, BORIS. Efficient Query Answering for OWL 2. 2009.
• HORROCKS, I.; PATEL-SCHNEIDER, P. F.; MCGUINNESS, D. L.; WELTY, C. A. OWL: a Description Logic
Based Ontology Language for the Semantic Web. 2007.
• HORROCKS, I.; KOLLIA, I.; GLIMM, B. SPARQL Query Answering over OWL Ontologies. 2011.
• KREMEN1, P.; SIRIN, E. SPARQL-DL Implementation Experience. 2008.
• PARSIA, B.; SIRIN, E. SPARQL-DL: SPARQL Query for OWL-DL. 2007.
• GLIMM, B.; KRÖTZSCH, M. SPARQL Beyond Subgraph Matching. 2010.
• GRAU, B. C.; HORROCKS, I.; MOTIK, B.; PARSIA, B.; PATEL-SCHNEIDER, P.; SATTLER, U. OWL 2: The
Next Step for OWL. 2008.
• DOMINGUE, J.; FENSEL, D.; HENDLER, J. A. Handbook of Semantic Web Technologies. 2011.
• ALLEMANG, D.; HENDLER J. A. Semantic Web for the Working Ontologist. 2011.
• ANTONIOU, G.; VAN HARMELEN, F. Semantic Web Primer. 2008.
• HEBELER, J.; FISHER, M.; BLACE, R.; PEREZ-LOPEZ, A.; DEAN, M. Semantic Web Programming. 2009.
SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>

More Related Content

What's hot

Apache spark
Apache sparkApache spark
Apache spark
TEJPAL GAUTAM
 
Querying Linked Data with SPARQL
Querying Linked Data with SPARQLQuerying Linked Data with SPARQL
Querying Linked Data with SPARQL
Olaf Hartig
 
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
Biswanath Dutta
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
Jose Emilio Labra Gayo
 
SPARQL 사용법
SPARQL 사용법SPARQL 사용법
SPARQL 사용법
홍수 허
 
Jena Programming
Jena ProgrammingJena Programming
Jena Programming
Myungjin Lee
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
AdonisDamian
 
Introduction to Spark Streaming
Introduction to Spark StreamingIntroduction to Spark Streaming
Introduction to Spark Streaming
datamantra
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
Rachel Lovinger
 
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
Edureka!
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
Joud Khattab
 
Inference on the Semantic Web
Inference on the Semantic WebInference on the Semantic Web
Inference on the Semantic Web
Myungjin Lee
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
Databricks
 
Presto: SQL-on-anything
Presto: SQL-on-anythingPresto: SQL-on-anything
Presto: SQL-on-anything
DataWorks Summit
 
Overview of the SPARQL-Generate language and latest developments
Overview of the SPARQL-Generate language and latest developmentsOverview of the SPARQL-Generate language and latest developments
Overview of the SPARQL-Generate language and latest developments
Maxime Lefrançois
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
Jose Emilio Labra Gayo
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
Thomas Francart
 
Consultas sparql en dbpedia
Consultas sparql en dbpediaConsultas sparql en dbpedia
Consultas sparql en dbpedia
Israel Rey
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
Holger Knublauch
 
Beyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFramesBeyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFrames
Databricks
 

What's hot (20)

Apache spark
Apache sparkApache spark
Apache spark
 
Querying Linked Data with SPARQL
Querying Linked Data with SPARQLQuerying Linked Data with SPARQL
Querying Linked Data with SPARQL
 
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
Tutorial on SPARQL: SPARQL Protocol and RDF Query Language
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
SPARQL 사용법
SPARQL 사용법SPARQL 사용법
SPARQL 사용법
 
Jena Programming
Jena ProgrammingJena Programming
Jena Programming
 
Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Introduction to Spark Streaming
Introduction to Spark StreamingIntroduction to Spark Streaming
Introduction to Spark Streaming
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
What is Apache Spark | Apache Spark Tutorial For Beginners | Apache Spark Tra...
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
 
Inference on the Semantic Web
Inference on the Semantic WebInference on the Semantic Web
Inference on the Semantic Web
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
 
Presto: SQL-on-anything
Presto: SQL-on-anythingPresto: SQL-on-anything
Presto: SQL-on-anything
 
Overview of the SPARQL-Generate language and latest developments
Overview of the SPARQL-Generate language and latest developmentsOverview of the SPARQL-Generate language and latest developments
Overview of the SPARQL-Generate language and latest developments
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
 
Consultas sparql en dbpedia
Consultas sparql en dbpediaConsultas sparql en dbpedia
Consultas sparql en dbpedia
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
 
Beyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFramesBeyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFrames
 

Similar to SPARQL-DL - Theory & Practice

A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
Marakana Inc.
 
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Informationballoon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
Kai Schlegel
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQL
Emanuele Della Valle
 
SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)
andyseaborne
 
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Allison Jai O'Dell
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
Myungjin Lee
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
Rothamsted Research, UK
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?
LeeFeigenbaum
 
Querying Linked Data
Querying Linked DataQuerying Linked Data
Querying Linked Data
EUCLID project
 
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
Olaf Hartig
 
Sparql a simple knowledge query
Sparql  a simple knowledge querySparql  a simple knowledge query
Sparql a simple knowledge query
Stanley Wang
 
SPARQL 1.1 Status
SPARQL 1.1 StatusSPARQL 1.1 Status
SPARQL 1.1 Status
LeeFeigenbaum
 
Data Integration And Visualization
Data Integration And VisualizationData Integration And Visualization
Data Integration And Visualization
Ivan Ermilov
 
Sparql
SparqlSparql
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
Robert Engels
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
sesam4able
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
Shamod Lacoul
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
Jose Emilio Labra Gayo
 
Querying Linked Data with SPARQL (2010)
Querying Linked Data with SPARQL (2010)Querying Linked Data with SPARQL (2010)
Querying Linked Data with SPARQL (2010)
Olaf Hartig
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
Dr. Neil Brittliff
 

Similar to SPARQL-DL - Theory & Practice (20)

A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
 
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Informationballoon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQL
 
SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)SPARQL 1.1 Update (2013-03-05)
SPARQL 1.1 Update (2013-03-05)
 
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
Notes from the Library Juice Academy courses on “SPARQL Fundamentals”: Univer...
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
BioSD Tutorial 2014 Editition
BioSD Tutorial 2014 EdititionBioSD Tutorial 2014 Editition
BioSD Tutorial 2014 Editition
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?
 
Querying Linked Data
Querying Linked DataQuerying Linked Data
Querying Linked Data
 
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
Tutorial "An Introduction to SPARQL and Queries over Linked Data" Chapter 3 (...
 
Sparql a simple knowledge query
Sparql  a simple knowledge querySparql  a simple knowledge query
Sparql a simple knowledge query
 
SPARQL 1.1 Status
SPARQL 1.1 StatusSPARQL 1.1 Status
SPARQL 1.1 Status
 
Data Integration And Visualization
Data Integration And VisualizationData Integration And Visualization
Data Integration And Visualization
 
Sparql
SparqlSparql
Sparql
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Querying Linked Data with SPARQL (2010)
Querying Linked Data with SPARQL (2010)Querying Linked Data with SPARQL (2010)
Querying Linked Data with SPARQL (2010)
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
 

More from Adriel Café

Desenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com KotlinDesenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com Kotlin
Adriel Café
 
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
Adriel Café
 
Desenvolvendo para Android com componentes Open Source
Desenvolvendo para Android com componentes Open SourceDesenvolvendo para Android com componentes Open Source
Desenvolvendo para Android com componentes Open Source
Adriel Café
 
Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014
Adriel Café
 
Ontology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and moreOntology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and more
Adriel Café
 
Mobile Apps Cross-Platform
Mobile Apps Cross-PlatformMobile Apps Cross-Platform
Mobile Apps Cross-Platform
Adriel Café
 
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
Adriel Café
 
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
Adriel Café
 

More from Adriel Café (8)

Desenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com KotlinDesenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com Kotlin
 
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
Uma Arquitetura com Implementação para Integração Semântica de Ontologias e B...
 
Desenvolvendo para Android com componentes Open Source
Desenvolvendo para Android com componentes Open SourceDesenvolvendo para Android com componentes Open Source
Desenvolvendo para Android com componentes Open Source
 
Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014
 
Ontology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and moreOntology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and more
 
Mobile Apps Cross-Platform
Mobile Apps Cross-PlatformMobile Apps Cross-Platform
Mobile Apps Cross-Platform
 
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
FLISOL 2012 - Palestra "Introdução ao Desenvolvimento de Aplicações para o Si...
 
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
2º ETI - Minicurso "Desenvolvendo para Plataforma Android"
 

Recently uploaded

GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 

Recently uploaded (20)

GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 

SPARQL-DL - Theory & Practice

  • 1. SPARQL-DL Theory & Practice Adriel Café aac3@cin.ufpe.br
  • 2. Summary 1. OWL Basics 2. SPARQL 3. SPARQL-DL 4. Comparison: SPARQL x SPARQL-DL 5. Reasoner's Support for DL 6. Practice SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 3. Important This document was based on W3C specifications • http://w3.org/2001/sw/wiki/SPARQL-DL • http://w3.org/TR/sparql11-query • http://w3.org/TR/sparql11-overview • http://w3.org/TR/rdf-sparql-query • http://w3.org/TR/owl-guide • http://w3.org/TR/owl-features • http://w3.org/TR/owl-ref • http://w3.org/TR/owl2-overview • http://w3.org/TR/owl2-profiles SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 4. OWL Basics Ontology Web Language • Is an ontology language for the Semantic Web with formally defined meaning • Is a W3C standard since 2004 • Written in XML • Derived from the DAML+OIL • Developed as a vocabulary extension of RDF • Provide classes, properties, individuals, data values and are stored as Semantic Web documents • OWL Tools • OWL Syntax Converter (http://owl.cs.manchester.ac.uk/converter) • OWL Validator (http://owl.cs.manchester.ac.uk/validator) SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 5. OWL 1 • Compatible with RDF • Profiles • OWL Full (Not DL) • OWL DL (DL SHOIN(D)) • OWL Lite (DL SHIF(D)) OWL Versions OWL 2 • Compatible with OWL 1 and RDF • Profiles • OWL 2 EL (DL EL++) • OWL 2 QL (DL-Lite) • OWL 2 RL (DLP) • OWL 2 DL (DL SROIQ(D)) Is used informally to refer to ontologies interpreted using the Direct Semantics http://w3.org/TR/owl2-direct-semantics SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 6. OWL 2 Structure http://w3.org/TR/owl2-overview/OWL2-structure2-800.png SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 7. SPARQL SPARQL Protocol and RDF Query Language • Is a SQL-Like language for querying RDF data • Is a protocol • Is a W3C standard since 2008 • Queries consist of triple patterns, conjunctions, disjunctions, and optional patterns "SPARQL will make a huge difference“ (Berners-Lee, 2006) SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 8. SPARQL in Semantic Web Stack http://upload.wikimedia.org/wikipedia/en/3/37/Semantic-web-stack.png SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 9. SPARQL Query Types • SELECT Returns all, or a subset of, the variables bound in a query pattern match. • ASK Returns a boolean indicating whether a query pattern matches or not. • CONSTRUCT Returns an RDF graph constructed by substituting variables in a set of triple templates. • DESCRIBE Returns an RDF graph that describes the resources found. SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 10. PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT DISTINCT ?name FROM <http://xmlns.com/foaf/spec/index.rdf> WHERE { ?x foaf:name ?name } ORDER BY ?name LIMIT 5 OFFSET 10 Anatomy of a SPARQL Query Triple patterns to be localized Subject, Predicate and Object Prefix label associated with an IRI Returns all possible bindings of the provided variables DISTINCT keyword removes all redundant bindings Data sources that should be consulted Solution sequences and modifiers SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 11. RDF Definitions • RDF Triple Contains three components: subject, predicate and object <http://com.ex/people#adrielcafe> <http://com.ex/contact#name> “Adriel Café" • RDF Graph Is a set of RDF triples • Triple Pattern Is like an RDF triple, but with the option of a variable in place of RDF terms (i.e., IRIs, literals or blank nodes) in the subject, predicate or object positions ?people <http://com.ex/contact#name> ?name • Basic Graph Pattern (BGP) Is a conjunction of a finite set of triple patterns SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 12. SPARQL Subgraph Matching • The SPARQL query processor will search for sets of triples that match these triple patterns, binding the variables in the query to the corresponding parts of each triple. • Subgraph matching (a.k.a. simple entailment) considers only the graph structure of RDF for computing query results • Entailment Regimes RDFS Entailment Regime, D-Entailment Regime, OWL 2 RDF-Based Semantics, OWL 2 Direct Semantics “The main mechanism for computing query results in SPARQL is subgraph matching: RDF triples in both the queried RDF data and the query pattern are interpreted as nodes and edges of directed graphs, and the resulting query graph is matched to the data graph using variables as wild cards.” (Glimm; Krötzsch, 2010) SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 13. SPARQL-DL SPARQL Protocol and RDF Query Language – Description Logics • Is a distinct subset of SPARQL • Uses SPARQL syntax • Is tailored to ontology specific questions • Is not yet a W3C standard • Quite expressive language which allows to mix TBox, RBox, and ABox queries • Fully aligned with the OWL 2 standard • Settled on top of the OWL API SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br> http://www.derivo.de/uploads/pics/SPARQL-DL_01.png
  • 14. SPARQL-DL Abstract Syntax • A SPARQL-DL query Q is a finite set of SPARQL-DL query atoms and the query is interpreted as the conjunction of the elements in the set. SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br> Query Type of the query An example query Q1 Standard TBox query SubClassOf(?c, ex:Student) Q2 Standard ABox query Type(?x, and(ex:Student, ex:Employee)), PropertyValue(?x, ex:name, ?y) Q3 ABox query with non- distinguished variables PropertyValue(?x, ex:hasPublication, _:y), PropertyValue(:y, ex:publishedAt, _:z), Type(_:z, not(ex:Workshop)) Q4 Mixed ABox/TBox query Type(?x, ex:Student), Type(?x, ?c), SubClassOf(?c, ex:Employee), Q5 Mixed ABox/RBox query ObjectProperty(?p), PropertyValue(ex:John, ?p, ?v) (Parsia & Sirin, 2007)
  • 15. SPARQL-DL Supported Query Patterns Class(a) Property(a) Individual(a) Type(a, b) PropertyValue(a, b, c) EquivalentClass(a, b) SubClassOf(a, b) EquivalentProperty(a, b) SubPropertyOf(a, b) InverseOf(a, b) ObjectProperty(a) DataProperty(a) Functional(a) InverseFunctional(a) Transitive(a) Symmetric(a) Reflexive(a) Irreflexive(a) SameAs(a, b) DisjointWith(a, b) DifferentFrom(a, b) ComplementOf(a, b) Annotation(a, b, c) StrictSubClassOf(a, b) DirectSubClassOf(a, b) DirectType(a, b) StrictSubPropertyOf(a, b) DirectSubPropertyOf(a, b) SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 16. SPARQL-DL Syntax • Query Types: ASK and SELECT • Supports union-like statements called "OR WHERE“ • Primitives • Variable: ?[a-zA-Z]+ (for example ?a, ?myVar) • Full IRI: <http://example.com> • Prefixed IRI: [the prefix]:[the suffix] • Literal: "this is a literal" (escape the character " inside a literal with ") SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 17. SPARQL-DL Query Examples SELECT ?c WHERE { Class(?c) } SELECT ?x WHERE { Transitive(?p), PropertyValue(<http://example.com#myClass>, ?p, ?x) } PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?i WHERE { Type(?i, wine:PinotBlanc) } OR WHERE { Type(?i, wine:DryRedWine) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 18. Query Comparison: SPARQL x SPARQL-DL • SPARQL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine ?region WHERE { ?wine wine:locatedIn ?region } • SPARQL-DL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine ?region WHERE { PropertyValue(?wine, wine:locatedIn, ?region) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 19. Query Comparison: SPARQL x SPARQL-DL • SPARQL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine ?flavor WHERE { ?wine wine:locatedIn wine:NewZealandRegion . ?wine wine:hasFlavor ?flavor } • SPARQL-DL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine ?flavor WHERE { PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion), PropertyValue(?wine, wine:hasFlavor, ?flavor) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 20. Query Comparison: SPARQL x SPARQL-DL • SPARQL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine WHERE { { ?wine wine:locatedIn wine:NapaRegion } UNION { ?wine wine:locatedIn wine:NewZealandRegion } } • SPARQL-DL PREFIX wine: http://w3.org/TR/2003/PR-owl-guide-20031209/wine# SELECT ?wine WHERE { PropertyValue(?wine, wine:locatedIn, wine:NapaRegion) } OR WHERE { PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion ) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 21. Reasoner's Support for DL Pellet RacerPro FaCT++ HermiT OWL-DL Support Yes Yes Yes Yes OWL 2 Support Yes Yes Partially Yes Supported expressivity SROIQ(D) SRIQ(D-) SROIQ(D) SHOIQ+ Reasoning algorithm Tableau Tableau Tableau Hypertableau Rule Support Yes (SWRL - DL Safe Rules) Yes (SWRL - not fully supported) & own rule format No Yes (SWRL - DL Safe Rules) Licensing Free / open-source & Non-Free/ closed- source Non-Free/ closed- source Free / open-source Free / open-source Adapted from http://en.wikipedia.org/wiki/Semantic_reasoner SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 22. Practice • Eclipse IDE (Java Project) http://eclipse.org • OWL API http://derivo.de/en/resources/owl-api.html • SPARQL-DL API http://derivo.de/en/resources/sparql-dl-api.html • HermiT OWL Reasoner http://hermit-reasoner.com • Wine Ontology http://krono.act.uji.es/Links/ontologies/wine.owl SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 23. Practice Queries • Prefix PREFIX wine: <http://krono.act.uji.es/Links/ontologies/wine.owl#> • Query 1 SELECT ?class WHERE { Class(?class) } • Query 2 SELECT ?subClass WHERE { SubClassOf(?subClass, wine:Wine) } • Query 3 SELECT ?wine WHERE { PropertyValue(?wine, wine:locatedIn, wine:GermanyRegion) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 24. Practice Queries • Query 4 SELECT ?wine ?region WHERE { PropertyValue(?wine, wine:locatedIn, ?region) } • Query 5 SELECT ?wine ?region WHERE { Type(?wine, wine:Wine), PropertyValue(?wine, wine:locatedIn, ?region) } • Query 6 SELECT ?wine ?flavor WHERE { PropertyValue(?wine, wine:locatedIn, wine:NewZealandRegion), PropertyValue(?wine, wine:hasFlavor, ?flavor) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 25. Practice Queries • Query 7 (DISTINCT Keyword) SELECT DISTINCT ?producer ?wine WHERE { PropertyValue(?producer, wine:producesWine, ?wine) } • Query 8 (OR WHERE Statement) SELECT ?wine WHERE { Type(?wine, wine:PinotBlanc) } OR WHERE { Type(?wine, wine:DryRedWine) } SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>
  • 26. Practice OWL API + SPARQL-DL API + HermiT Reasoner SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br> // Ontology IRI ontIRI = IRI.create("http://krono.act.uji.es/Links/ontologies/wine.owl"); OWLOntologyManager ontManager = OWLManager.createOWLOntologyManager(); OWLOntology ont = ontManager.loadOntologyFromOntologyDocument(ontIRI); // Reasoners OWLReasoner rStructural = new StructuralReasonerFactory().createReasoner(ont); OWLReasoner rHermit = new Reasoner.ReasonerFactory().createReasoner(ont); // Query QueryEngine queryEngine = QueryEngine.create(ontManager, rHermit); Query query = Query.create(query1); String result = queryEngine.execute(query).toString(); System.out.println(result);
  • 27. References • HORROCKS, I.; PEREZ-URBINA, H.; MOTIK, BORIS. Efficient Query Answering for OWL 2. 2009. • HORROCKS, I.; PATEL-SCHNEIDER, P. F.; MCGUINNESS, D. L.; WELTY, C. A. OWL: a Description Logic Based Ontology Language for the Semantic Web. 2007. • HORROCKS, I.; KOLLIA, I.; GLIMM, B. SPARQL Query Answering over OWL Ontologies. 2011. • KREMEN1, P.; SIRIN, E. SPARQL-DL Implementation Experience. 2008. • PARSIA, B.; SIRIN, E. SPARQL-DL: SPARQL Query for OWL-DL. 2007. • GLIMM, B.; KRÖTZSCH, M. SPARQL Beyond Subgraph Matching. 2010. • GRAU, B. C.; HORROCKS, I.; MOTIK, B.; PARSIA, B.; PATEL-SCHNEIDER, P.; SATTLER, U. OWL 2: The Next Step for OWL. 2008. • DOMINGUE, J.; FENSEL, D.; HENDLER, J. A. Handbook of Semantic Web Technologies. 2011. • ALLEMANG, D.; HENDLER J. A. Semantic Web for the Working Ontologist. 2011. • ANTONIOU, G.; VAN HARMELEN, F. Semantic Web Primer. 2008. • HEBELER, J.; FISHER, M.; BLACE, R.; PEREZ-LOPEZ, A.; DEAN, M. Semantic Web Programming. 2009. SPARQL-DL: Theory & Practice | Adriel Café <aac3@cin.ufpe.br>