query-0ba5425e490aeac72af2bb4bded01aac

rq turtle/ttl

List of all TTRPG related items in Wikidata

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 ?instance ?instanceLabel ?date ?author ?authorLabel ?publisher ?publisherLabel ?movement ?movementLabel ?gamemechanics ?gamemechanicsLabel ?RPGGeek_ID WHERE {
  {
    { ?item wdt:P31 wd:Q1643932. } #TTRPG
    UNION
    { ?item wdt:P31 wd:Q2164067. } #System
    UNION
    { ?item wdt:P31 wd:Q71631512. } #supplement
    UNION
    { ?item wdt:P31 wd:Q4418079. } #setting
    UNION
    { ?item wdt:P31 wd:Q4686479. } #adventure
    UNION
    { ?item wdt:P31 wd:Q2608176. } #campaign
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL { ?item wdt:P577 ?date.}
  OPTIONAL { ?item (wdt:P50|wdt:P170|wdt:P2093) ?author.}  
  OPTIONAL { ?item wdt:P123 ?publisher.}
  OPTIONAL { ?item wdt:P135 ?movement.}
  OPTIONAL { ?item wdt:P4151 ?gamemechanics.}
  OPTIONAL { ?item wdt:P7226 ?RPGGeek_ID. }
}
ORDER BY (?itemLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?RPGGeek_ID"):::projected v5("?author"):::projected v4("?date"):::projected v8("?gamemechanics"):::projected v3("?instance"):::projected v2("?item"):::projected v1("?itemLabel"):::projected v7("?movement"):::projected v6("?publisher"):::projected c5(["wd:Q4418079"]):::iri c6(["wd:Q4686479"]):::iri c2(["wd:Q1643932"]):::iri c7(["wd:Q2608176"]):::iri c11(["en"]):::literal c3(["wd:Q2164067"]):::iri c9(["bd:serviceParam"]):::iri 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; 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; v2 --"wdt:P31"--> c7 end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c6 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c5 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c4 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P31"--> c2 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P31".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P577".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; v2 -."wdt:P2093".-> v5 end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P170"--> v5 end union6r <== or ==> union6l end end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P50"--> v5 end union5r <== or ==> union5l end end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P123".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P135".-> v7 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P4151".-> v8 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P7226".-> v9 end