query-83b5a3a6cf542f98a0b9d7c7ff19df29
Find author by name given by string to which I pass name and surname as strings and returns a json query(name,surname)Hi! I'm trying to get the same results that this query returns, but substituting Q430699 (given name) and Q16882155 (family name) by strings of my choosing. My goal is to write a function
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?writer ?writerLabel ?country_of_citizenship ?country_of_citizenshipLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?writer wdt:P106 wd:Q36180.
?writer wdt:P735 wd:Q430699.
?writer wdt:P734 wd:Q16882155.
OPTIONAL { ?writer wdt:P27 ?country_of_citizenship. }
}
LIMIT 1
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?country_of_citizenship"):::projected
v1("?writer"):::projected
c2(["bd:serviceParam"]):::iri
c8(["wd:Q430699"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c10(["wd:Q16882155"]):::iri
c6(["wd:Q36180"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"wdt:P106"--> c6
v1 --"wdt:P735"--> c8
v1 --"wdt:P734"--> c10
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P27".-> v2
end