SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
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>

Weitere ähnliche Inhalte

Was ist angesagt?

RDB2RDF, an overview of R2RML and Direct Mapping
RDB2RDF, an overview of R2RML and Direct MappingRDB2RDF, an overview of R2RML and Direct Mapping
RDB2RDF, an overview of R2RML and Direct MappingBoris Villazón-Terrazas
 
Programming in Spark using PySpark
Programming in Spark using PySpark      Programming in Spark using PySpark
Programming in Spark using PySpark Mostafa
 
Data profiling with Apache Calcite
Data profiling with Apache CalciteData profiling with Apache Calcite
Data profiling with Apache CalciteJulian Hyde
 
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODOLinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODOChris Mungall
 
Apache Calcite overview
Apache Calcite overviewApache Calcite overview
Apache Calcite overviewJulian Hyde
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1Fabien Gandon
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and SemanticsTatiana Al-Chueyr
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQLOpen Data Support
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Databricks
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySparkRussell Jurney
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesDatabricks
 
Découverte du SPARQL endpoint de HAL
Découverte du SPARQL endpoint de HALDécouverte du SPARQL endpoint de HAL
Découverte du SPARQL endpoint de HALGautier Poupeau
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1Fabien Gandon
 
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
 

Was ist angesagt? (20)

RDB2RDF, an overview of R2RML and Direct Mapping
RDB2RDF, an overview of R2RML and Direct MappingRDB2RDF, an overview of R2RML and Direct Mapping
RDB2RDF, an overview of R2RML and Direct Mapping
 
Programming in Spark using PySpark
Programming in Spark using PySpark      Programming in Spark using PySpark
Programming in Spark using PySpark
 
SHACL Overview
SHACL OverviewSHACL Overview
SHACL Overview
 
Data profiling with Apache Calcite
Data profiling with Apache CalciteData profiling with Apache Calcite
Data profiling with Apache Calcite
 
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODOLinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
 
Apache Calcite overview
Apache Calcite overviewApache Calcite overview
Apache Calcite overview
 
RDFS In A Nutshell V1
RDFS In A Nutshell V1RDFS In A Nutshell V1
RDFS In A Nutshell V1
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Catalyst optimizer
Catalyst optimizerCatalyst optimizer
Catalyst optimizer
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and Semantics
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQL
 
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
Deep Dive into Spark SQL with Advanced Performance Tuning with Xiao Li & Wenc...
 
RDF data model
RDF data modelRDF data model
RDF data model
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 
SPIN in Five Slides
SPIN in Five SlidesSPIN in Five Slides
SPIN in Five Slides
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Découverte du SPARQL endpoint de HAL
Découverte du SPARQL endpoint de HALDécouverte du SPARQL endpoint de HAL
Découverte du SPARQL endpoint de HAL
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1
 
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)
 

Ähnlich wie 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 webMarakana 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 InformationKai Schlegel
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLEmanuele 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 - SPARQLMyungjin Lee
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?LeeFeigenbaum
 
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 queryStanley Wang
 
Data Integration And Visualization
Data Integration And VisualizationData Integration And Visualization
Data Integration And VisualizationIvan Ermilov
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011Robert Engels
 
Sesam4 project presentation sparql - april 2011
Sesam4   project presentation sparql - april 2011Sesam4   project presentation sparql - april 2011
Sesam4 project presentation sparql - april 2011sesam4able
 
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 WebShamod Lacoul
 
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 AnalyticsDr. Neil Brittliff
 

Ähnlich wie 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
 

Mehr von Adriel Café

Desenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com KotlinDesenvolvendo aplicativos Android com Kotlin
Desenvolvendo aplicativos Android com KotlinAdriel 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 SourceAdriel Café
 
Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014Gryphon Framework - Preliminary Results Feb-2014
Gryphon Framework - Preliminary Results Feb-2014Adriel Café
 
Ontology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and moreOntology integration - Heterogeneity, Techniques and more
Ontology integration - Heterogeneity, Techniques and moreAdriel Café
 
Mobile Apps Cross-Platform
Mobile Apps Cross-PlatformMobile Apps Cross-Platform
Mobile Apps Cross-PlatformAdriel 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é
 

Mehr von 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"
 

Kürzlich hochgeladen

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 

Kürzlich hochgeladen (20)

COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 

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>