SPARQL queries
.
Check out the queries on WikiData Query Endpoint:
-
parentela
folder:explicit_dynasty.txt
This SPARQL query retrieves information about musicians from Italy who have musician parents. It calculates the number of generations of musicians within their family,explicit_relatives.txt
: This query retrieves information about a person's familial relationships. It includes the person's label, their fathers, mothers, brothers, sisters, spouses, uncles, children, stepfathers, stepmothers, grandparents, and aunts,implicit_father.txt
Try!: This query retrieves pairs of politicians from Italy who have the same father,siblings_bach.txt
: This SPARQL query retrieves the siblings of Johann Sebastian Bach, who are the father's siblings,spanish_poet_with_max_number_of_children.txt
: This query retrieves a list of Spanish poets with the maximum number of children among all Spanish poets,spanish_poet_with_max_number_of_children2.txt
: same topic, another syntax;
-
politics
folder:politicians.txt
: This query retrieves information about Italian politicians and their children who are also involved in politics. It includes the politician's name, the parties they belong to, the number of children in politics, the names of their children, and the parties their children belong to, sorted by the descending order of the number of children involved in politics,politicians_implicit_siblings.txt
: This query retrieves information about Italian politicians' explicit siblings,politicians_subclasses.txt
: The SPARQL queries for items that have a "subclass of" relationship (direct or indirect) with the occupation or profession represented by wd:Q82955 (politician). In other words, it retrieves all the items that are either instances of Q82955 or instances of its subclasses based on the "subclass of" relationships defined in Wikidata;
-
universities
:italian_universities.txt
: This SPARQL query retrieves universities in Italy along with their respective websites and classifications.
-
sandbox
folder contains various SPARQL query examples.
Jupyter notebooks
:
-
biggest_cities_population.ipynb
following the tutorial, Usingmkwikidata
and pandas, we extract and plot the most significant cities by population, -
politicians.ipynb
: the same code as above, usingpoliticians.txt
query.