With these slides I presented my paper on "Querying Trust in RDF Data with tSPARQL" at the European Semantic Web Conference 2009 (ESWC) in Heraklion, Crete. Actually, this slideset is an extended version of the slides I used for the talk (more examples and evaluation).
1. Querying Trust
in RDF Data with
tSPARQL
Olaf Hartig
http://olafhartig.de/foaf.rdf#olaf
2. ● The Semantic Web is a reality
● Large amount of semantically interlinked data
● Applications emerge
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 2
3. Is the data
trustworthy?
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 3
4. SELECT ?hotel ?hotelName
WHERE {
?hotel rdf:type umbel:HotelBuilding ;
p:location dbpedia:Heraklion ;
rdfs:label ?hotelName .
TRUST AS ?t
}
ORDER BY ?t
Returns a list of hotels
in Heraklion ordered by the
trustworthiness of the data.
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 4
5. SELECT ?hotelName ?reviewText
WHERE {
?hotel rdf:type umbel:HotelBuilding ;
p:location dbpedia:Heraklion ;
rdfs:label ?hotelName .
{
?hotel rev:hasReview ?review .
?review rev:text ?reviewText .
SELECT ?hENSURE TRUST ( 0.7 , 1.0 )
?name WHERE {
?h rdf:type umbel:HotelBuilding ;
}
p:location dbpedia:Heraklion ;
} rdfs:label ?name .
TRUST AS ?t
}
ORDER BY ?t
Returns trustworthy reviews
of hotels in Heraklion.
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 5
6. Outline
Trust model
for RDF data
Trust-aware
tSPARQL query processing
Evaluating trust
requirements
Query optimization
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 6
7. Trustworthiness of RDF Data
● The trustworthiness of RDF statements is the subjective
belief or disbelief in the truth of the statements.
● Represented by trust values in the interval [-1,1]
rdfs:label
<http://.../data/KnossosRoyal> Aldemar Knossos Royal Village
ex:
loc
rd
ate
f:t
d At t 5.5378
geo:la
yp
e
geo:l
umbel:HotelBuilding ong
−0.2274
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 7
8. Atomic Trust
● A trust function associates single RDF statements with a
subjective trust value.
<http://.../data/KnossosRoyal>
TrustFct ( , ) = 0.8
rd
f:t
yp
e
umbel:HotelBuilding
Trust weighted statement • Trust weighted RDF graph
rdfs:label
<http://.../data/KnossosRoyal> Aldemar Knossos Royal Village
[0.9]
ex: [0.1]
loc
rd
ate [0.75]
f:t
[0.8] dA t 5.5378
t geo:la
yp
e
geo:l
umbel:HotelBuilding ong
−0.2274
[0.75]
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 8
9. Aggregated Trust
● A trust aggregation function calculates an aggregated
trust value for a trust weighted RDF graph.
● Minimum (cautious): tamin = 0.1
● Median (more optimistic):
tamedian = 0.75
rdfs:label
<http://.../data/KnossosRoyal> Aldemar Knossos Royal Village
[0.9]
ex: [0.1]
loc
rd
ate [0.75]
f:t
[0.8] dA t 5.5378
t geo:la
yp
e
geo:l
umbel:HotelBuilding ong
−0.2274
[0.75]
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 9
10. Outline
Trust model
for RDF data
Trust-aware
tSPARQL query processing
Evaluating trust
requirements
Query optimization
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 10
11. Trust-aware query processing
● SPARQL does not consider trust values
● Basic idea:
● Extend the notion of solutions
● Redefine the algebra operators
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 11
12. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
re v
rd
:ha rev
sR :tex
f:t
e vie t
yp
w
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337>
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
µ
Solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot;
http://revyu.../R337 quot;A surprisingly ...quot;
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 12
13. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
re v
rd
:ha rev
sR :tex
f:t
e vie t
yp
w
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337>
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
µ
Solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot;
http://revyu.../R337 quot;A surprisingly ...quot;
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 13
14. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
re v [0.86]
rd
:ha rev
sR [0.86] :tex [0.7]
f:t
[0.8] evi t
yp
ew
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337> [0.2]
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
Trust weighted µ t
solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot;
http://revyu.../R337 quot;A surprisingly ...quot;
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 14
15. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
re v [0.86]
rd
:ha rev
sR [0.86] :tex [0.7]
f:t
[0.8] evi t
yp
ew
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337> [0.2]
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
Trust weighted µ t
solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot;
http://revyu.../R337 quot;A surprisingly ...quot;
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 15
16. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
rev [0.86]
rd
:ha re v
s Re[0.86] :tex [0.7]
f:t
[0.8] v t
yp
iew
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337> [0.2]
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
Trust weighted µ t
solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot; 0.7
http://revyu.../R337 quot;A surprisingly ...quot;
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 16
17. Basic graph pattern matching
<http://.../data/KnossosRoyal> rev:hasReview
<http://revyu.../R457>
re v [0.86]
rd
:ha rev
sR [0.86] :tex [0.7]
f:t
[0.8] evi t
yp
ew
e
What a lovely ...
umbel:HotelBuilding <http://revyu.../R337> [0.2]
rev:te
xt A surprisingly ...
BGP
<http://.../data/KnossosRoyal> rev:hasReview
?r
rev:text ?t
Trust weighted µ t
solution mappings ?r ?t
that are solutions: http://revyu.../R457 quot;What a lovely ...quot; 0.7
http://revyu.../R337 quot;A surprisingly ...quot; 0.2
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 17
18. Trust-aware query processing
● SPARQL does not consider trust values
Basic idea:
√
●
● Extend the notion of solutions
● Redefine the algebra operators
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 18
20. Redefining the SPARQL algebra
µ
?h ?r
ex:KnossosRoyal quot;What a lovely …quot;
ex:KnossosRoyal quot;A surprisingly …quot;
ex:SheratonTenerife quot;Located direct...quot;
Join
µ
µ
?h ?r
?h
ex:KnossosRoyal quot;What a lovely …quot;
ex:KnossosRoyal ex:KnossosRoyal quot;A surprisingly …quot;
ex:SheratonTenerife ex:SheratonTenerife quot;Located direct...quot;
BGP BGP
?h rdf:type umbel:HotelBuilding . ?h rev:hasReview [ rev:text ?r ]
?h p:location dbpedia:Heraklion .
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 20
21. Redefining the SPARQL algebra
µ t
?h ?r
ex:KnossosRoyal quot;What a lovely …quot;
ex:KnossosRoyal quot;A surprisingly …quot;
ex:SheratonTenerife quot;Located direct...quot;
Join
µ t
µ t
?h ?r
?h
ex:KnossosRoyal quot;What a lovely …quot; 0.9
ex:KnossosRoyal 0.7 ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife 0.1 ex:SheratonTenerife quot;Located direct...quot; 0.8
BGP BGP
?h rdf:type umbel:HotelBuilding . ?h rev:hasReview [ rev:text ?r ]
?h p:location dbpedia:Heraklion .
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 21
22. Redefining the SPARQL algebra
● A trust merge function calculates a merged trust value for
two trust weighted solution mappings.
µ t
● Minimum: tmmin
?h ?r
ex:KnossosRoyal quot;What a lovely …quot; 0.7
ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife quot;Located direct...quot; 0.1
Join
µ t
µ t
?h ?r
?h
ex:KnossosRoyal quot;What a lovely …quot; 0.9
ex:KnossosRoyal 0.7 ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife 0.1 ex:SheratonTenerife quot;Located direct...quot; 0.8
BGP BGP
?h rdf:type umbel:HotelBuilding . ?h rev:hasReview [ rev:text ?r ]
?h p:location dbpedia:Heraklion .
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 22
23. Basic idea
● SPARQL does not consider trust values
Basic idea:
√
●
● Extend the notion of solutions
● Redefine the algebra operators √
What is the impact of
processing trust values
on query execution times
?
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 23
24. Evaluation
● tSPARQL query engine (extension of SPARQL engine ARQ)
● Berlin SPARQL Benchmark (BSBM)
● Simulates e-commerce scenario
● Mix of 12 SPARQL queries
● Generates datasets of different sizes (scaling factor)
3
avg. execution time
(in sec.) per query mix
ARQ SPARQL tSPARQL engine
2,5 engine with
2 precomputed
trust values
1,5
1
0,5
0
0 100 (31800) 200 (60424) 300 (92337) 400 (124305) 500
BSBM Scaling Factor (# of triples)
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 24
25. Evaluation
● Simple provenance-based trust function
● Assumes existence of trust assessments for RDF graphs
● Adopts these trust values for all triples in the graph
ARQ SPARQL tSPARQL engine tSPARQL engine
avg. execution time (in sec.)
per query mix
engine with + determining
precomputed trust values
trust values
10
8
6
4
2
0
0 100 (31800) 200 (60424) 300 (92337) 400 (124305) 500
BSBM Scaling Factor (# of triples)
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 25
26. Outline
Trust model
for RDF data
Trust-aware
tSPARQL query processing
Evaluating trust
requirements
Query optimization
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 26
27. Evaluating trust requirements
● Goal: ensuring a certain trustworthiness for the solutions
of a specific graph pattern
SELECT ?hotelName ?reviewText
WHERE {
?hotel rdf:type umbel:HotelBuilding ;
p:location dbpedia:Heraklion ;
rdfs:label ?hotelName .
{
?hotel rev:hasReview ?review .
?review rev:text ?reviewText .
ENSURE TRUST ( 0.7 , 1.0 )
}
}
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 27
28. Evaluating trust requirements
● Goal: ensuring a certain trustworthiness for the solutions
of a specific graph pattern
µ t
?h ?r
ex:KnossosRoyal quot;What a lovely …quot; 0.9
ex:SheratonTenerife quot;Located direct...quot; 0.8
EnTrust
0.5 , 1.0
µ t
?h ?r
ex:KnossosRoyal quot;What a lovely …quot; 0.9
ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife quot;Located direct...quot; 0.8
EnTrust l , u , = { , t ∣ , t ∈ ∧ lt u }
* *
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 28
35. Evaluating trust requirementsµ
µ t t
?h ?r ?h ?r
ex:KnossosRoyal quot;What a lovely …quot; 0.7 ex:KnossosRoyal quot;What a lovely …quot; 0.7
ex:SheratonTenerife quot;Located direct...quot; 0.8
EnTrust
0.5 , 1.0
● Position of the µ t
ENSURE TRUST ?h ?r
clause matters! ex:KnossosRoyal quot;What a lovely …quot; 0.7
ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife quot;Located direct...quot; 0.1
Join
µ t
µ t
?h ?r
?h
ex:KnossosRoyal quot;What a lovely …quot; 0.7
ex:KnossosRoyal 0.9 ex:KnossosRoyal quot;A surprisingly …quot; 0.2
ex:SheratonTenerife 0.1 ex:SheratonTenerife quot;Located direct...quot; 0.8
BGP BGP
?h rdf:type umbel:HotelBuilding . ?h rev:hasReview [ rev:text ?r ]
?h p:location dbpedia:Heraklion .
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 35
36. Accessing trust values
● Goal: accessing the trust value for the solution of a
specific graph pattern
SELECT ?hotel ?hotelName
WHERE {
?hotel rdf:type umbel:HotelBuilding ;
p:location dbpedia:Heraklion ;
rdfs:label ?hotelName .
TRUST AS ?t
}
ORDER BY ?t
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 36
37. Accessing trust values
● Goal: accessing the trust value for the solution of a
specific graph pattern
● Again: position of the
µ t
TRUST AS clause
?h ?r ?t
matters! ex:KnossosRoyal quot;What a lovely …quot; 0.9 0.9
ex:SheratonTenerife quot;Located direct...quot; 0.8 0.8
PrTrust
?t
µ t
?h ?r
ex:KnossosRoyal quot;What a lovely …quot; 0.9
ex:SheratonTenerife quot;Located direct...quot; 0.8
PrTrust v , * = { ' , t ∣ , t ∈* ∧ '=∪{ v , lt } }
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 37
38. Outline
Trust model
for RDF data
Trust-aware
tSPARQL query processing
Evaluating trust
requirements
Query optimization
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 38
39. Rewrite Rules
● Rewriting algebra expressions to improve query execution
● E.g., for join operators that employ
the trust merge function tmmin holds:
EnTrust EnTrust
l,u l,u
Join Equivalence Join
EnTrust EnTrust
l , 1.0 l , 1.0
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 39
40. Evaluation
● Equivalent BSBM-based setup with 6 tSPARQL queries
100
avg. exec.time (in sec.) per query mix
tSPARQL engine tSPARQL engine
90 without rewriting with rewriting
80
70
60
50
40
30
20
10
0
0 100 (31800) 200 (60424) 300 (92337) 400 (124305) 500
BSBM Scaling Factor (# of triples)
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 40
41. Take-away summary
Trust model
for RDF data
● Trust model
● Trust function tSPARQL
Trust-aware
query processing
● Trust aggregation function Evaluating trust
requirements
● Trust in SPARQL query processing Query optimization
● Trust weighted solutions
● Trust-aware algebra
● SPARQL extension for trust requirements
● ENSURE TRUST
● TRUST AS
● tSPARQL query engine available: http://trdf.sourceforge.net
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 41
42. These slides have been created by
Olaf Hartig
http://olafhartig.de
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License
(http://creativecommons.org/licenses/by-sa/3.0/)
Olaf Hartig - Querying Trust in RDF Data with tSPARQL 42