Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment3 #266

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
60 changes: 60 additions & 0 deletions Assignment3/Shelvi96-XXXXXX/queries.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
To run all the queries, dbpedia sparql tool was used (https://dbpedia.org/snorql).

1. Get all the properties that can be applied to instances of the Politician class (<http://dbpedia.org/ontology/Politician>)

SELECT DISTINCT ?property
WHERE
{
?object rdf:type <http://dbpedia.org/ontology/Politician>.
?object ?property ?value
}


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

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


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

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


4. For each of these applicable properties, except for rdf:type, which different values do they take globally for all those instances?

SELECT
?property
GROUP_CONCAT(
DISTINCT ?value; separator=", "
) as ?distinctValues
WHERE {
?object rdf:type <http://dbpedia.org/ontology/Politician>.
?object ?property ?value
FILTER (?property != rdf:type)
}
GROUP BY ?property


5. For each of these applicable properties, except for rdf:type, how many distinct values do they take globally for all those instances?

SELECT
?property
COUNT(DISTINCT ?value) as ?distinctValuesSum
WHERE {
?object rdf:type <http://dbpedia.org/ontology/Politician>.
?object ?property ?value
FILTER (?property != rdf:type)
}
GROUP BY ?property
Loading