query-a3f39f63898171f78ee9d238ba3bdae8

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?subsidiary ?subsidiaryLabel  ?date ?revenue ?unitLabel WHERE {

  ?item wdt:P17 wd:Q30.
  ?item wdt:P31/wdt:P279* wd:Q4830453.
  {?item wdt:P355 ?subsidiary.}
  UNION
  {?subsidiary wdt:P749 ?item.}
  OPTIONAL {?subsidiary p:P2139 ?stat . 
            ?stat psv:P2139 [ wikibase:quantityAmount ?revenue ; wikibase:quantityUnit ?unit ]  .
            ?stat a wikibase:BestRank.
            OPTIONAL {?stat pq:P585 ?date} }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?date"):::projected v1("?item"):::projected v4("?revenue"):::projected v3("?stat") v2("?subsidiary"):::projected v5("?unit") a1((" ")) a2((" ")) c5(["wd:Q4830453"]):::iri c2(["wd:Q30"]):::iri c13(["wikibase:BestRank"]):::iri c16(["bd:serviceParam"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P17"--> c2 v1 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P749"--> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P355"--> v2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P2139".-> v3 a2 --"wikibase:quantityAmount"--> v4 a2 --"wikibase:quantityUnit"--> v5 v3 --"p:statement/value/P2139"--> a2 v3 --"a"--> c13 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P585".-> v6 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end