Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Assignment3/RomanNicoleta-24A255/Assignment3.pdf
Binary file not shown.
62 changes: 62 additions & 0 deletions Assignment3/RomanNicoleta-24A255/Assignment3_txt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Advanced set of SPARQL queries

1. Get all the properties that can be applied to instances of the Politician class ()

SELECT DISTINCT ?property WHERE {
?instance a <http://dbpedia.org/ontology/Politician> .
?instance ?property ?value .
}

Link to result:
https://dbpedia.org/snorql/?query=SELECT+DISTINCT+%3Fproperty+WHERE+%7B%0D%0A++%3Finstance+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E+.%0D%0A++%3Finstance+%3Fproperty+%3Fvalue+.%0D%0A%7D%0D%0A


2. Get all the properties, except rdf:type, that can be applied to instances of the Politician class

SELECT DISTINCT ?property WHERE {
?instance a <http://dbpedia.org/ontology/Politician> .
?instance ?property ?value .
FILTER(?property != rdf:type)
}

Link to result:
https://dbpedia.org/snorql/?query=SELECT+DISTINCT+%3Fproperty+WHERE+%7B%0D%0A++%3Finstance+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E+.%0D%0A++%3Finstance+%3Fproperty+%3Fvalue+.%0D%0A++FILTER%28%3Fproperty+%21%3D+rdf%3Atype%29%0D%0A%7D%0D%0A


3. Which different values exist for the properties, except rdf:type, of the instances of the Politician class?

SELECT DISTINCT ?property ?value WHERE {
?instance a <http://dbpedia.org/ontology/Politician> .
?instance ?property ?value .
FILTER(?property != rdf:type)
}

Link to result:
https://dbpedia.org/snorql/?query=SELECT+DISTINCT+%3Fproperty+%3Fvalue+WHERE+%7B%0D%0A++%3Finstance+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E+.%0D%0A++%3Finstance+%3Fproperty+%3Fvalue+.%0D%0A++FILTER%28%3Fproperty+%21%3D+rdf%3Atype%29%0D%0A%7D%0D%0A%0D%0A


4. For each of the properties, except rdf:type, that can be applied to instances of the Politician class, which different values do they take in those instances?

SELECT DISTINCT ?value
WHERE {
?instance a <http://dbpedia.org/ontology/Politician> .
?instance ?property ?value .
FILTER(?property != rdf:type)
}
LIMIT 100

Link to result:
https://dbpedia.org/snorql/?query=SELECT+DISTINCT+%3Fvalue+%0D%0AWHERE+%7B%0D%0A++%3Finstance+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E+.%0D%0A++%3Finstance+%3Fproperty+%3Fvalue+.%0D%0A++FILTER%28%3Fproperty+%21%3D+rdf%3Atype%29%0D%0A%7D%0D%0ALIMIT+100%0D%0A%0D%0A%0D%0A


5. For each of the properties, except rdf:type, that can be applied to instances of the Politician class, how many distinct values do they take in those instances?

SELECT ?property (COUNT(DISTINCT ?value) AS ?count) WHERE {
?instance a <http://dbpedia.org/ontology/Politician> .
?instance ?property ?value .
FILTER(?property != rdf:type)
}
GROUP BY ?property

Link to result:
https://dbpedia.org/snorql/?query=SELECT+%3Fproperty+%28COUNT%28DISTINCT+%3Fvalue%29+AS+%3Fcount%29+WHERE+%7B%0D%0A++%3Finstance+a+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2FPolitician%3E+.%0D%0A++%3Finstance+%3Fproperty+%3Fvalue+.%0D%0A++FILTER%28%3Fproperty+%21%3D+rdf%3Atype%29%0D%0A%7D%0D%0AGROUP+BY+%3Fproperty%0D%0A%0D%0A%0D%0A