query-804aba30627dd9f5c838d3ab602217f0

rq turtle/ttl

Or a clean table

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#>
SELECT DISTINCT ?item ?itemLabel ?cited_works ?cited_worksLabel 
WHERE
{
    {
      {?item wdt:P31 wd:Q1643932} 
      UNION 
      {?item wdt:P31 wd:Q2164067}
      UNION
      {?item wdt:P31 wd:Q71631512}
      UNION
      {?item wdt:P31 wd:Q4418079}      
    }. # instance = TTRPG or TTRPG system or supplement or setting
    ?item  wdt:P2860    ?cited_works. # which cites works
    {
      {?cited_works wdt:P31 wd:Q1643932}
      UNION 
      {?cited_works wdt:P31 wd:Q2164067}
      UNION
      {?cited_works wdt:P31 wd:Q71631512}
      UNION
      {?cited_works wdt:P31 wd:Q4418079} 
    }. # that are TTRPG or TTRPG system or supplement or setting  
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?item ?cited_works

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?cited_works"):::projected v1("?item"):::projected c3(["wd:Q2164067"]):::iri c5(["wd:Q4418079"]):::iri c8(["bd:serviceParam"]):::iri c2(["wd:Q1643932"]):::iri c10(["en"]):::literal c4(["wd:Q71631512"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c5 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c4 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c2 end union0r <== or ==> union0l end v1 --"wdt:P2860"--> v2 subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c5 end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c4 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 end union3r <== or ==> union3l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end