query-9198bfaf4a4fa7b27a23776754d91b4f

rq turtle/ttl

TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } } TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE { BIND(wd:Q30 AS ?country) ?country (p:P6/ps:P6) ?p. ?p wdt:P26 ?w. OPTIONAL { ?p wdt:P18 ?ppicture. ?w wdt:P18 ?wpicture. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#TEMPLATE={"template":"Presidents of ?country and their spouses","variables":{"?country":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q6256 . }"} } }

SELECT ?p ?pLabel ?ppicture ?w ?wLabel ?wpicture WHERE {
  BIND(wd:Q30 AS ?country)
  ?country (p:P6/ps:P6) ?p.
  ?p wdt:P26 ?w.
  OPTIONAL {
    ?p wdt:P18 ?ppicture.
    ?w wdt:P18 ?wpicture.
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?country") v2("?p"):::projected v4("?ppicture"):::projected v3("?w"):::projected v5("?wpicture"):::projected a1((" ")) c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal bind0[/"'wd:Q30'"/] bind0 --as--o v1 v1 --"p:P6"--> a1 a1 --"p:statement/P6"--> v2 v2 --"p:direct/P26"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P18".-> v4 v3 --"p:direct/P18"--> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end