query-113650e1c69f8986c6becedb42b25068

rq turtle/ttl

Need to get the series too. SELECT #MIN(?dateYear) AS ?dateYears) (GROUP_CONCAT(DISTINCT ?dateYear ; separator = ", ") AS ?dateYears) (GROUP_CONCAT(DISTINCT ?gameENLabel ; separator = ", ") AS ?gameENLabels) (GROUP_CONCAT(DISTINCT ?gameJALabel ; separator = ", ") AS ?gameJALabels) (GROUP_CONCAT(DISTINCT ?hepbJALabel ; separator = ", ") AS ?hepbJALabels) WHERE { hint:Query hint:optimizer "None".

    ?game wdt:P136/wdt:P279* wd:Q744038.    # any subclass of role-playing video game
    ?game wdt:P31 wd:Q7889.             # instance of video game

    # English label
    ?game rdfs:label ?gameENLabel.
    FILTER(LANG(?gameENLabel) = "en"). # we mainly want English labels

    # Japanese or Chinese label
    OPTIONAL {
      ?game rdfs:label ?gameJALabel.
      FILTER((LANG(?gameJALabel) = "ja") || (LANG(?gameJALabel) = "zh")).  # we optionally want Japanese or Chinese labels (for Japanese or Chinese games, only, preferably)
    }

    # we also want hepburn or pinyin transliterations
    OPTIONAL {?game wdt:P2125   ?hepburn}
    OPTIONAL {?game wdt:P1721    ?pinyin}

    # labels
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "en".
        ?hepburn rdfs:label  ?hepbJALabel.
         ?pinyin rdfs:label  ?pinyinLabel.
    }
  }
GROUP BY $game
ORDER BY asc (?dateYears) ASC (?gameENLabels)
#limit 100

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Need to get the series too.
SELECT
      #MIN(?dateYear) AS     ?dateYears)
      (GROUP_CONCAT(DISTINCT     ?dateYear ; separator = ", ") AS     ?dateYears)
      (GROUP_CONCAT(DISTINCT  ?gameENLabel ; separator = ", ") AS  ?gameENLabels)
      (GROUP_CONCAT(DISTINCT  ?gameJALabel ; separator = ", ") AS  ?gameJALabels)
      (GROUP_CONCAT(DISTINCT  ?hepbJALabel ; separator = ", ") AS  ?hepbJALabels)
      WHERE {


        ?game wdt:P136/wdt:P279* wd:Q744038.    # any subclass of role-playing video game
        ?game wdt:P31 wd:Q7889.             # instance of video game

        # English label
        ?game rdfs:label ?gameENLabel.
        FILTER(LANG(?gameENLabel) = "en"). # we mainly want English labels

        # Japanese or Chinese label
        OPTIONAL {
          ?game rdfs:label ?gameJALabel.
          FILTER((LANG(?gameJALabel) = "ja") || (LANG(?gameJALabel) = "zh")).  # we optionally want Japanese or Chinese labels (for Japanese or Chinese games, only, preferably)
        }

        # we also want hepburn or pinyin transliterations
        OPTIONAL {?game wdt:P2125   ?hepburn}
        OPTIONAL {?game wdt:P1721    ?pinyin}

        # labels
        SERVICE wikibase:label {
          bd:serviceParam wikibase:language "en".
            ?hepburn rdfs:label  ?hepbJALabel.
             ?pinyin rdfs:label  ?pinyinLabel.
        }
      }
    GROUP BY $game
    ORDER BY asc (?dateYears) ASC (?gameENLabels)
    #limit 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?dateYear"):::projected v11("?dateYears") v5("?game") v3("?gameENLabel"):::projected v11("?gameENLabels") v4("?gameJALabel"):::projected v11("?gameJALabels") v8("?hepbJALabel"):::projected v12("?hepbJALabels") v6("?hepburn") v7("?pinyin") v9("?pinyinLabel") a1((" ")) c6(["wd:Q744038"]):::iri c1(["en"]):::literal c13(["bd:serviceParam"]):::iri c8(["wd:Q7889"]):::iri f0[["?gameENLabel = 'en'"]] f0 --> v3 v5 --"wdt:P136"--> a1 a1 --"wdt:P279"--> c6 v5 --"wdt:P31"--> c8 v5 --"rdfs:label"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P2125".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P1721".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c1 v6 --"rdfs:label"--> v8 v7 --"rdfs:label"--> v9 end bind5[/"?dateYear"/] v10 --o bind5 bind5 --as--o v11 bind6[/"?gameENLabel"/] v3 --o bind6 bind6 --as--o v11 bind7[/"?gameJALabel"/] v4 --o bind7 bind7 --as--o v11 bind8[/"?hepbJALabel"/] v8 --o bind8 bind8 --as--o v12