Logics for Data and Knowledge Representation

Slides:



Advertisements
Similar presentations
Digital Repositories – Linked Open Data – the possible Role of D4Science Workshop, December 2010, FAO use cases A tool to create Linked Data providers.
Advertisements

CH-4 Ontologies, Querying and Data Integration. Introduction to RDF(S) RDF stands for Resource Description Framework. RDF is a standard for describing.
Logics for Data and Knowledge Representation Projects and thesis introduction.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Semantic Web - Query Languages – Steffen Staab
 Copyright 2004 Digital Enterprise Research Institute. All rights reserved. SPARQL Query Language for RDF presented by Cristina Feier.
Alexandria Digital Library Project The ADEPT Bucket Framework.
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.
A division of Publishing Technology Facet Building Web Pages With SPARQL SWIG-UK Event, HP Labs November 23 rd 2007 Leigh Dodds Chief Technology Officer,
Actual Trends Semantic Web Lecture WS 2010/2011. What‘s next? W3C view: Look at Semantic Web activity:
RDF Kitty Turner. Current Situation there is hardly any metadata on the Web search engine sites do the equivalent of going through a library, reading.
Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
UKOLUG - July Metadata for the Web RDF and the Dublin Core Andy Powell UKOLN, University of Bath UKOLN.
Logics for Data and Knowledge Representation SPARQL Protocol and RDF Query Language (SPARQL) Feroz Farazi.
© 2006 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Publishing data on the Web (with.
Logics for Data and Knowledge Representation Resource Description Framework (RDF) -- Exercises 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:
Michalis Vafopoulos NTUA, GFOSS & The transformers GREEN CITY HACKATHON.
Introduction to SPARQL. Acknowledgements This presentation is based on the W3C Candidate Recommendation “SPARQL Query Language for RDF” from
1 SAMT’08 Semantic-driven multimedia retrieval with the MPEG Query Format Ruben Tous and Jaime Delgado Distributed Multimedia Applications Group (DMAG)
Logics for Data and Knowledge Representation
The Semantic Web Web Science Systems Development Spring 2015.
Taking Action: Linked Data for Digital Library Managers Silvia Southwick and Cory Lampert UNLV Digital Collections American Library Association Annual.
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.
Logics for Data and Knowledge Representation SPARQL -- Exercises Feroz Farazi.
Metadata. Generally speaking, metadata are data and information that describe and model data and information For example, a database schema is the metadata.
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.
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!
Embedding Knowledge in HTML Some content from a presentations by Ivan Herman of the W3c.
Semantic Web Basics Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation.
Understanding RDF. 2/30 What is RDF? Resource Description Framework is an XML-based language to describe resources. A common understanding of a resource.
Logics for Data and Knowledge Representation Web Ontology Language (OWL) -- Exercises Feroz Farazi.
RDF, RDF, RDF…. Lecture 22. XML Data New Article.
Enter your user name Enter your password Log in Forgot your password? Sign up! UploadMapPreviewPublishLog inConfigure Log in&authorization.
Doc.: IEEE /0169r0 Submission Joe Kwak (InterDigital) Slide 1 November 2010 Slide 1 Overview of Resource Description Framework (RFD/XML) Date:
Alexandra Cristea 1.  pronounced "sparkle“  recursive acronym for: ◦ SPARQL Protocol and RDF Query Language  a semantic query language  a query language.
CC L A W EB DE D ATOS P RIMAVERA 2015 Lecture 7: SPARQL (1.0) Aidan Hogan
Semantic Web in Depth SPARQL Protocol and RDF Query Language Dr Nicholas Gibbins –
Insert location Picture here Insert place Picture here Insert Human- Environment Picture here Insert Regions Picture here Insert movement Picture here.
Dr. Alexandra I. Cristea SPARQL Exerciess.
SPARQLing SERVICES Leigh Dodds Engineering Manager, Ingenta XTech, May 2006.
1 RDF Storage and Retrieval Systems Jan Pettersen Nytun, UiA.
Subjects in the FR family
Linked Data Competency Index
Digital Media Technology
Developing Linked Data Applications
Vincenzo Maltese, Fausto Giunchiglia University of Trento
Linked Data Web that can be processed by machines
Introduction to Persistent Identifiers
CC La Web de Datos Primavera 2017 Lecture 7: SPARQL [i]
DATA INTEGRATION FOR LANGUAGE DOCUMENTATION
SPARQL.
RDF and RDB 1 Some slides adapted from a presentation by Ivan Herman at the Semantic Technology & Business Conference, 2012.
Introduction to SPARQL
Resource Description Framework
SPARQL SPARQL Protocol and RDF Query Language
Middleware independent Information Service
Embedding Knowledge in HTML
Presentation Title Here
Jena Sparql (for Mac) 9/22/2018.
Logics for Data and Knowledge Representation
CC La Web de Datos Primavera 2016 Lecture 7: SPARQL (1.0)
Logics for Data and Knowledge Representation
CSIRO ICT Centre Conference
Embedding Knowledge in HTML
Logics for Data and Knowledge Representation
Presentation transcript:

Logics for Data and Knowledge Representation SPARQL -- Exercises Feroz Farazi 1

Exercise 1 Suppose that an RDF model represents information about real world entities of unknown types. The entities can be persons, locations, books, monuments, organizations, etc. Write a SPARQL query to return all possible information about all kinds of entities. Write a SPARQL query that can return at most 5 triples representing information

Solution 1 SELECT ?x ?y ?z WHERE { ?x ?y ?z } SELECT ?x ?y ?z WHERE (ii) SELECT ?x ?y ?z WHERE { ?x ?y ?z } LIMIT 5 You can try the queries here: http://www.sparql.org/query.html

Exercise 2 Given that an RDF model represents information about books and the model is created using standard vocabularies. Write a SPARQL query that can return the authors of the books. Note that books can be represented as URIs. Write a SPARQL query that can return the authors of the books. Note that books must be represented as literals if available otherwise as URIs. Write a SPARQL query that can return the date of publication of the books.

Solution 2 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?book ?author WHERE { ?book dc:creator ?author } (ii) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle }

