SPARQL.

Slides:



Advertisements
Similar presentations
1 SPARQL: A query language for RDF Matthew Yau
Advertisements

Alexandra Cristea & Matthew Yau 1.
Introduction to RDF Based on tutorial at
1 RDF Tutorial. C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes.
RDF – RESOURCE DESCRIPTION FRAMEWORK Antonio Bucchiarone FBK-IRST Trento, Italy 20 Novembre 2009.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
Semantic Web Introduction
© Copyright IBM Corporation 2014 Getting started with Rational Engineering Lifecycle Manager queries Andy Lapping – Technical sales and solutions Joanne.
SPARQL RDF Query.
RDF formats for Linked Data by Mabi Harandi. RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle.
Chapter 3 RDF Syntax 1. Topics Basic concepts of RDF resources, properties, values, statements, triples URIs and URIrefs RDF graphs Literals and Qnames.
SPARQL for Querying PML Data Jitin Arora. Overview SPARQL: Query Language for RDF Graphs W3C Recommendation since 15 January 2008 Outline: Basic Concepts.
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
Dr. Alexandra I. Cristea RDF.
RDF: Building Block for the Semantic Web Jim Ellenberger UCCS CS5260 Spring 2011.
Semantic Web Presented by: Edward Cheng Wayne Choi Tony Deng Peter Kuc-Pittet Anita Yong.
Semantic Web Query Processing with Relational Databases Artem Chebotko Department of Computer Science Wayne State University.
Module 2b: Modeling Information Objects and Relationships IMT530: Organization of Information Resources Winter, 2007 Michael Crandall.
Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with.
Semantic Web Series 1 Mohammad M. R. Cowdhury UniK, Kjeller.
RDF (Resource Description Framework) Why?. XML XML is a metalanguage that allows users to define markup XML separates content and structure from formatting.
SPARQL All slides are adapted from the W3C Recommendation SPARQL Query Language for RDF Web link:
1cs The Need “Most of the Web's content today is designed for humans to read, not for computer programs to manipulate meaningfully.” Berners-Lee,
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
SPARQL Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology.
Chapter 3 Querying RDF stores with SPARQL. Why an RDF Query Language? Why not use an XML query language? XML at a lower level of abstraction than RDF.
Querying with SPARQL Tuesday, October 28, 2014 Technical Exchange on Network Management Interoperability Andrea Westerinen JHU-APL/Nine Points Solutions.
SPARQL W3C Simple Protocol And RDF Query Language
SPARQL AN RDF Query Language. SPARQL SPARQL is a recursive acronym for SPARQL Protocol And Rdf Query Language SPARQL is the SQL for RDF Example: PREFIX.
SPARQL All slides are adapted from the W3C Recommendation SPARQL Query Language for RDF Web link:
RDF and XML 인공지능 연구실 한기덕. 2 개요  1. Basic of RDF  2. Example of RDF  3. How XML Namespaces Work  4. The Abbreviated RDF Syntax  5. RDF Resource Collections.
Turtle – RDF Graph. Turtle – Basic Syntax Triples are terminated with a full stop URLs are encoded in angle brackets ( ) Literals are enclosed by double.
EEL 5937 Ontologies EEL 5937 Multi Agent Systems Lecture 5, Jan 23 th, 2003 Lotzi Bölöni.
1 SPARQL A. Emrah Sanön. 2 RDF RDF is quite committed to Semantic Web. Data model Serialization by means of XML Formal semantics Still something is missing!
Semantic Web Basics Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
Using the DAWG Test Cases with Relational Databases Matthew Gheen October 26, 2007.
Practical RDF Chapter 10. Querying RDF: RDF as Data Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
Dr. Lowell Vizenor Ontology and Semantic Technology Practice Lead Alion Science and Technology Semantic Technology: A Basic Introduction.
THE BIBFRAME EDITOR AND THE LC PILOT Module 3 – Unit 1 The Semantic Web and Linked Data : a Recap of the Key Concepts Library of Congress BIBFRAME Pilot.
05/01/2016 SPARQL SPARQL Protocol and RDF Query Language S. Garlatti.
Alexandra Cristea 1.  pronounced "sparkle“  recursive acronym for: ◦ SPARQL Protocol and RDF Query Language  a semantic query language  a query language.
Of 38 lecture 6: rdf – axiomatic semantics and query.
RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015.
Internet Technologies 1 Master of Information System Management Internet Technologies Making Queries on RDF.
Chapter 5 The Semantic Web 1. The Semantic Web  Initiated by Tim Berners-Lee, the inventor of the World Wide Web.  A common framework that allows data.
Semantic Web in Depth RDFa, GRDDL and POWDER Dr Nicholas Gibbins
Semantic Web in Depth SPARQL Protocol and RDF Query Language Dr Nicholas Gibbins –
Semantic Web In Depth Resource Description Framework Dr Nicholas Gibbins –
Setting the stage: linked data concepts Moving-Away-From-MARC-a-thon.
Linked Data & Semantic Web Technology The Semantic Web Part 4. Resource Description Framework (1) Dr. Myungjin Lee.
Linked Data Competency Index
Charlie Abela Department of Intelligent Computer Systems
Vincenzo Maltese, Fausto Giunchiglia University of Trento
Service-Oriented Computing: Semantics, Processes, Agents
Introduction to SPARQL
SPARQL ดร.มารุต บูรณรัช
Resource Description Framework
SPARQL SPARQL Protocol and RDF Query Language
SPARQL: A query language for RDF
SPARQL Exercise Much of this exercise has been copied from: INF3580/INF4580 – MANDATORY EXERCISE 3
Database Vocabulary Terms.
Logics for Data and Knowledge Representation
SPARQL Exercise Most of this exercise has been copied from: INF3580/INF4580 – MANDATORY EXERCISE 3
JSON for Linked Data: a standard for serializing RDF using JSON
Logics for Data and Knowledge Representation
Triple Stores.
Semantic-Web, Triple-Strores, and SPARQL
Presentation transcript:

