SlideShare una empresa de Scribd logo
1 de 23
SPARQL Query Forms Leigh Dodds, Oxford SWIG, March 2008 Photo Credit:  Glen Bowman
Why are there 4 SPARQL Query Forms? SPARQL  Use Cases  doesn’t help very much…
…neither does the SPARQL specification ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What are they for?
SELECT Equivalent to SQL SELECT Returns a nice, regular table
SELECT PREFIX table: <http://www.daml.org/2003/01/periodictable/PeriodicTable#> SELECT ?name ?weight WHERE { ?element table:name ?name; table:atomicWeight ?weight. } ORDER BY DESC(?weight) LIMIT 10
ASK Returns a true/false value Is there data that looks like  this ? Do you have any information about  that ?
ASK PREFIX foaf: <http://xmlns.com/foaf/0.1/> ASK WHERE { ?person a foaf:Person ; foaf:mbox <mailto:leigh@ldodds.com>. } (SPARQL equivalent of a vanity search!)
CONSTRUCT Returns an RDF graph Extract a specific subset of the queried data I want  this ,  this , and  this
CONSTRUCT PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?friend a foaf:Person; foaf:name ?name; foaf:homepage ?home. } WHERE { ?person foaf:mbox <mailto:leigh@ldodds.com>; foaf:knows ?friend. ?friend foaf:name ?name; foaf:homepage ?home. }
DESCRIBE Returns an RDF graph Tell me about  this  or  things that look like this … but you decide what’s relevant
DESCRIBE PREFIX foaf: <http://xmlns.com/foaf/0.1/> DESCRIBE ?friend  WHERE { ?person foaf:mbox “mailto:leigh@ldodds.com”; foaf:knows ?friend. }
Applied Uses Beyond the basics
DESCRIBE for Prototyping DESCRIBE <http://example.org/someResource>  Quickly assembling UIs Web APIs
SELECT for Indexing Building an ordering over some data ORDER BY, LIMIT
CONSTRUCT for Transformation … and also simple inferencing CONSTRUCT could be the XSLT of RDF Currently limited by lack of expressions in CONSTRUCT triple templates
CONSTRUCT for Transformation PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX ex: <http://www.example.org/blogger/> CONSTRUCT { ?person a ex:Blogger. } WHERE { ?person foaf:weblog ?blog. }
SPARQL for Validation XSLT can be used for XML Validation (Schematron) SPARQL can be used for RDF Validation
Validation – ASK * ASK WHERE { #triple patterns that you don’t want to find } *Source: Talis Platform  Field Predicate Map Validation
Validation – CONSTRUCT * CONSTRUCT { #some error message or data } WHERE { #triple patterns that you don’t want to find } *Source: Alistair Miles,  Schemarama  2 Jena 2 Validation Support
In Combination?
The ADC Pattern ASK – DESCRIBE – CONSTRUCT  Probe endpoint Grab default view of data Refine data extraction and/or apply transformation
Questions?

Más contenido relacionado

La actualidad más candente

20080917 Rev
20080917 Rev20080917 Rev
20080917 Rev
charper
 
Web of Data Usage Mining
Web of Data Usage MiningWeb of Data Usage Mining
Web of Data Usage Mining
Markus Luczak-Rösch
 
Cornell20080516
Cornell20080516Cornell20080516
Cornell20080516
charper
 

La actualidad más candente (20)

Sparql
SparqlSparql
Sparql
 
dotNetRDF - A Semantic Web/RDF Library for .Net Developers
dotNetRDF - A Semantic Web/RDF Library for .Net DevelopersdotNetRDF - A Semantic Web/RDF Library for .Net Developers
dotNetRDF - A Semantic Web/RDF Library for .Net Developers
 
Introduction to dotNetRDF
Introduction to dotNetRDFIntroduction to dotNetRDF
Introduction to dotNetRDF
 
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQLFacet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
 
20080917 Rev
20080917 Rev20080917 Rev
20080917 Rev
 
An Introduction to the Open Archives Initiative Object Reuse and Exchange (OA...
An Introduction to the Open Archives Initiative Object Reuse and Exchange (OA...An Introduction to the Open Archives Initiative Object Reuse and Exchange (OA...
An Introduction to the Open Archives Initiative Object Reuse and Exchange (OA...
 
Tutorial Linked APIs
Tutorial Linked APIsTutorial Linked APIs
Tutorial Linked APIs
 
Linked Data Fragments
Linked Data FragmentsLinked Data Fragments
Linked Data Fragments
 
Hadoop Frameworks Panel__HadoopSummit2010
Hadoop Frameworks Panel__HadoopSummit2010Hadoop Frameworks Panel__HadoopSummit2010
Hadoop Frameworks Panel__HadoopSummit2010
 
RDFa Tutorial
RDFa TutorialRDFa Tutorial
RDFa Tutorial
 
Grails And The Semantic Web
Grails And The Semantic WebGrails And The Semantic Web
Grails And The Semantic Web
 
Clustering Search to Navigate A Case Study of the Canadian World Wide Web as ...
Clustering Search to Navigate A Case Study of the Canadian World Wide Web as ...Clustering Search to Navigate A Case Study of the Canadian World Wide Web as ...
Clustering Search to Navigate A Case Study of the Canadian World Wide Web as ...
 
Sustainable queryable access to Linked Data
Sustainable queryable access to Linked DataSustainable queryable access to Linked Data
Sustainable queryable access to Linked Data
 
Harnessing The Semantic Web
Harnessing The Semantic WebHarnessing The Semantic Web
Harnessing The Semantic Web
 
Querying data on the Web – client or server?
Querying data on the Web – client or server?Querying data on the Web – client or server?
Querying data on the Web – client or server?
 
Web of Data Usage Mining
Web of Data Usage MiningWeb of Data Usage Mining
Web of Data Usage Mining
 
Rapid Digitization of Latin American Ephemera with Hydra
Rapid Digitization of Latin American Ephemera with HydraRapid Digitization of Latin American Ephemera with Hydra
Rapid Digitization of Latin American Ephemera with Hydra
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
Cornell20080516
Cornell20080516Cornell20080516
Cornell20080516
 
469 talk
469 talk469 talk
469 talk
 

Similar a SPARQL Query Forms

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
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
Lino Valdivia
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
Leigh Dodds
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
Leigh Dodds
 
Deploying PHP applications using Virtuoso as Application Server
Deploying PHP applications using Virtuoso as Application ServerDeploying PHP applications using Virtuoso as Application Server
Deploying PHP applications using Virtuoso as Application Server
webhostingguy
 

Similar a SPARQL Query Forms (20)

Semantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorialSemantic web meetup – sparql tutorial
Semantic web meetup – sparql tutorial
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQL
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
A Little SPARQL in your Analytics
A Little SPARQL in your AnalyticsA Little SPARQL in your Analytics
A Little SPARQL in your Analytics
 
SPARQL 1.1 Status
SPARQL 1.1 StatusSPARQL 1.1 Status
SPARQL 1.1 Status
 
AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101
 
Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and 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
 
What;s Coming In SPARQL2?
What;s Coming In SPARQL2?What;s Coming In SPARQL2?
What;s Coming In SPARQL2?
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
 
Creating APIs over RDF
Creating APIs over RDFCreating APIs over RDF
Creating APIs over RDF
 
Deploying PHP applications using Virtuoso as Application Server
Deploying PHP applications using Virtuoso as Application ServerDeploying PHP applications using Virtuoso as Application Server
Deploying PHP applications using Virtuoso as Application Server
 
Uplift – Generating RDF datasets from non-RDF data with R2RML
Uplift – Generating RDF datasets from non-RDF data with R2RMLUplift – Generating RDF datasets from non-RDF data with R2RML
Uplift – Generating RDF datasets from non-RDF data with R2RML
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
Porting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQLPorting Applications From Oracle To PostgreSQL
Porting Applications From Oracle To PostgreSQL
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
2008 11 13 Hcls Call
2008 11 13 Hcls Call2008 11 13 Hcls Call
2008 11 13 Hcls Call
 
Introduction to metadata cleansing using SPARQL update queries
Introduction to metadata cleansing using SPARQL update queriesIntroduction to metadata cleansing using SPARQL update queries
Introduction to metadata cleansing using SPARQL update queries
 
Sparql a simple knowledge query
Sparql  a simple knowledge querySparql  a simple knowledge query
Sparql a simple knowledge query
 

Más de Leigh Dodds

Más de Leigh Dodds (20)

Being a data magpie
Being a data magpieBeing a data magpie
Being a data magpie
 
How you (yes, you!) can contribute to open data
How you (yes, you!) can contribute to open dataHow you (yes, you!) can contribute to open data
How you (yes, you!) can contribute to open data
 
Accessible Bath Training
Accessible Bath TrainingAccessible Bath Training
Accessible Bath Training
 
Accessible Bath
Accessible BathAccessible Bath
Accessible Bath
 
Cheap bots done quick lightning talk
Cheap bots done quick lightning talkCheap bots done quick lightning talk
Cheap bots done quick lightning talk
 
Open data in bath
Open data in bathOpen data in bath
Open data in bath
 
Bath: Hacked Learning Night: Introduction to CartoDB
Bath: Hacked Learning Night: Introduction to CartoDBBath: Hacked Learning Night: Introduction to CartoDB
Bath: Hacked Learning Night: Introduction to CartoDB
 
Dungeons and Dragons and Data
Dungeons and Dragons and DataDungeons and Dragons and Data
Dungeons and Dragons and Data
 
Love the Environment Pre-Meetup
Love the Environment Pre-MeetupLove the Environment Pre-Meetup
Love the Environment Pre-Meetup
 
Why I love open data and you should too
Why I love open data and you should tooWhy I love open data and you should too
Why I love open data and you should too
 
Introduction to Open Data & Bath: Hacked
Introduction to Open Data & Bath: HackedIntroduction to Open Data & Bath: Hacked
Introduction to Open Data & Bath: Hacked
 
Bath: Hacked: open data, the arts and cultural heritage
Bath: Hacked: open data, the arts and cultural heritageBath: Hacked: open data, the arts and cultural heritage
Bath: Hacked: open data, the arts and cultural heritage
 
Introduction to Open Data & Linked Data
Introduction to Open Data & Linked DataIntroduction to Open Data & Linked Data
Introduction to Open Data & Linked Data
 
Time Travelling with Open Data
Time Travelling with Open DataTime Travelling with Open Data
Time Travelling with Open Data
 
Ignite for Good: Why I Love Open Data and You Should Too
Ignite for Good: Why I Love Open Data and You Should TooIgnite for Good: Why I Love Open Data and You Should Too
Ignite for Good: Why I Love Open Data and You Should Too
 
Oil and Water: When Data Licences Don't Mix
Oil and Water: When Data Licences Don't MixOil and Water: When Data Licences Don't Mix
Oil and Water: When Data Licences Don't Mix
 
Linked Data Patterns
Linked Data PatternsLinked Data Patterns
Linked Data Patterns
 
Digital Grafitti for Digital Cities
Digital Grafitti for Digital CitiesDigital Grafitti for Digital Cities
Digital Grafitti for Digital Cities
 
Layered Data: An Example
Layered Data: An ExampleLayered Data: An Example
Layered Data: An Example
 
Data Foundations for Digital Cities
Data Foundations for Digital CitiesData Foundations for Digital Cities
Data Foundations for Digital Cities
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

SPARQL Query Forms

  • 1. SPARQL Query Forms Leigh Dodds, Oxford SWIG, March 2008 Photo Credit: Glen Bowman
  • 2. Why are there 4 SPARQL Query Forms? SPARQL Use Cases doesn’t help very much…
  • 3.
  • 5. SELECT Equivalent to SQL SELECT Returns a nice, regular table
  • 6. SELECT PREFIX table: <http://www.daml.org/2003/01/periodictable/PeriodicTable#> SELECT ?name ?weight WHERE { ?element table:name ?name; table:atomicWeight ?weight. } ORDER BY DESC(?weight) LIMIT 10
  • 7. ASK Returns a true/false value Is there data that looks like this ? Do you have any information about that ?
  • 8. ASK PREFIX foaf: <http://xmlns.com/foaf/0.1/> ASK WHERE { ?person a foaf:Person ; foaf:mbox <mailto:leigh@ldodds.com>. } (SPARQL equivalent of a vanity search!)
  • 9. CONSTRUCT Returns an RDF graph Extract a specific subset of the queried data I want this , this , and this
  • 10. CONSTRUCT PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?friend a foaf:Person; foaf:name ?name; foaf:homepage ?home. } WHERE { ?person foaf:mbox <mailto:leigh@ldodds.com>; foaf:knows ?friend. ?friend foaf:name ?name; foaf:homepage ?home. }
  • 11. DESCRIBE Returns an RDF graph Tell me about this or things that look like this … but you decide what’s relevant
  • 12. DESCRIBE PREFIX foaf: <http://xmlns.com/foaf/0.1/> DESCRIBE ?friend WHERE { ?person foaf:mbox “mailto:leigh@ldodds.com”; foaf:knows ?friend. }
  • 13. Applied Uses Beyond the basics
  • 14. DESCRIBE for Prototyping DESCRIBE <http://example.org/someResource> Quickly assembling UIs Web APIs
  • 15. SELECT for Indexing Building an ordering over some data ORDER BY, LIMIT
  • 16. CONSTRUCT for Transformation … and also simple inferencing CONSTRUCT could be the XSLT of RDF Currently limited by lack of expressions in CONSTRUCT triple templates
  • 17. CONSTRUCT for Transformation PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX ex: <http://www.example.org/blogger/> CONSTRUCT { ?person a ex:Blogger. } WHERE { ?person foaf:weblog ?blog. }
  • 18. SPARQL for Validation XSLT can be used for XML Validation (Schematron) SPARQL can be used for RDF Validation
  • 19. Validation – ASK * ASK WHERE { #triple patterns that you don’t want to find } *Source: Talis Platform Field Predicate Map Validation
  • 20. Validation – CONSTRUCT * CONSTRUCT { #some error message or data } WHERE { #triple patterns that you don’t want to find } *Source: Alistair Miles, Schemarama 2 Jena 2 Validation Support
  • 22. The ADC Pattern ASK – DESCRIBE – CONSTRUCT Probe endpoint Grab default view of data Refine data extraction and/or apply transformation