320 likes | 417 Views
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. Content. 1. Integration of web analytic tools 2. RDF/S 3. Bicycle Sale Domain in RDF/S 4. Sesame 5. RDF query languages
E N D
Querying the RDF: Small Case Study in theBicycle Sale Domain Ondřej Šváb, Vojtěch Svátek, Martin Kavalec, Martin Labský VŠE, University of Economics, Prague
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 Querying the RDF: Small Case Study in the Bicycle Sale Domain
1. Integration of web analytic tools • Analytic tools from RAINBOW • http://rainbow.vse.cz Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
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) Querying the RDF: Small Case Study in the Bicycle Sale Domain
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> Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
Example of reification Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
4. Sesame • System for manipulating with RDF/S • http://www.openrdf.org • Four functional modules: • Query Module • Admin Module • Extract Module • Explore Module Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
5. RDF query languages • RDQL • Implemented according to HP specification • RQL • Original proposal by ICS-FORTH • SeRQL • Developed as part of system Sesame Querying the RDF: Small Case Study in the Bicycle Sale Domain
Features of RDF query languages Querying the RDF: Small Case Study in the Bicycle Sale Domain
Path expressions: Querying the RDF: Small Case Study in the Bicycle Sale Domain
Namespaces in queries using namespace web = <!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#> Querying the RDF: Small Case Study in the Bicycle Sale Domain
RQL/SeRQL 1 1Q: Find restrictions (domain and range) of property hasWidth. RQL select domain(@predicate), @predicate, range(@predicate) from {} @predicate {} where @predicate = pict:hasWidth SeRQL select domain, range from {<pict:hasWidth>} <rdfs:domain> {domain}, {<pict:hasWidth>} <rdfs:range> {range} Querying the RDF: Small Case Study in the Bicycle Sale Domain
RQL/SeRQL 2 2Q: Find all retail offers with name starting with letter ”l” and having a picture with width lower than 70. RQL select X, name, picture, width from {X : bike:RetailOffer } bike:hasName {name}, {X} bike:hasPicture {picture}. pict:hasWidth {width} where name like "l*" and width < 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> Querying the RDF: Small Case Study in the Bicycle Sale Domain
RQL 3/1 3Q: Find all retail offers of bicycles that have a concrete bike component. Outputthe name of company that offers the bike, the picture of retail offer, the price ofbike (offer). Retrieve the retail offer even if the URL of picture is not known. (select web, company, price, picture, name from {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 … Querying the RDF: Small Case Study in the Bicycle Sale Domain
RQL 3/2 … 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})) Result = S1un. S2 Operator “in” - subquery Querying the RDF: Small Case Study in the Bicycle Sale Domain
SeRQL 3 select prv, web, company, price, picture, name from {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> Querying the RDF: Small Case Study in the Bicycle Sale Domain
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. Querying the RDF: Small Case Study in the Bicycle Sale Domain
SeRQL 4 –query reified statements select obj, certainty from { {reifSubj} reifPred {reifObj} } <meta:hasMeta> {obj} <meta:certainty> {certainty} where certainty > "0.9"^^<xsd:double> Querying the RDF: Small Case Study in the Bicycle Sale Domain
6. Example of HTML interface (usage) • Three parts • First for specifying the query • Second for result • Third for „detailed“ results in certain regard Querying the RDF: Small Case Study in the Bicycle Sale Domain
HTML interface Querying the RDF: Small Case Study in the Bicycle Sale Domain
Initial query Querying the RDF: Small Case Study in the Bicycle Sale Domain
Following query – [About] Querying the RDF: Small Case Study in the Bicycle Sale Domain
Following query – [Picture] Querying the RDF: Small Case Study in the Bicycle Sale Domain
Querying the RDF: Small Case Study in the Bicycle Sale Domain
Future work • Integration, transformation • More active cooperation with Sesame • HTML interface and better querying • Testing with greater amount of real-world data Querying the RDF: Small Case Study in the Bicycle Sale Domain