SPARQL

What is SPARQL RDF is a format for representing general data about resources. RDF is based on a graph, where subject and object nodes are related by predicate arcs. RDF can be written in XML, or as triples. RDF schema is a method for defining structures for RDF files. It allows RDF resources to be grouped into classes, and allows subclass, subproperty and domain/range descriptions to be specified. SPARQL is a query language for RDF. It provides a standard format for writing queries that target RDF data and a set of standard rules for processing those queries and returning the results.

Object RDF Statements Predicate Subject author Jan Egil Refsnes http://www.w3schools.com/RDF ?subject ?predicate ?object

A sample of SPARQL SELECT ?student WHERE { ?student ex:studies bmod:CS7012 }

SPARQL basics Names beginning with a ? or a $ are variables. Graph patterns are given as a list of triple patterns enclosed within braces {} The variables named after the SELECT keyword are the variables that will be returned as results. (~SQL)

Defining Namespaces PREFIX ex: <http://example.org/> PREFIX bmod: < https://www.scss.tcd.ie/~mcglink/lectures/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name WHERE { ?student ex:studies bmod:CS7012. ?student foaf:name ?name }

FOAF FOAF (Friend Of A Friend) is an experimental project using RDF, which also defines a standardized vocabulary. The goal of FOAF is to make personal home pages machine- readable, and machine-understandable, thereby creating an internet-wide connected database of people. Friend-of-a-friend: http://xmlns.com/foaf/0.1/

FOAF FOAF is based on the idea that most personal home pages contain similar sets of information. For example, the name of a person, the place they live, the place they work, details on what they are working on at the moment, and links to their friends. FOAF defines RDF predicates that can be used to represent these things. These pages can then be understood by a computer and manipulated. In this way, a database can be created to answer questions such as “what projects are my friends working on?”, “do any of my friends know the director of BigCorp?” and similar.

A sample FOAF document <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1"> <foaf:Person> <foaf:name>Kris McGlinn</foaf:name> <foaf:mbox rdf:resource="mailto:Kris.McGlinn@scss.tcd.ie " /> </foaf:Person> </rdf:RDF>

Multiple results PREFIX ex: <http://example.org/> PREFIX bmod: < https://www.scss.tcd.ie/~mcglink/lectures/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?module ?name WHERE { ?student ex:studies ?module. ?student foaf:name ?name }

Abbreviating the same subject PREFIX ex: <http://example.org/> PREFIX bmod: < https://www.scss.tcd.ie/~mcglink/lectures/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?module ?name WHERE { ?student ex:studies ?module; foaf:name ?name }

Abbreviating multiple objects SELECT ?module ?name WHERE { ?student ex:studies ?module. ?student ex:studies bmod:CS7012; foaf:name ?name } is identical to ?student ex:studies ?module, bmod:CS7012;

Optional graph components SELECT ?student ?email WHERE { ?student ex:studies bmod:CS7012. ?student foaf:mbox ?email } The above query returns the names and e-mail addresses of students studying CS7012. However, if a student does not have an e-mail address registered, with a foaf:mbox predicate, then the query will not match and that student will not be included in the list. This may be undesirable.

Optional graph components SELECT ?student ?email WHERE { ?student ex:studies mod:CS7012. OPTIONAL ?student foaf:mbox ?email } Because the email match is declared as OPTIONAL in the query above, SPARQL will match it if it can, but if it can’t, it will not reject the overall pattern because of it. So if a student has no registered e-mail address, they will still appear in the result list with a blank (unbound) value for the ?email result.

Optional graph components SELECT ?module ?name ?age WHERE { ?student ex:studies ?module . ?student foaf:name ?name . OPTIONAL ?student b:age ?age . FILTER (?age > 25) }

Sorting results of a query SELECT ?name ?module WHERE { ?student ex:studies ?module . ?student foaf:name ?name . } ORDER BY ?name SELECT ?name ?age ?student ex:age ?age . ORDER BY DESC (?age) ASC (?name)

Limiting the number of results SELECT ?name ?module WHERE { ?student ex:studies ?module . ?student foaf:name ?name . } LIMIT 20