320302 Databases & WebApplications (P. Baumann)
RDF & SPARQL 320302 Databases & WebApplications (P. Baumann) - - PowerPoint PPT Presentation
RDF & SPARQL 320302 Databases & WebApplications (P. Baumann) - - PowerPoint PPT Presentation
RDF & SPARQL 320302 Databases & WebApplications (P. Baumann) The Semantic Web Stack research / vapourware solid implementations RDF + RDFS WSDL + UDDI URI Unicode SOAP HTTP / SMTP / TCP 320302 Databases & WebServices (P.
2 320302 Databases & WebServices (P. Baumann)
SOAP HTTP / SMTP / … TCP Unicode URI RDF + RDFS WSDL + UDDI
The Semantic Web Stack
research / vapourware solid implementations
3 320302 Databases & WebServices (P. Baumann)
RDF
- Resource Description Framework (RDF)
- framework for describing resources on the web, identified by URIs
= very simple language for making assertions
- model for data, and a syntax
independent parties can exchange & use it
- Query language: SPARQL, see later
- designed to be read and understood by computers,
not designed for being displayed to people
- RDF (conceptual model) is independent from XML (data exchange)
- XML is a transfer syntax (carrier) for RDF, not a component of RDF
- RDF data might never occur in XML form
- W3C Recommendation, part of W3C's Semantic Web Activity
4 320302 Databases & WebServices (P. Baumann)
RDF - Examples of Use
- Describing properties for shopping items
- such as price and availability
- Describing time schedules for web events
- Describing information about web pages
- such as content, author, created and modified date
- Describing content and rating for web pictures
- Describing content for search engines
- Describing electronic libraries
5 320302 Databases & WebServices (P. Baumann)
RDF Data Model
- Conceptual model: directed, labeled graphs
- RDF statements consist of
- resources (= nodes)
- which have properties
- which have values (= nodes, strings)
http://www.w3.org/TR/REC-rdf-syntax/ “Ora Lassila”
author
resource value property = subject = predicate = object OO Model in Databases? = object = attribute = value
- Ex: “http://www.w3.org/TR/REC-rdf-syntax/ has the author Ora Lassila”
6 320302 Databases & WebServices (P. Baumann)
RDF Example
- literals are primitive values
- anonymous bnodesare identified by properties
http://www.ideanest.com/ homepage creator "Piotr Kaminski" "piotr@ideanest.com" name email Resources Literals Legend
7 320302 Databases & WebServices (P. Baumann)
Alternative RDF Representations
eecs/320302 eecs/320212 requires prefix: http://www.jacobs-university.de/ Graphs:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.iu-bremen.de/"> <rdf:description rdf:about="http://www.jacobs-university.de/eecs/320302"> <in:requires rdf:resource="http://www.jacobs-university.de/eecs/320212"/> </rdf:description> </rdf:RDF>
XML:
@prefix in:http://www.iu-bremen.de/ . in:eecs/320302 in:requires in:eecs/320212 .
Notation3:
compact & readable alternative to RDF's XML syntax { "http://www. jacobs-university.de/eecs/320302“, requires, “http://www. jacobs-university.de/eecs/320212“}
{ }:
RDF doc root
8 320302 Databases & WebServices (P. Baumann)
Building Complex Networks
- Corresponding triples:
- { “http://www.w3.org/TR/PR-rdf-syntax/”, dc:Creator, x }
- { x, p:Name, “Ora Lassila” }
- { x, p:EMail, “ora.lassila@nokia.com” }
http://www.w3.org/TR/REC-rdf-syntax/ “Ora Lassila” dc:Creator “ora.lassila@nokia.com” p:EMail p:Name anonymous nodes
9 320302 Databases & WebServices (P. Baumann)
SPARQL
- = Simple Protocol and RDF Query Language
- W3C recommendation
- = QL for RDF
- extract information in the form of URIs, blank nodes, plain and typed literals
- extract RDF subgraphs
- construct new RDF graphs based on information in the queried graphs
- Let‘s taste the flavor...
10 320302 Databases & WebServices (P. Baumann)
From SQL To SPARQL
SELECT name, email FROM Person
11 320302 Databases & WebServices (P. Baumann)
From SQL To SPARQL
SELECT ?name ?email WHERE { ?person rdf:type foaf:Person. ?person foaf:name ?name. ?person foaf:mbox ?email. }
12 320302 Databases & WebServices (P. Baumann)
From SQL To SPARQL
PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?email WHERE { ?person rdf:type foaf:Person. ?person foaf:name ?name. ?person foaf:mbox ?email. }
13 320302 Databases & WebServices (P. Baumann)
FOAF
- FOAF (“Friend of a friend”) = a machine-readable ontology
- descriptive vocabulary expressed in RDF and OWL
- Profile = concrete instance of a vocabulary (ie, set of terms)
- unique identifier (e-mail address, URI, …) for defining relationships → decentralised!
- can describe persons, activities, relations to other people & objects
- Ex: FOAF profiles to find all people living in Europe,
list all people both you and a friend of yours know
- FOAF Project defines & extends vocabulary of a FOAF profile
- started in 2000 by Libby Miller and Dan Brickley
- first Social Semantic Web application
14 320302 Databases & WebServices (P. Baumann)
FOAF: Tech
- WebID Protocol = decentralized secure authentication protocol utilizing
FOAF profile information + SSL
- usual SSL utilization: require trusted certificate authority
- Here: does not require dedicated certificate authority to perform user authorization
→ identities can be minted for users easily by authorities → FOAF-based web of trust established gradually, without formal key signing parties
- makes identity more trustworthy + and hard for anyone (even the original issuing
authority) to forge
- Related:
- Description of a Career (DOAC)
- Description of a Project (DOAP)
15 320302 Databases & WebServices (P. Baumann)
SPARQL – Example 1
- Data
(1 triple):
- Query:
<http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial" . SELECT ?title WHERE { <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title . } title "SPARQL Tutorial" .
16 320302 Databases & WebServices (P. Baumann)
@prefixfoaf: <http://xmlns.com/foaf/0.1/> . _:a foaf:name "Johnny Lee Outlaw" . _:a foaf:mbox <mailto:jlow@example.com> . _:b foaf:name "Peter Goodguy" . _:b foaf:mbox <mailto:peter@example.org> . _:c foaf:mbox <mailto:carol@example.org> .
SPARQL – Example 2
name mbox "Johnny Lee Outlaw“ <mailto:jlow@example.com> "Peter Goodguy“ <mailto:peter@example.org> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?mbox WHERE { ?x foaf:name ?name . ?x foaf:mbox?mbox }
17 320302 Databases & WebServices (P. Baumann)
Anatomy of a Query
18 320302 Databases & WebServices (P. Baumann)
RDF Datasets
19 320302 Databases & WebServices (P. Baumann)
Intermediate Summary
- RDF to model ontologies & graphs
- SPARQL to query RDF
- Return data items, graphs, Booleans
- Integrates into SQL
- Implementations:
- OS: Apache Jena (Java), Sesame (Java), RDF-Query (Perl), Dydra (cloud), ...
- Commercial: Oracle Semantic Technologies, OpenLink Virtuoso, ...
- See also:
- Planet RDF, Triplr
20 320302 Databases & WebServices (P. Baumann)
Recap: where do we stand with Semantic Web Services?
21 320302 Databases & WebServices (P. Baumann)
WWW2002 The eleventh international world wide web conference Sheraton waikiki hotel, Honolulu, hawaii, USA 7-11 may 2002, 1 location 5 days learn interact Registered participants coming from australia, canada, chile denmark, france, germany, ghana, hong kong,, norway, singapore, switzerland, the united kingdom, the united states, vietnam, zaire Register now On the 7th May Honolulu will provide the backdrop of the eleventh international world wide web conference. This prestigious event.. Speakers confirmed Tim Berners-Lee Tim is the well known inventor of the Web, … Ian Foster Ian is the pioneer of the Grid, the next generation internet …
Step 1: What We See
22 320302 Databases & WebServices (P. Baumann)
Step 1: What a Machine Sees
23 320302 Databases & WebServices (P. Baumann)
<conferenceName></conferenceName> <venue> </venue> <participantOrigin> <country> </country> <country> </country> <country> </country> <country> </country> <country> </country> <country> </country> <country> </country> <country> </country> </participantOrigin>
Step 1: What a Machine Sees with XML
Now machine can answer questions:
- Name of conference?
- How many countries?
24 320302 Databases & WebServices (P. Baumann)
Step 2: Understand the Unknown
“Find Prof. Cook, a professor at U Washington, earlier a senior lecturer at his alma mater in Australia”
25 320302 Databases & WebServices (P. Baumann)
“Find Prof. Cook, a professor at U Washington, earlier a senior lecturer at his alma mater in Australia”
Step 2: Understand the Unknown
James Cook
Data Instance Semantic Mapping Assoc. Professor Asst. Professor Senior Lecturer
www.cs.washington.edu www.cs.usyd.edu.au
People Staff Faculty
Professor Academic Technical Professor Lecturer Staff
… …
UWash ontology USyd ontology
Now machine can answer questions
- n concept worlds („ontologies“)
James Cook
hasOccupation hasTitle belongsTo isA isA isA belongsTo belongsTo
“88b”
hasOffice
26 320302 Databases & WebServices (P. Baumann)
Resources
- www.w3.org/RDF/Validator
(online RDF validator)
- http://homepages.cwi.nl/~lynda/spool/sw-tue-2003.ppt
- www.ltg.ed.ac.uk/~ht/ora-rdf-dagstuhl.ppt
- www.w3c.org/RDF/Metalog
- Apache Jena™ = Java framework for building Semantic Web applications