query-9033d7abaa8829604bf61a573d9302f2

rq turtle/ttl

Propertiesinstance of (P31)units sold (P2664)Kickstarter project ID (P8019)Indiegogo project ID (P7953)total revenue (P2139)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (MAX(?units) AS ?unitsSold) ?money ?currencyLabel WHERE {
  ?item wdt:P31 wd:Q7889. 
  ?item wdt:P2664 ?units.

  { ?item p:P8019 ?statement. } UNION { ?item p:P7953 ?statement. } # Kickstarter and Indiegogo

  ?statement pq:P2139 ?money .
    OPTIONAL { ?statement pqv:P2139 ?pqv .
               ?pqv wikibase:quantityUnit ?currency }. 
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?money ?currencyLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?currency") v1("?item"):::projected v4("?money"):::projected v5("?pqv") v3("?statement") v2("?units"):::projected v7("?unitsSold") c10(["bd:serviceParam"]):::iri c2(["wd:Q7889"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P31"--> c2 v1 --"p:direct/P2664"--> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:P7953"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:P8019"--> v3 end union0r <== or ==> union0l end v3 --"p:qualifier/P2139"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/value/P2139".-> v5 v5 --"wikibase:quantityUnit"--> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind1[/"max(?units)"/] v2 --o bind1 bind1 --as--o v7