SPARQL Query Forms

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    SPARQL Query Forms - Presentation Transcript

    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. …neither does the SPARQL specification
      • SELECT
      • Returns all, or a subset of, the variables bound in a query pattern match.
      • CONSTRUCT
      • Returns an RDF graph constructed by substituting variables in a set of triple templates.
      • ASK
      • Returns a boolean indicating whether a query pattern matches or not.
      • DESCRIBE
      • Returns an RDF graph that describes the resources found.
    4. What are they for?
    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
    21. In Combination?
    22. The ADC Pattern ASK – DESCRIBE – CONSTRUCT Probe endpoint Grab default view of data Refine data extraction and/or apply transformation
    23. Questions?

    + Leigh DoddsLeigh Dodds, 2 years ago

    custom

    2889 views, 0 favs, 2 embeds more stats

    Examines the different SPARQL query forms to tease more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2889
      • 2859 on SlideShare
      • 30 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 44
    Most viewed embeds
    • 26 views on http://www.ldodds.com
    • 4 views on http://planetrdf.com

    more

    All embeds
    • 26 views on http://www.ldodds.com
    • 4 views on http://planetrdf.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags