Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C4.

Slides:



Advertisements
Similar presentations
Natural Language Systems, Department of Informatics, University of Hamburg NATS IR in WWW Dozentin: C. Vertan Autor: M. Hoffmann RDF Resource Description.
Advertisements

1Patrick Stickler © 2004 Nokia Nokia Semantic Web Server Patrick Stickler Forum Nokia Web Services Nokia Technology Platforms
XPointer and HTTP Range A possible design for a scalable and extensible RDF Data Access protocol. Bryan Thompson draft Presented to the RDF.
UKOLN, University of Bath
Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: XPath, NameSpaces.
1 SPARQL: A query language for RDF Matthew Yau
Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C3.
LAOS: Layered WWW AHS Authoring Model and their corresponding Algebraic Operators Dr. Alexandra Cristea
Alexandra Cristea & Matthew Yau 1.
1 ARIN – KR Practical 1, Part 2 RDF Some of these slides are based on tutorial by Ivan Herman (W3C) reproduced here with kind permission. All changes and.
CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Dr. Alexandra I. Cristea XPath and Namespaces.
Bottom-up Evaluation of XPath Queries Stephanie H. Li Zhiping Zou.
Method for developing the benchmark suites. October 10th © Raúl García-Castro Method for developing the benchmark suites Raúl García-Castro October.
Querying the RDF: Small Case Study in the Bicycle Sale Domain Ondřej Šváb, Vojtěch Svátek, Martin Kavalec, Martin Labský VŠE, University of Economics,
RDF Schemata (with apologies to the W3C, the plural is not ‘schemas’) CSCI 7818 – Web Technologies 14 November 2001 Van Lepthien.
The Semantic Web – WEEK 4: RDF
SPARQL- A QUERY LANGUAGE FOR RDF( S ) Fred Freitas - CIn/UFPE - Brazil.
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.
27 January Semantically Coordinated E-Market Semantic Web Term Project Prepared by Melike Şah 27 January 2005.
The Vision and Basic Technologies of the Semantic Web.
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
An Introduction to XML Based on the W3C XML Recommendations.
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
1 XQuery Web and Database Management System. 2 XQuery XQuery is to XML what SQL is to database tables XQuery is designed to query XML data What is XQuery?
/ department of mathematics and computer science TU/e eindhoven university of technology ISAApril 17, What is Wrong with RQL? Flavius Frasincar
RDF Databases By: Chris Halaschek. Outline Motivation / Requirements Storage Issues Sesame General Introduction Architecture Scalability RQL Introduction.
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.
The Semantic Web Resource Description Framework (RDF) Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh.
XQL (XML Query Language) Jonathan Robie (Software AG) Eduard Derksen (CSCIO) Peter Fankhauser (GMD-IPSI) Ed Howland (DEGA) Gerald Huck (GMD-IPSI) Ingo.
1 COS 425: Database and Information Management Systems XML and information exchange.
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
VLDB 2005 An Efficient SQL-based RDF Querying Scheme Eugene Inseok Chong Souripriya Das George Eadon Jagannathan Srinivasan New England Development Center.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
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:
-By Mohamed Ershad Junaid UTD ID :
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
SPARQL Semantic Web - Spring 2008 Computer Engineering Department Sharif University of Technology.
The Semantic Web Web Science Systems Development Spring 2015.
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.
XQL, OQL and SQL Xia Tang Sixin Qian Shijun Shen Feb 18, 2000.
Ontology Query. What is an Ontology Ontologies resemble faceted taxonomies but use richer semantic relationships among terms and attributes, as well as.
SQL: Data Manipulation Presented by Mary Choi For CS157B Dr. Sin Min Lee.
SPARQL All slides are adapted from the W3C Recommendation SPARQL Query Language for RDF Web link:
Efficient RDF Storage and Retrieval in Jena2 Written by: Kevin Wilkinson, Craig Sayers, Harumi Kuno, Dave Reynolds Presented by: Umer Fareed 파리드.
Practical RDF Chapter 10. Querying RDF: RDF as Data Shelley Powers, O’Reilly SNU IDB Lab. Hyewon Lim.
Practical RDF Ch.10 Querying RDF: RDF as Data Taewhi Lee SNU OOPSLA Lab. Shelley Powers, O’Reilly August 27, 2004.
Ontology based e-Real Estate Agency Information System By Moein Mehrolhasani Bijan Zamanian cmpe 588.
05/01/2016 SPARQL SPARQL Protocol and RDF Query Language S. Garlatti.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
An Effective SPARQL Support over Relational Database Jing Lu, Feng Cao, Li Ma, Yong Yu, Yue Pan SWDB-ODBIS 2007 SNU IDB Lab. Hyewon Lim July 30 th, 2009.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 7: SPARQL (1.0) Aidan Hogan
Sesame A generic architecture for storing and querying RDF and RDFs Written by Jeen Broekstra, Arjohn Kampman Summarized by Gihyun Gong.
Semantic Web in Depth SPARQL Protocol and RDF Query Language Dr Nicholas Gibbins –
Select Complex Queries Database Management Fundamentals LESSON 3.1b.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
More SQL: Complex Queries,
Chapter 2 RDF Syntax 1.
CC La Web de Datos Primavera 2017 Lecture 7: SPARQL [i]
SPARQL.
SPARQL SPARQL Protocol and RDF Query Language
Logics for Data and Knowledge Representation
CC La Web de Datos Primavera 2016 Lecture 7: SPARQL (1.0)
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Logics for Data and Knowledge Representation
Presentation transcript:

Dr. Alexandra I. Cristea CS 253: Topics in Database Systems: C4

Previously we looked at: –XML, and its query language(s) –RDF Next: –RDF query languages

RDF query languages

Proposals SPARQL – RDQL – RQL – SeRQL – Triple: – N3: – Comparison of languages: –

SeRQL

Introduction SeRQL "Sesame RDF Query Language", pronounced "circle new RDF/RDFS query language currently being developed by Aduna as part of Sesame. It combines (best?) features of other (query) languages (RQL, RDQL, N-Triples, N3) and adds some of its own.

Sesame open source RDF framework with support for RDF Schema inferencing and querying. Originally, it was developed by Aduna (then known as Aidministrator) as a research prototype for the EU research project On-To- Knowledge.AdunaOn-To- Knowledge further developed and maintained by Aduna in cooperation with NLnet Foundation, developers from Ontotext, and a number of volunteer developersNLnet FoundationOntotext

SeRQL's features Graph transformation. RDF Schema support. XML Schema datatype support. Expressive path expression syntax. Optional path matching.

SeRQL basic building blocks RDF: –URIs, –literals and –variables URIs and literals variables

Variables identified by names. must start with a letter or an underscore ('_') and can be followed by zero or more letters, numbers, underscores, dashes ('-') or dots ('.'). Examples: Var1 _var2 unwise.var-name_isnt-it SeRQL keywords are not allowed to be used as variable names.

(reserved) Keywords Currently: select, construct, from, where, using, namespace, true, false, not, and, or, like, label, lang, datatype, null, isresource, isliteral, sort, in, union, intersect, minus, exists, forall, distinct, limit, offset. case-insensitive, (unlike variable names).

URIs full URIs abbreviated URIs (QNames)

Full URIs must be surrounded with " ". Tend to be long (!!) Examples:

Abbreviated URIs (QNames) Components: defined prefix (for the namespace) and a colon ( : ), then the URI part that is not a namespace Examples: sesame:index.html rdf:type foaf:Person

Literals Parts: –label, –language tag, and –datatype Examples: "foo" " "^^ " "^^rdf:XMLLiteral Optional, mutually exclusive Language tag datatype label

Blank nodes RDF has a notion of blank nodes. –nodes that are not labelled with a URI or literal. –Interpretation ( ): "there exists a node such that..." –Blank nodes have internal identifiers Shortcut in SeRQL: _:bnode1 Attention: problem of non-portability!!!

Path expressions expressions that match specific paths through an RDF graph usually, triples = path expressions of length 1 in SeRQL: arbitrary length

Basic path expressions Query: –persons who work for (companies that are) IT companies.

Original (possible) RDF: rdf:resource= rdf:resource= chema#ITCompany

Basic path expressions Query: –persons who work for (companies that are) IT companies. {Person} foo:worksFor {Company} rdf:type {foo:ITCompany} Person Company Triple (length =1):

Multiple Path Expressions Separated with commas Example: {Person} ex:worksFor {Company}, {Company} rdf:type {ex:ITCompany}

Non-interesting nodes Can be left empty Examples: {Person} ex:worksFor {} rdf:type {ex:ITCompany} {Painting} ex:painted_by {} ex:name {"Picasso"}

Path expression short cuts Multi-value nodes Branches Reified statements

Multi-valued nodes Multiple objects: {subj1} pred1 {obj1, obj2, obj3} Multiple subjects: {subj1, subj2, subj3} pred1 {obj1} Condition: disjoint !!

