query-8fd70ac2d3103375a976e651e91b9dfa

rq turtle/ttl

TODO

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?title_en ?article_en ?no ?da ?sv ?nn
WHERE
{

{
  SELECT ?title_en ?article_en
  WHERE
  {
    SERVICE wikibase:mwapi
    {
      bd:serviceParam wikibase:endpoint "en.wikipedia.org" .

      # Generator to get all transclusions of the Template "WikiProject Climate change"
      bd:serviceParam wikibase:api "Generator" .
      bd:serviceParam mwapi:generator "alltransclusions" .
      bd:serviceParam mwapi:gatfrom "WikiProject Climate change" .
      bd:serviceParam mwapi:gatto "WikiProject Climate change" .
      bd:serviceParam mwapi:gatlimit "max" .

      # Use the info module to get the name of associated page
      # (the template is on talk pages, so this gives the subject pages)
      bd:serviceParam mwapi:prop "info" .
      bd:serviceParam mwapi:inprop "associatedpage" .

      # Output
      # (There is no point in trying to get associated items, because that would be for the found talk pages) 
      ?title wikibase:apiOutput "@associatedpage" .
    }
    BIND (STRLANG(?title, "en") AS ?title_en)
    OPTIONAL { ?article_en schema:name ?title_en . }
    FILTER BOUND(?article_en)
  }
}  ?article_en schema:isPartOf <https://en.wikipedia.org/> .
  ?article_en schema:about ?item .

  OPTIONAL { ?article_no schema:about ?item ;
  schema:isPartOf <https://no.wikipedia.org/> .}
  OPTIONAL { ?article_sv schema:about ?item ;
  schema:isPartOf <https://sv.wikipedia.org/> . }
  OPTIONAL { ?article_da schema:about ?item ;
  schema:isPartOf <https://da.wikipedia.org/> . }
  OPTIONAL { ?article_nn schema:about ?item ;
  schema:isPartOf <https://nn.wikipedia.org/> . }  
  BIND(IF(BOUND(?article_no),"yes","no") as ?no)
  BIND(IF(BOUND(?article_da),"yes","no") as ?da)
  BIND(IF(BOUND(?article_sv),"yes","no") as ?sv) 
  BIND(IF(BOUND(?article_nn),"yes","no") as ?nn) 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?article_da") v1("?article_en"):::projected v8("?article_nn") v5("?article_no") v6("?article_sv") v10("?da"):::projected v4("?item") v12("?nn"):::projected v9("?no"):::projected v11("?sv"):::projected v2("?title") v3("?title_en"):::projected c4(["en.wikipedia.org"]):::literal c22([https://en.wikipedia.org/]):::iri c2(["bd:serviceParam"]):::iri c24([https://no.wikipedia.org/]):::iri c17(["associatedpage"]):::literal c15(["info"]):::literal c8(["alltransclusions"]):::literal c27([https://nn.wikipedia.org/]):::iri c13(["max"]):::literal c10(["WikiProject Climate change"]):::literal c19(["@associatedpage"]):::literal c26([https://da.wikipedia.org/]):::iri c25([https://sv.wikipedia.org/]):::iri c6(["Generator"]):::literal f0[["bound(?article_en)"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:endpoint"--> c4 c2 --"mwapi:api"--> c6 c2 --"mwapi:generator"--> c8 c2 --"mwapi:gatfrom"--> c10 c2 --"mwapi:gatto"--> c10 c2 --"mwapi:gatlimit"--> c13 c2 --"mwapi:prop"--> c15 c2 --"mwapi:inprop"--> c17 v2 --"mwapi:apiOutput"--> c19 end bind1[/"STRLANG(?title,'en')"/] v2 --o bind1 bind1 --as--o v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."schema:name".-> v3 end v1 --"schema:isPartOf"--> c22 v1 --"schema:about"--> v4 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:about".-> v4 v5 --"schema:isPartOf"--> c24 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v4 v6 --"schema:isPartOf"--> c25 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v4 v7 --"schema:isPartOf"--> c26 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v8 -."schema:about".-> v4 v8 --"schema:isPartOf"--> c27 end bind2[/"if(bound(?article_no),'yes','no')"/] v5 --o bind2 bind2 --as--o v9 bind3[/"if(bound(?article_da),'yes','no')"/] v7 --o bind3 bind3 --as--o v10 bind4[/"if(bound(?article_sv),'yes','no')"/] v6 --o bind4 bind4 --as--o v11 bind5[/"if(bound(?article_nn),'yes','no')"/] v8 --o bind5 bind5 --as--o v12