query-22d5c08633c44a485ec1fa76d9f3aba7

rq turtle/ttl

afficher tous les éléments (ID, Label, Description, référentiels), connus de Wikidata, qui dipose de la propriété "archivé par" (P485) pour une institution donnée.

regouper tous les référentiels dans une même cellule.

classer les éléments trouvés par genre ou sexe puis par ordre alphabéthique de Description et de Label.

SELECT DISTINCT ?item ?itemLabel ?itemDescription ?genreLabel (GROUP_CONCAT(DISTINCT(?referentiel); separator=", ") as ?referentiels) WHERE { ?item wdt:P485 wd:Q2860505. #élément archivé par une institution donnée OPTIONAL {?item wdt:P21 ?genre.} OPTIONAL {?item p:P485 ?statement. ?statement ps:P485 ?archives. #option avoir déposé ses archives dans une institution OPTIONAL {?statement pq:P217 ?referentiel.} #option avoir pour qualificatif un numéro d'inventaire. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,it,de,nl,en". } } GROUP BY ?item ?itemLabel ?itemDescription ?genreLabel ?referentiels ORDER BY ?genreLabel ?itemDescription ?itemLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#afficher tous les éléments (ID, Label, Description, référentiels), connus de Wikidata, qui dipose de la propriété "archivé par" (P485) pour une institution donnée.
#regouper tous les référentiels dans une même cellule.
#classer les éléments trouvés par genre ou sexe puis par ordre alphabéthique de Description et de Label.
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?genreLabel (GROUP_CONCAT(DISTINCT(?referentiel); separator=", ") as ?referentiels)
WHERE {
    ?item wdt:P485 wd:Q2860505. #élément archivé par une institution donnée
  OPTIONAL {?item wdt:P21 ?genre.}
  OPTIONAL {?item p:P485 ?statement. 
            ?statement ps:P485 ?archives. #option avoir déposé ses archives dans une institution
            OPTIONAL {?statement pq:P217 ?referentiel.} #option avoir pour qualificatif un numéro d'inventaire.
           }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,it,de,nl,en". }
}
GROUP BY ?item ?itemLabel ?itemDescription ?genreLabel ?referentiels
ORDER BY ?genreLabel ?itemDescription ?itemLabel

Query found at