query-193f6d918a00f0166a727c3a55afce6b
Propertiesinstance of (P31)author (P50)OCLC control number (P243)
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/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?wdItem ?ocnURI ?wdItemLabel ?authorLabel ?ocnSuggest
WHERE {
?wdItem wdt:P31 wd:Q571;
rdfs:label ?wdItemLabel;
wdt:P50 ?author.
?author rdfs:label ?authorLabel.
OPTIONAL { ?wdItem wdt:P243 ?ocn }
# SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
BIND(URI(CONCAT('http://www.worldcat.org/search?qt=worldcat_org_all&q=', ENCODE_FOR_URI(?wdItemLabel), ' ', ENCODE_FOR_URI(?authorLabel))) AS ?ocnSuggest)
FILTER(!bound(?ocn))
FILTER (LANG(?wdItemLabel)='en')
FILTER (LANG(?authorLabel)='en')
}
LIMIT 10
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?author")
v1("?authorLabel"):::projected
v3("?ocn")
v6("?ocnSuggest"):::projected
v4("?wdItem"):::projected
v2("?wdItemLabel"):::projected
c3(["wd:Q571"]):::iri
f0[["?authorLabel = 'en'"]]
f0 --> v1
f1[["?wdItemLabel = 'en'"]]
f1 --> v2
f2[["not bound(?ocn)"]]
f2 --> v3
v4 --"wdt:P31"--> c3
v4 --"rdfs:label"--> v2
v4 --"wdt:P50"--> v5
v5 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P243".-> v3
end
bind3[/"concat('http://www.worldcat.org/search?qt=worldcat_org_all&q=',encode-for-uri(?wdItemLabel),' ',encode-for-uri(?authorLabel))"/]
v2 --o bind3
v1 --o bind3
bind3 --as--o v6