Resource Description Framework (RDF) in use

Before the lab

Introduction

Lab instructions

1 SPARQL - demo

  1. Go to SPARQLer
    1. check the Force the accept header to text/plain regardless
    2. test available result formats for example queries (JSON output / text output / CSV output / TSV output)
    3. run the Construct query and analyze the result
  2. 8-) What do SELECT queries do?
  3. 8-) What do CONSTRUCT queries do?

2 SPARQL queries - basics

  1. In this exercise we will use Twinkle (screenshots)
  2. Run Twinkle
    On Charon: Open Terminal and type:
     $ twinkle 
  3. Test the examples for PeriodicTable and PlanetFeed (Choose File → Open → examples/…)
  4. Let's get back to our FOAF files. Do you have yours? 8-O
  5. Execute queries on your foaf file to retrieve :
    • friends who have name and e-mail defined
    • friends who have name and e-mail defined and optional homepage
    • friends who have name and e-mail defined and optional homepage, sorted by name descending
  • 8-) Put the constructed queries in the report.

Hints:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT DISTINCT ?name
FROM <http://home.agh.edu.pl/~wta/foaf.rdf>
WHERE { 
    ?x rdf:type foaf:Person . 
    ?x foaf:name ?name
}
LIMIT 10

3 SPARQL queries - options

In this exercise use the FOAF files of your friends. Hint: cooperate, ask your friends to give you the URI of their FOAF :!:

Run Twinkle and execute queries on chosen foaf file to retrive :

  • people whose name starts with 'K'
  • people who are older than 18 years old
  • people whose name starts with 'K' or are older than 18 years old, make search caseinsensitive
  • people having e-mails on student.agh.edu.pl server
  • name of people, who have homepage or e-mail on student.agh.edu.pl server

8-) Put the queries in the report.

Extra:

  • To view the semantic information and conveniently visualize RDF files you can install (at home) the Tabulator extension to your Web browser.

If you want to know more

pl/dydaktyka/semantic_web/new-semweb-rdfinuse.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0