SPARQL semestre 2 - AliaBrah/militants_droit_femmes GitHub Wiki

Note : je n'arrive toujours pas à avoir plus de trois colonnes

Requête pour trouver le nombre de personnes qui compose la population

PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT (COUNT(*) as ?effectif)
WHERE {
SELECT DISTINCT ?o1 ?birthDate ?birthYear
WHERE { 
 {
 {<http://dbpedia.org/resource/List_of_women's_rights_activists> ?p ?o1.}
 UNION
 {dbr:List_of_feminists ?p ?o1.}
 UNION
 {?o1 ?p dbr:feminist.}
 UNION 
 {?o1 ?p dbr:Feminism.}
 }
?o1 a dbo:Person;
dbp:birthDate | dbo:birthDate ?birthDate.
BIND(xsd:integer(SUBSTR(STR(?birthDate), 1, 4)) AS ?birthYear)
FILTER( ?birthYear > 1815)
 }
}

L'effectif est de 1898 individus

Requête pour définir la date de naissance et le lieu de naissance

PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?o1  (str(?label) as ?birthPlace) ?birthYear
WHERE {
SELECT DISTINCT ?o1 ?birthDate ?birthYear ?label
WHERE { 
 {
 {<http://dbpedia.org/resource/List_of_women's_rights_activists> ?p ?o1.}
 UNION
 {dbr:List_of_feminists ?p ?o1.}
 UNION
 {?o1 ?p dbr:feminist.}
 UNION
 {?o1 ?p dbr:Feminism.}
}
?o1 a dbo:Person;
dbp:birthDate | dbo:birthDate ?birthDate;
dbp:birthPlace | dbo:birthPlace ?target.
?target rdfs:label ?label.
BIND(xsd:integer(SUBSTR(STR(?birthDate), 1, 4)) AS ?birthYear)
FILTER(( ?birthYear > 1815) && LANG(?label) = 'en')
}
ORDER BY ?birthYear
}

Requête pour définir la date de naissance et la formation universitaire

PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?o1  (str(?label) as ?University) ?birthYear
WHERE {
SELECT DISTINCT ?o1 ?birthDate ?birthYear ?label
WHERE { 
 {
 {<http://dbpedia.org/resource/List_of_women's_rights_activists> ?p ?o1.}
 UNION
 {dbr:List_of_feminists ?p ?o1.}
 UNION
 {?o1 ?p dbr:feminist.}
 UNION
 {?o1 ?p dbr:Feminism.}
}
 ?o1 a dbo:Person;
 dbp:birthDate | dbo:birthDate ?birthDate;
 dbp:almaMater | dbo:almaMater ?target.
 ?target rdfs:label ?label.
 BIND(xsd:integer(SUBSTR(STR(?birthDate), 1, 4)) AS ?birthYear)
 FILTER ( (?birthYear > 1815 )
    && LANG(?label) = 'en') 
 }
ORDER BY ?birthYear
}

Requête pour définir la date de naissance et l'occupation

PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX dbp: <http://dbpedia.org/property/>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT DISTINCT ?o1  (str(?label) as ?occupation) ?birthYear
WHERE {
SELECT DISTINCT ?o1 ?birthDate ?birthYear ?label
WHERE { 
 {
 {<http://dbpedia.org/resource/List_of_women's_rights_activists> ?p ?o1.}
 UNION
 {dbr:List_of_feminists ?p ?o1.}
 UNION
 {?o1 ?p dbr:feminist.}
 UNION
 {?o1 ?p dbr:Feminism.}
}
?o1 a dbo:Person;
dbp:birthDate | dbo:birthDate ?birthDate;
dbp:occupation | dbo:occupation ?target.
?target rdfs:label ?label.
BIND(xsd:integer(SUBSTR(STR(?birthDate), 1, 4)) AS ?birthYear)
FILTER(( ?birthYear > 1815) && LANG(?label) = 'en')
}
ORDER BY ?birthYear
}