-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJeanBanzekulivakha_Assesment3_Advanced
53 lines (39 loc) · 1.41 KB
/
JeanBanzekulivakha_Assesment3_Advanced
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>)
PREFIX ex2: <http://dbpedia.org/ontology/>
SELECT ?prop
WHERE {
?instance a ex2:Politician .
?instance ?prop ?value .
}
## 2. Get all the properties, except rdf:type, that can be applied to instances of the Politician class
PREFIX ex2: <http://dbpedia.org/ontology/>
SELECT ?prop
WHERE {
?instance a ex2:Politician .
?instance ?prop ?value .
FILTER(?prop != rdf:type)
}
# 3. Which different values exist for the properties, except for rdf:type, applicable to the instances of Politician?
PREFIX ex2: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?value
WHERE {
?instance a ex2:Politician .
?instance ?prop ?value .
FILTER(?prop != rdf:type)
}
## 4. For each of these applicable properties, except for rdf:type, which different values do they take globally for all those instances?
PREFIX ex2: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?instance ?value
WHERE {
?instance a ex2:Politician .
?instance ?prop ?value .
FILTER(?prop != rdf:type)
}
## 5. For each of these applicable properties, except for rdf:type, how many distinct values do they take globally for all those instances?
PREFIX ex2: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?instance COUNT(DISTINCT ?value)
WHERE {
?instance a ex2:Politician .
?instance ?prop ?value .
FILTER(?prop != rdf:type)
}