query-00b1cbe8dee6f5a72afa49df0b01abcf

rq turtle/ttl

Encyclopedic articles with certain subjects select ?article ?articleTitle ?parentWork ?parentWorkLabel { VALUES ?ENCYC_ARTICLE { wd:Q13433827 } VALUES ?ARTICLE_SUBJECT {wd:Q142 wd:Q31} # France or Belgium

# articles with the given subject ?article wdt:P31/wdt:P279* ?ENCYC_ARTICLE; wdt:P921 ?ARTICLE_SUBJECT . hint:Prior hint:runFirst true.

OPTIONAL { ?article wdt:P1476 ?articleTitle } OPTIONAL { ?article wdt:P1433 ?parentWork } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # used to display a label } Encyclopedic articles with certain subjects select ?article ?articleTitle ?parentWork ?parentWorkLabel { VALUES ?ENCYC_ARTICLE { wd:Q13433827 } VALUES ?ARTICLE_SUBJECT {wd:Q142 wd:Q31} # France or Belgium

# articles with the given subject ?article wdt:P31/wdt:P279* ?ENCYC_ARTICLE; wdt:P921 ?ARTICLE_SUBJECT . hint:Prior hint:runFirst true.

OPTIONAL { ?article wdt:P1476 ?articleTitle } OPTIONAL { ?article wdt:P1433 ?parentWork } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # used to display a label }

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#>
# Encyclopedic articles with certain subjects
select ?article ?articleTitle ?parentWork ?parentWorkLabel 
{
  VALUES ?ENCYC_ARTICLE { wd:Q13433827 }
  VALUES ?ARTICLE_SUBJECT {wd:Q142 wd:Q31} # France or Belgium

  # articles with the given subject
  ?article wdt:P31/wdt:P279* ?ENCYC_ARTICLE;
           wdt:P921 ?ARTICLE_SUBJECT .


  OPTIONAL { ?article wdt:P1476 ?articleTitle }
  OPTIONAL { ?article wdt:P1433 ?parentWork }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # used to display a label
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?ARTICLE_SUBJECT") v1("?ENCYC_ARTICLE") v3("?article"):::projected v4("?articleTitle"):::projected v5("?parentWork"):::projected a1((" ")) c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?ENCYC_ARTICLE/] bind0-->v1 bind00(["wd:Q13433827"]) bind00 --> bind0 bind1[/VALUES ?ARTICLE_SUBJECT/] bind1-->v2 bind10(["wd:Q142"]) bind10 --> bind1 bind11(["wd:Q31"]) bind11 --> bind1 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v1 v3 --"wdt:P921"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1476".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1433".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end