query-ab608e96dbb71d3d7b91d6524b0c9efb
has been removed so I have updated the query: (P973)described at URL Heavy one, but works. Recently a lot of new identifier properties have been created and
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?image ?creator ?institution ?invnum ?location ?url ?idurl WHERE {
?item wdt:P31/wdt:P279* wd:Q3305213 .
OPTIONAL { ?item wdt:P18 ?image } .
OPTIONAL { ?item wdt:P170 ?creator } .
OPTIONAL { ?item wdt:P195 ?institution } .
OPTIONAL { ?item wdt:P217 ?invnum } .
OPTIONAL { ?item wdt:P276 ?location } .
OPTIONAL { ?item wdt:P973 ?url } .
OPTIONAL { ?item ?identifierproperty ?identifier .
?property wikibase:directClaim ?identifierproperty .
?property wikibase:propertyType wikibase:ExternalId .
?property wdt:P1630 ?formatterurl .
BIND(IRI(REPLACE(?identifier, '^(.+)$', ?formatterurl)) AS ?idurl).
}
} LIMIT 100000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?creator"):::projected
v11("?formatterurl")
v9("?identifier")
v8("?identifierproperty")
v12("?idurl"):::projected
v2("?image"):::projected
v4("?institution"):::projected
v5("?invnum"):::projected
v1("?item"):::projected
v6("?location"):::projected
v10("?property")
v7("?url"):::projected
a1((" "))
c12(["wikibase:ExternalId"]):::iri
c3(["wd:Q3305213"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P170".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P195".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P217".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P276".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P973".-> v7
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -->v8--> v9
v10 -."wikibase:directClaim".-> v8
v10 --"wikibase:propertyType"--> c12
v10 --"wdt:P1630"--> v11
bind0[/"replace(?identifier,'^(.+)$',?formatterurl)"/]
v9 --o bind0
v11 --o bind0
bind0 --as--o v12
end