Solution 2 PREFIX dc: <http://purl.org/dc/elements/1.1/> (iii) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?dateOfPublication WHERE { ?book dc:date ?dateOfPublication. ?book dc:title ?bookTitle }

Exercise 3 Given that an RDF model represents information about books and the model is created using standard vocabularies. (i) Write a SPARQL query that returns the authors and publishers of the books for which publisher information is available. (ii) Write a SPARQL query that returns the authors and publishers of the books for which publisher might or might not be (or optionally) available.

Solution 3 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author ?publishingHouse WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. ?book dc:publisher ?publishingHouse }

Solution 3 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author ?publishingHouse WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. OPTIONAL {?book dc:publisher ?publishingHouse . } }

Exercise 4 Given that an RDF model represents information about books and the model is created using standard vocabularies. (i) Write a SPARQL query that returns the authors of the books in descending order. (ii) Write a SPARQL query that returns the authors of the books that have titles start with “Harry Potter”. (iii) Write a SPARQL query that returns the authors of the books that have titles containing the term “deathly” or “Deathly”.

Solution 4 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. } ORDER BY DESC (?author)

Solution 4 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. FILTER regex(?bookTitle, “^Harry Potter") }

Solution 4 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?bookTitle ?author WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. FILTER regex(?bookTitle, "deathly", "i") }

Exercise 5 Given that an RDF model represents information about various entities including books and the model is created using standard vocabularies. Write a SPARQL query that separates information about books i.e. title and author and creates another RDF model that is a subset of the original one. Write a SPARQL query that separates information about books i.e. title, author and publisher (if any) and creates another RDF model that is a subset of the original one.

Solution 5 (i) PREFIX dc: <http://purl.org/dc/elements/1.1/> CONSTRUCT {?book dc:creator ?author. ?book dc:title ?bookTitle} WHERE { ?book dc:creator ?author. ?book dc:title ?bookTitle. }

Solution 5 (ii) PREFIX dc: <http://purl.org/dc/elements/1.1/> CONSTRUCT {?book dc:creator ?author. ?book dc:title ?bookTitle. ?book dc:publisher ?pub } WHERE { ?book dc:creator ?author. OPTIONAL {?book dc:publisher ?pub} }

Exercise 6 (laboratory) Given that an xml file contains metadata about some web resources. Publish them in an RDF model using standard vocabularies. In case of absence of some of the terms in the standard vocabularies, create a namespace and define them in the target of this namespace.

Exercise 7 (laboratory) Given that an excel (.xls) file represents information about shapes of the rivers of the Trentino region. Publish them in an RDF model using standard vocabularies. In case of absence of some of the terms in the standard vocabularies, create a namespace and define them in the target of this namespace.

Exercise 8 (laboratory) Given that an excel (.xls) file represents information about bicylce tracks of the Trentino region. Publish them in an RDF model using standard vocabularies. In case of absence of some of the terms in the standard vocabularies, create a namespace and define them in the target of this namespace.

Exercise 9 (laboratory) Create a mash-up with data and metadata generated in the exercises 6-8 and also image data originating possibly from Flickr and finally show the result on Google Map. [P. Shvaiko, F. Farazi, V. Maltese, A. Ivanyukovich, V. Rizzi, D. Ferrari and G. Ucelli. TRENTINO GOVERNMENT LINKED OPEN GEODATA: A CASE STUDY. ISWC 2012]