Querying the RDF: Small Case Study in the Bicycle Sale Domain
-
Upload
maxine-oneill -
Category
Documents
-
view
23 -
download
1
description
Transcript of Querying the RDF: Small Case Study in the Bicycle Sale Domain
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, Prague
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
2
Content
• 1. Integration of web analytic tools
• 2. RDF/S
• 3. Bicycle Sale Domain in RDF/S
• 4. Sesame
• 5. RDF query languages
• 6. Example of HTML interface usage
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
3
1. Integration of web analytic tools
• Analytic tools from RAINBOW
• http://rainbow.vse.cz
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
4
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
5
2. RDF/S
• RDF – Resource description framework– Assertional language for information representation– Reification– RDF graph– Several types of serialization: RDF/XML, N-Triples,
N3
• RDFS – Resource description framework schema– Semantic language for RDF– „core vocabulary“, enables to define properties, classes
and their taxonomy (hierarchy)
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
6
3. Bicycle Sale Domain in RDF/S
• Typical extracted attributes:– Name of bike, price, picture, components
<rdf:Description rdf:about="http://www.bikepedlar.co.uk/Giant_terrago.htm"><bike:hasCompany rdf:resource="http://www.bikepedlar.co.uk"/><bike:hasName>Giant Terrago F/S 3</hasName><bike:hasPrice>350.00</hasPrice><bike:hasBikePart rdf:resource="http://rainbow.vse.cz/bikes/bikes.rdf#alivio"/>
</rdf:Description>
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
7
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
8
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
9
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
10
Example of reification
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
11
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
12
4. Sesame
• System for manipulating with RDF/S– http://www.openrdf.org
• Four functional modules:– Query Module– Admin Module– Extract Module– Explore Module
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
13
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
14
5. RDF query languages
• RDQL– Implemented according to HP specification
• RQL– Original proposal by ICS-FORTH
• SeRQL– Developed as part of system Sesame
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
15
Pros/Cons RDQL RQL SeRQL
Path expr. + + +
RDFS support
- ++ +
Optional path exp.
- + ++
Reified statements
+ + ++
Strings comp.
- + +
Features of RDF query languages
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
16
Path expressions:
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
17
Namespaces in queries
using namespaceweb = <!http://rainbow.vse.cz/schema/webpage.rdfs#>,xsd = <!http://www.w3.org/2001/XMLSchema#>,bike = <!http://rainbow.vse.cz/schema/bikes.rdfs#>,comp = <!http://rainbow.vse.cz/schema/company.rdfs#>,meta = <!http://rainbow.vse.cz/schema/meta.rdfs#>,pict = <!http://rainbow.vse.cz/schema/picture.rdfs#>,rdfs = <!http://www.w3.org/2000/01/rdf-schema#>,rdf = <!http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
18
RQL/SeRQL 1
RQL
select domain(@predicate), @predicate, range(@predicate)
from {} @predicate {}where @predicate =
pict:hasWidth
SeRQL
select domain, rangefrom {<pict:hasWidth>} <rdfs:domain> {domain},{<pict:hasWidth>} <rdfs:range> {range}
1Q: Find restrictions (domain and range) of property hasWidth.
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
19
RQL/SeRQL 2
RQL
select X, name, picture, widthfrom {X : bike:RetailOffer }
bike:hasName {name},{X} bike:hasPicture {picture}.
pict:hasWidth {width}
where name like "l*" and width < 70
2Q: Find all retail offers with name starting with letter ”l” and having a picture with width lower than 70.
SeRQL
select X, name, picture, width from {X} <serql:directType> {<bike:RetailOffer>}, {X} <bike:hasName> {name}, {X} <bike:hasPicture> {Y} <pict:hasWidth> {width}
where name like "l*" and width < "70"^^<xsd:integer>
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
20
RQL 3/13Q: Find all retail offers of bicycles that have a concrete bike component. Output
the name of company that offers the bike, the picture of retail offer, the price of bike (offer). Retrieve the retail offer even if the URL of picture is not known.
(select web, company, price, picture, namefrom {X : bike:RetailOffer } bike:hasCompany {web : comp:Company }. comp:companyName {company}, {X} bike:hasPrice {price}, {X} bike:hasPicture {picture}, {X} bike:hasBikeProduct {idtyp}. bike:name {name}where idtyp=data:part1)Union …
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
21
…
Union
(select web, company, price, null, name
from {X : bike:RetailOffer } bike:hasCompany
{web : comp:Company }. comp:companyName {company},
{X} bike:hasPrice {price},
{X} bike:hasBikeProduct {idtyp}. bike:name {name}
where idtyp=data:part1 and not
(X in select X
from {X} bike:hasPicture {picture}))
RQL 3/2
Operator “in” - subquery
Result = S1un. S2
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
22
SeRQL 3
select prv, web, company, price, picture, namefrom {prv} <serql:directType> {<bike:RetailOffer>}; <bike:hasPrice> {price}; [<bike:hasPicture> {picture}]; <bike:hasBikeProduct> {idtyp}, {idtyp} <bike:name> {name}, {prv} <bike:hasCompany> {web} <rdf:type> {<comp:Company>}; <comp:companyName>
{company}where idtyp = <data:part1>
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
23
RQL 4 – query over reified statements
select X, obj, certainty
from {X : rdf:Statement } rdf:subject {reifSubj},
{X} rdf:predicate {reifPred},
{X} rdf:object {reifObj},
{X} meta:hasMeta {obj}. meta:certainty {certainty}
where certainty > "0.9"
4Q: Find all statements that have certainty higher than 0.9.
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
24
SeRQL 4 –query reified statements
select obj, certainty
from { {reifSubj} reifPred {reifObj} }
<meta:hasMeta> {obj} <meta:certainty> {certainty}
where certainty > "0.9"^^<xsd:double>
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
25
6. Example of HTML interface (usage)
- Three parts
- First for specifying the query
- Second for result
- Third for „detailed“ results in certain regard
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
26
HTML interface
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
27
Initial query
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
28
Following query – [About]
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
29
Following query – [Picture]
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
30
Dateso 04
Querying the RDF: Small Case Study in the Bicycle Sale Domain
31
Future work
– Integration, transformation– More active cooperation with Sesame– HTML interface and better querying – Testing with greater amount of real-world data
Thank you for your attention