1

I'm trying to list video games along with the data size (P3575). I want to limit the results to only show those in megabytes (Q79735) as a property constraint of data size.

Here is what I have now, which lists everything (mainly Megabytes, Gigabytes, block):

SELECT ?item ?itemLabel ?Size ?dataSizeLabel WHERE {
  ?item wdt:P31 wd:Q7889.
  ?item p:P3575 ?nodedataSize.
  ?nodedataSize psv:P3575 ?valuenodedataSize.
  ?valuenodedataSize wikibase:quantityAmount ?Size;
                   wikibase:quantityUnit ?dataSize.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

If I add:

?item wdt:P2305 wd:Q79735

then I get no results.

  • what you add doesn't make sense, why should the item aka the game itself have the unit? It should clearly be attached to the size literal – UninformedUser Jul 23 '22 at 14:57
  • 2
    `SELECT ?item ?itemLabel ?Size ?sizeUnitLabel WHERE { BIND(wd:Q79735 AS ?sizeUnit) ?item wdt:P31 wd:Q7889. ?item p:P3575 ?nodedataSize. ?nodedataSize psv:P3575 ?valuenodedataSize. ?valuenodedataSize wikibase:quantityAmount ?Size; wikibase:quantityUnit ?sizeUnit SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }` – UninformedUser Jul 23 '22 at 14:57

0 Answers0