query-5b8cea750c72ba77b55117cc1aff6a81

rq turtle/ttl

SPARQL03759677

A lancer depuis data.idref.fr

Début d'une requête visant à comparer les PPN des personnes de PRELIB avec le PPN des item Wikidata équivalents.

D'un côté, on récupère le PPN des personnes (dont l'URI est stockée dans ?personne) sur Data For Humanities et de l'autre les items Wikidata dont les propriétés

P269 (l'identifiant dans IdRef) et P5641 (PRELIB Person ID) ont été saisis. On forge l'URI de la personne PRELIB à partir de P5641 et

on la lie avec ?personne

PREFIX cidoc: http://www.cidoc-crm.org/cidoc-crm/ PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX wd: http://www.wikidata.org/entity/ PREFIX wdt: http://www.wikidata.org/prop/direct/

SELECT * WHERE { { SERVICE https://dataforhumanities.abes.fr/sparql { SELECT ?personne ?ppn_dans_prelib { GRAPH https://dataforhumanities.org/sparql-endpoint/prelib-v1 { ?personne https://ontome.net/ns/sdh-crm-supplement/P20 ?o ; a cidoc:E21_Person . } FILTER (CONTAINS(str(?o), 'idref')) BIND (substr(str(?o), 22, 9) AS ?ppn_dans_prelib) } } } UNION { SERVICE http://query.wikidata.org/bigdata/namespace/wdq/sparql { SELECT ?personne ?ppn_dans_wikidata { ?item wdt:P5641 ?PRELIB_PERSONNE_ID ; wdt:P269 ?ppn_dans_wikidata . BIND (IRI(CONCAT("http://mshb.huma-num.fr/prelib/personne/", ?PRELIB_PERSONNE_ID)) AS ?personne) } } } } ORDER BY ?personne

Use at

# SPARQL03759677
# A lancer depuis data.idref.fr
# Début d'une requête visant à comparer les PPN des personnes de PRELIB avec le PPN des item Wikidata équivalents.
# D'un côté, on récupère le PPN des personnes (dont l'URI est stockée dans ?personne) sur Data For Humanities et de l'autre les items Wikidata dont les propriétés 
# P269 (l'identifiant dans IdRef) et P5641 (PRELIB Person ID) ont été saisis. On forge l'URI de la personne PRELIB à partir de P5641 et 
# on la lie avec ?personne
PREFIX cidoc: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT *
WHERE {
  {
    SERVICE <https://dataforhumanities.abes.fr/sparql> {
      SELECT ?personne ?ppn_dans_prelib {
      GRAPH <https://dataforhumanities.org/sparql-endpoint/prelib-v1> {
        ?personne <https://ontome.net/ns/sdh-crm-supplement/P20> ?o ;
                  a cidoc:E21_Person .
      }
      FILTER (CONTAINS(str(?o), 'idref'))
      BIND (substr(str(?o), 22, 9) AS ?ppn_dans_prelib)
    }
      }
  }
  UNION
  {
    SERVICE <http://query.wikidata.org/bigdata/namespace/wdq/sparql> { SELECT ?personne ?ppn_dans_wikidata {
      ?item wdt:P5641 ?PRELIB_PERSONNE_ID ;
            wdt:P269 ?ppn_dans_wikidata .
      BIND (IRI(CONCAT("http://mshb.huma-num.fr/prelib/personne/", ?PRELIB_PERSONNE_ID)) AS ?personne)
    }
    }
  }
} ORDER BY ?personne

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?PRELIB_PERSONNE_ID") v4("?item") v2("?o") v7("?personne"):::projected v3("?ppn_dans_prelib"):::projected v6("?ppn_dans_wikidata"):::projected c6([http://www.cidoc-crm.org/cidoc-crm/E21_Person]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph s1["http://query.wikidata.org/bigdata/namespace/wdq/sparql"] style s1 stroke-width:4px; v4 --"wdt:P5641"--> v5 v4 --"wdt:P269"--> v6 bind0[/"concat('http://mshb.huma-num.fr/prelib/personne/',?PRELIB_PERSONNE_ID)"/] v5 --o bind0 bind0 --as--o v7 end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; subgraph s2["https://dataforhumanities.abes.fr/sparql"] style s2 stroke-width:4px; f1[["contains(str(?o),'idref')"]] f1 --> v2 v7 --https://ontome.net/ns/sdh-crm-supplement/P20--> v2 v7 --"a"--> c6 bind2[/"substring(str(?o),'22^^xsd:integer','9^^xsd:integer')"/] v2 --o bind2 bind2 --as--o v3 end end union0r <== or ==> union0l end