Skip to content

Latest commit

 

History

History
102 lines (78 loc) · 3.74 KB

eduayme.md

File metadata and controls

102 lines (78 loc) · 3.74 KB

Assignment 3

  • Author: Eduard Aymerich

###################################################################

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

SELECT DISTINCT ?p
WHERE
{
  ?x a/rdfs:subClassOf* ex:Politician.
  ?x ?p ?y
}
LIMIT 100

Result

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

PREFIX ex: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?p
WHERE
{
  ?x a/rdfs:subClassOf* ex:Politician.
  ?x ?p ?y
  FILTER(?p != rdf:type)
}
LIMIT 100

Result

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

PREFIX ex: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?v
WHERE
{
  ?x a/rdfs:subClassOf* ex:Politician.
  ?x ?p ?v
  FILTER(?p != rdf:type)
}
LIMIT 100

Result

################################################################### 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?

PREFIX ex: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?p ?v
WHERE
{
  ?x a/rdfs:subClassOf* ex:Politician.
  ?x ?p ?v
  FILTER(?p != rdf:type)
}
LIMIT 100

Result

################################################################### 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?

PREFIX ex: <http://dbpedia.org/ontology/>

SELECT DISTINCT ?p COUNT(?v)
WHERE
{
  ?x a/rdfs:subClassOf* ex:Politician.
  ?x ?p ?v
  FILTER(?p != rdf:type)
}
LIMIT 100

Result