PowerPoint 프레젠테이션

Download Report

Transcript PowerPoint 프레젠테이션

Querying the Semantic Web
*
with RQL
G. Karvounarakis, A. Magganaraki S. Alexaki , V. Christophides , D.
Plexousakis, M. Scholl , K. Tolle , The International Journal of Computer and
Telecommunications Networking , Volume 42, 617 - 640 , 2003
DBLab 고명석
Database Laboratory
1
Contents
Introduction
Motivating Example
A Formal Model for RDF
The RDF Query Language : RQL
Conclusion
Database Laboratory
2
Introduction
Next evolution step of the web
Vast amount of information
Various kinds of descriptive information
Better knowledge
The meaning, usage, accessibility or quality of
web resource
RDF enable the creation and exchange of
resource metadata
Database Laboratory
3
Introduction
RDF Provides
Standard Representation Language
For metadata based on directed labeled graph
Schema Definition Language
For creating vocabularies of labels for these graph
node
XML syntax for expressing metadata and
schemas
Humanly readable and machine understandable
Database Laboratory
4
Motivating Example
String
fname
exhibited
creates
String
Museum
Artifact
Artist
String
lname
String
material
sculpts
Sculptor
Sculpture
String
mime-type
title
String
file-size
paints
Painter
“Pablo”
Painting
Ext. Resource
String
exhibited
fname
“Gogh”
“Rodin”
lname
exhibited
fname
creates
&r6
“August”
&r5
lname
Database Laboratory
2000-06-09
subclassOf (isA)
subPropertyof
&r8
title
exhibited
&r7
mime-type
“Reina Sofia
Museum”
typeOf (instance)
“oil on
Canvas”
technique
paints
last_modified
“oil on
Canvas”
&r2
lname
&r4
&r3
paints
technique
“Van”
String
last_modified
title
fname
&r1
“Picaso”
technique
“image/jpeg”
last_modified
“Rodin
Museum”
2000-02-01
5
The RDF Query Language : RQL
RQL Provides
Select-form-where filter
Standard Boolean matching
=, <, >, like
Ex) “Painter” < “Artist”
{ }
To introduce appropriate schema or data variables
“^”
Only the node labeled with the class name
Database Laboratory
6
Example
Q1 : Which classes can appear as domain
and range of the property creates?
$C1
$C2
Artist
Artifact
Artist
Painting
Artist
Sculpture
Painter
Artifact
Painter
Painting
Painter
Sculpture
Sculptor
Artifact
Sculptor
Painting
Sculptor
Sculpture
Database Laboratory
Select $C1, $C2 from {$C1} creates {$C2}
“C1 <= domain(creates) and
C2 <= range(creates)”
Subclassof(domain(creates)) and
Subclassof(range(creates))
• Class variable are prefixed by $
7
Example
Q2 : Find all properties(and their range) that
are applicable on class Painter
@P
Range(@P)
creates
Artifact
paints
Painting
lname
string
fname
string
Select @P, range(@P)
from {$C}@P
Where $C = Painter
domain(P) >= Painter
 @P is property variable
{x;C}
Filters data node x which are labeled with a class name
{;C}
Simply denotes a filtering condition of schema nodes
Database Laboratory
8
Example
Q3: Fine all information related to class
Painter(i.e., its superclasses as well as direct or
inherited properties)
Seq(Painter, superclassof^(Painter),
(select @P, domain(@P), range(@P)
from {;Painter}@P))
Database Laboratory
9
Example
Q4: What properties can be reached(in one
step) from the range classes of creates?
$Y
@P
range(@P)
Artifact
exhibited
Museum
Painting
exhibited
Museum
Sculpture
exhibited
Museum
Painting
technique
string
Sculpture
material
string
Select $Y, @P, range(@P)
from creates{$Y}.@P
$Y <= domain(@P) and
$Y <= range(creates)
“ . ”
Notation implies a join condition between the range
classes of the property creates and the domain of @P
valuations
Database Laboratory
10
Example
Q5: Fine the Museum resources that have
been modified after year 2000
Select X, Y
Form Museum{X}.last_modified{Y}
Where Y >= 2000-01-01
Return to site www.museum.es(&r4)
Return to site www.rodin.fr(&r7)
Database Laboratory
11
Example
Q6:Find the names of Artists whose Artifacts
are exhibited in museums, along with the
related Museum title
Database Laboratory
12
Example
Select V, R, Y, Z
From {X}creates.exhibited{Y}.title{Z},
{X}fname{V}, {X}lname{R}
Database Laboratory
13
Example
Q7: Fine the source and target value of
properties emanating from ExtResources
X
Y
&r6
“image/jpg”
&r7
“Rodin Museum”
&r4
“Reina Sofia Museum”
&r7
2000-06-09
&r4
2000-02-01
Database Laboratory
Select X, Y
from {X; ExtResource}@P{Y}
14
Example
Q8: Find the descriptions of resources whose
URI matches “www.museum.es”
Select X, (select $W, (select @P, Y from {X;$W}@P{Y})
from $W{X})
From Resource{X}
Where X like “www.museum.es”
Database Laboratory
15
Example
Database Laboratory
16
Example
Q9: Find the description, under the form of
triples, of resources excluding properties
related to the class ExtResource
((Select X, @P, Y from {X}@P{Y})
Union
(Select X, type, $W from $W{X}))
minus
((Select X, @P, Y from {X;ExtResource}@P{Y})
union
(Select X, type, ExtResorse from ExtResorse{X}))
Database Laboratory
17
RDF Query Language
Database Laboratory
18
SquishQL
Use SQL-like constructs to reflect RDF‘
graph syntax
Variables are indicated by ‘?’
Most general pattern is (?x, ?y, ?z)
There are two classes of constraints
Patterns
<subject, predicate, object> describing edges of the gr
aph and conjunction operator
Filter expressions
Remove the possibility
Database Laboratory
19
SquishQL
Query typically built on five clauses
SELECT Clause
Identifies the variables to be returned to the
application
FROM Clause
specifies the model by URI
WHERE Clause
Specifies the graph pattern as the conjunction of the
list of triple patterns
Database Laboratory
20
SquishQL
Query typically built on five clauses
AND Clause
Specifies the Boolean expressions over values of
URIs and literals
arithmetic comparisons, and boolean expressions,
including disjunction and negation
USING Clause
A way to shorten the length of URIs
Database Laboratory
21
SquishQL - Example
Query: Finds the titles of documents in
http://example.com/xmleurope/presentations.rdf
SELECT ?title
FROM http://example.com/xmleurope/presentations.rdf
WHERE
(?doc, <dc:title>, ?title),
(?doc, <rdf:type>, <foaf:Document>)
USING
dc FOR <http://purl.org/dc/elements/1.1/>,
rdf FOR <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Database Laboratory
22
RDFPath
Plan to make an XPath*-like query system
for the RDF data model
Database Laboratory
23
RDFPath
Node Queries
/
Returns all nodes.
[ ]
Returns all anonymous nodes
[foaf:mbox "[email protected]"]
Returns all nodes where the value of the property foaf:mbox
equals the literal [email protected]
[foaf:mbox "[email protected]" ; foaf:homepage
<http://www.aaronsw.com>]
Returns nodes where foaf:mbox equals the literal of my email
address and foaf:homepage equals the resource of my homepage
Database Laboratory
24
RDFPath
Node Queries
[a rdf:Bag]
Returns nodes of type rdf:Bag
<http://example.org/#foo>
Returns the resource <http://example.org/#foo>
"Whatever"
Returns the literal "Whatever"
Database Laboratory
25
RDFPath
Sub-queries
/dc:creator
Returns values of the dc:creator property for all
resources
/[a rdfs:ContainerMembershipProperty]
Returns the values of all container membership
properties (_1, _2, etc.) for all resources
"Aaron Swartz"\dc:creator
Returns all resources with a dc:creator property of
"Aaron Swartz"
Database Laboratory
26
RDFPath
Query Refinements
/dc:creator [a w3c:StaffMember]
Returns all of the w3c:StaffMembers who are listed as
the dc:creator of a resource
Database Laboratory
27
TRIPLE
Goal
use various semantics in one inference
 Information integration
Syntactically inspired by F-Logic:
subject[predicateobject]
Example
Sara [livesIn → Linköping; hasAge → 35]
Sara [hasChild → Lotta[hasAge → 5]]
Sara[believes →<Lotta[hasIllness → cold]>]
Database Laboratory
28
TRIPLE
model1
model2
Database Laboratory
Set of Rules
Describing
Semantics of
a Data Model
29
TRIPLE – language description
Namespace and resource abbreviations:
rdf := “http://www.w3.org/1999/02/22-rdf-syntax-ns#”
isa := rdf:subClassOf
Statements, triples, molecules:
subject[predicateobject]
subject[p1o1; p2 o2; ...]
s1[p1  s2[p2o] ]
Models, model expressions, parameterized models:
s[po]@m
“triple <s,p,o> in model m”
s[po]@(m1  m2)
model intersection, union, diff.
s[po]@sf(m1, X, Y) Skolem function
Database Laboratory
30
TRIPLE - Example
namespace abbreviations
dc := “http://purl.org/dc/elements/1.0/”.
dfki := “http://www.dfki.de/”.
block
@dfki:documents {
dfki:d_01_01 [
dc:title  “TRIPLE”;
fact
TRIPLE
dc:title
dc:creator  “Michael Sintek”;
dc:subject  RDF;
dc:subject  triples; ... ].
Michael Sintek
dc:creator
dfki:d_01_01
dc:subject
RDF
dc:subject
...
triples
}
Query: FORALL D <- D[dc:subject  RDF]@dfki:documents
Database Laboratory
31
TRIPLE - Example
Cars Ontology with RDF Schema Semantics
@cars {
xyz:MotorVehicle
xyz:MotorVehicle[rdfs:subClassOf -> rdfs:Resource].
xyz:PassengerVehicle[rdfs:subClassOf -> xyz:MotorVehicle].
xyz:Truck
xyz:Van
xyz:Truck[rdfs:subClassOf -> xyz:MotorVehicle].
xyz:Van[rdfs:subClassOf -> xyz:MotorVehicle].
xyz:PassengerVehicle
xyz:MiniVan[
rdfs:subClassOf -> xyz:Van;
xyz:MiniVan
rdfs:subClassOf -> xyz:PassengerVehicle].
}
X = xyz:Van
FORALL X <X[rdfs:subClassOf -> xyz:MotorVehicle]@cars.
FORALL X <X[rdfs:subClassOf -> xyz:MotorVehicle]@rdfschema(cars).
X = xyz:Truck
X = xyz:PassengerVehicle
X = xyz:Van
X = xyz:Truck
X = xyz:PassengerVehicle
X = xyz:MiniVan
Database Laboratory
32
VERSA
Graphic-based query language for querying
RDF Model
the traversal expression which matches
patterns in the model's graph
all() - dc:date -> *
all() |- rdfs:label -> eq("Web [ 1 ]")
<List>
<String>2001-03-04</String>
<String>2001-04-20</String>
</List>
Database Laboratory
33
RDFQL
RDFQL is the language used by RDF
Gateway applications and agents
RDF Gateway
A platform for Semantic Web applications and agents
A simple SQL-style language
with inference extensions to perform complex
deductive queries
Database Laboratory
34
RDFQL
SELECT ?b
FROM <http://weblog.burningbird.net/resume.rdf>
WHERE (?a, <bbd:title>, ?b)
USING bbd for >http://www.burningbird.net/resume_schema#>
Database Laboratory
35
Comparison of Query language
Database Laboratory
36
Comparison of Query language
Database Laboratory
37
Comparison of Query language
Database Laboratory
38
Comparison of Query language
Database Laboratory
39