query-3d8f4903c271f3bdb85e271a477e7716

rq turtle/ttl

VIAF Source Codes. http://viaf.org/To do coreferencing work, we need to correlate VIAF source codes (eg JPG) to WD props (eg P245). We can find some of them with this query, and I found the others at the list of sources on

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?entity ?entityLabel ?prop ?propLabel ?code ?countryLabel {
  ?prop wdt:P1552 wd:Q26921380.
  optional {
    ?prop wdt:P1629 ?entity
    optional {?entity wdt:P17 ?country}
  }
  optional {
    ?prop wdt:P3303 ?formatter 
    filter(regex(?formatter,"https://viaf.org/processed/(.*)\\|\\$1"))
    bind(replace(?formatter,"https://viaf.org/processed/(.*)\\|\\$1","$1") as ?code)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?propLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?code"):::projected v5("?country") v4("?entity"):::projected v2("?formatter") v3("?prop"):::projected v1("?propLabel"):::projected c8(["bd:serviceParam"]):::iri c3(["wd:Q26921380"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P1552"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1629".-> v4 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P17".-> v5 end end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P3303".-> v2 bind0[/"replace(?formatter,'https://viaf.org/processed/(.*)\|\$1','$1')"/] v2 --o bind0 bind0 --as--o v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end