Branches {subj1} pred1 {obj1}; pred2 {obj2} Equivalent to: {subj1} pred1 {obj1}, {subj1} pred2 {obj2}

Reified statements { {reifSubj} reifPred {reifObj} } pred {obj} Equivalent to: {_Statement} rdf:type {rdf:Statement}, {_Statement} rdf:subject {reifSubj}, {_Statement} rdf:predicate {reifPred}, {_Statement} rdf:object {reifObj}, {_Statement} pred {obj}

Optional Path Expressions {Person} ex:name {Name}; ex:age {Age}; [ex: { Address}]

Queries in SeRQL Select queries: –returning a table of values, or a set of variable-value bindings. –SELECT, FROM, WHERE, LIMIT, OFFSET and USING NAMESPACE Construct queries: –returns a true RDF graph –CONSTRUCT, FROM, WHERE, LIMIT, OFFSET and USING NAMESPACE

Select queries SELECT C FROM {C} rdf:type {rdfs:Class} –returns all URIs of classes SELECT DISTINCT * FROM {Country1} ex:borders {} ex:borders {Country2} USING NAMESPACE ex =

Construct queries CONSTRUCT {Parent} ex:hasChild {Child} FROM {Child} ex:hasParent {Parent} USING NAMESPACE ex = CONSTRUCT * FROM {SUB} rdfs:subClassOf {SUPER} –This query extracts all rdfs:subClassOf relations from an RDF graph.

WHERE clause Optional; Specifies Boolean constraints SELECT Country FROM {Country} ex:population {Population} WHERE Population < " "^^xsd:positiveInteger USING NAMESPACE ex =

Nested WHERE clauses Query 1 (normal WHERE-clause): SELECT Name, Address FROM {Person} foaf:name {Name}; [ex: { Address}] WHERE Address LIKE "g*" Query 2 (nested WHERE-clause): SELECT Name, Address FROM {Person} foaf:name {Name}; [ex: { Address} WHERE Address LIKE "g*"] at most one nested WHERE-clause per optional path expression, and at most one 'normal' WHERE-clause

Results WHERE queries Query 1 Name Address Query 2 (nested WHERE) Name Address Michael Rubens

LIKE operator SELECT Country FROM {Country} ex:name {Name} WHERE Name LIKE netherlands" IGNORE CASE USING NAMESPACE ex =

Built-in predicates {X} serql:directSubClassOf {Y} {X} serql:directSubPropertyOf {Y} {X} serql:directType {Y}

Set combinatory operations Union Intersect Minus

Union SELECT title FROM {book} dc10:title {title} UNION SELECT title FROM {book} dc11:title {title} USING NAMESPACE dc10 =, dc11 =

Intersect SELECT creator FROM {album} dc10:creator {creator} INTERSECT SELECT creator FROM {album} dc11:creator {creator} USING NAMESPACE dc10 =, dc11 =

Minus (difference) SELECT title FROM {album} dc10:title {title} MINUS SELECT title FROM {album} dc10:title {title}; dc10:creator {creator} WHERE creator like "Paul" USING NAMESPACE dc10 =, dc11 =

NULL values SELECT * FROM {X} Y {Z} WHERE isLiteral(Z) AND datatype(L) = NULL –to check that a literal doesn't have a datatype;

Query Nesting IN ANY, ALL EXISTS

IN SELECT name FROM {} rdf:type {ex:Person}; ex:name {name} WHERE name IN ( SELECT n FROM {} rdf:type {ex:Author}; ex:name {n} ) USING NAMESPACE ex = retrieve all names of Persons, but only those names that also appear as names of Authors.

ANY, ALL SELECT highestValue FROM {node} ex:value {highestValue} WHERE highestValue >= ALL ( SELECT value FROM {} ex:value {value} ) USING NAMESPACE ex =

EXISTS SELECT name, hobby FROM {} rdf:type {ex:Person}; ex:name {name}; ex:hobby {hobby} WHERE EXISTS ( SELECT n FROM {} rdf:type {ex:Author}; ex:name {n}; ex:authorOf {} WHERE n = name ) USING NAMESPACE ex =

RDF Query Languages Conclusion We have learned: –There is a high competition for providing The RDF query language –No standards as yet –We have looked in more details at one of them, SeRQL, as it is an implementers language paired with an existing RDF repository tool, Sesame –Many features in SeRQL remind us of SQL, thus learning threshold should be low

Next: –OWL