-
Notifications
You must be signed in to change notification settings - Fork 0
/
JorgeLizcano-Advanced-SPARQL-queries.txt
53 lines (39 loc) · 2.63 KB
/
JorgeLizcano-Advanced-SPARQL-queries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
1.Get all the properties that can be applied to instances of the Politician class (<http://dbpedia.org/ontology/Politician>)
SELECT ?p WHERE {
?i rdf:type <http://dbpedia.org/ontology/Politician>.
?i ?p ?x.
}
Result:
https://es.dbpedia.org/sparql?default-graph-uri=&query=SELECT+%3Fp+WHERE+%7B%0D%0A%3Fi+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E.%0D%0A%3Fi+%3Fp+%3Fx.%0D%0A%7D&should-sponge=&format=text%2Fhtml&timeout=0&debug=on&run=+Run+Query+
2.Get all the properties, except rdf:type, that can be applied to instances of the Politician class
SELECT ?p WHERE {
?i rdf:type <http://dbpedia.org/ontology/Politician>.
?i ?p ?x.
FILTER(?p!=rdf:type)
}
Result:
https://es.dbpedia.org/sparql?default-graph-uri=&query=SELECT+%3Fp+WHERE+%7B%0D%0A%3Fi+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E.%0D%0A%3Fi+%3Fp+%3Fx.%0D%0AFILTER%28%3Fp%21%3Drdf%3Atype%29%0D%0A%7D&should-sponge=&format=text%2Fhtml&timeout=0&debug=on&run=+Run+Query+
3.Which different values exist for the properties, except for rdf:type, applicable to the instances of Politician?
SELECT DISTINCT ?x WHERE {
?i rdf:type <http://dbpedia.org/ontology/Politician>.
?i ?p ?x.
FILTER(?p!=rdf:type)
}
Result:
https://es.dbpedia.org/sparql?default-graph-uri=&query=SELECT+DISTINCT+%3Fx+WHERE+%7B%0D%0A%3Fi+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E.%0D%0A%3Fi+%3Fp+%3Fx.%0D%0AFILTER%28%3Fp%21%3Drdf%3Atype%29%0D%0A%7D&should-sponge=&format=text%2Fhtml&timeout=0&debug=on&run=+Run+Query+
4.For each of these applicable properties, except for rdf:type, which different values do they take globally for all those instances?
SELECT DISTINCT ?p ?x WHERE {
?i rdf:type <http://dbpedia.org/ontology/Politician>.
?i ?p ?x.
FILTER(?p!=rdf:type)
}
Result:
https://es.dbpedia.org/sparql?default-graph-uri=&query=SELECT+DISTINCT+%3Fp+%3Fx+WHERE+%7B%0D%0A%3Fi+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E.%0D%0A%3Fi+%3Fp+%3Fx.%0D%0AFILTER%28%3Fp%21%3Drdf%3Atype%29%0D%0A%7D&should-sponge=&format=text%2Fhtml&timeout=0&debug=on&run=+Run+Query+
5.For each of these applicable properties, except for rdf:type, how many distinct values do they take globally for all those instances?
SELECT DISTINCT ?p COUNT(DISTINCT ?x) WHERE {
?i rdf:type <http://dbpedia.org/ontology/Politician>.
?i ?p ?x.
FILTER(?p!=rdf:type)
}
Result:
https://es.dbpedia.org/sparql?default-graph-uri=&query=SELECT+DISTINCT+%3Fp+COUNT%28DISTINCT+%3Fx%29+WHERE+%7B%0D%0A%3Fi+rdf%3Atype+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E.%0D%0A%3Fi+%3Fp+%3Fx.%0D%0AFILTER%28%3Fp%21%3Drdf%3Atype%29%0D%0A%7D&should-sponge=&format=text%2Fhtml&timeout=0&debug=on&run=+Run+Query+