query-f7ebe81616af9b6563990e38b50071fb

rq turtle/ttl

List of Oil & Gas CompaniesHi Everyone, I was wondering if anyone can help me with a query i am trying to run via Query Service. I would like to get a dataset of all Oil & Gas companies and their name, subsidiaries, location, total assets, total reserves. Eventually i would also like to get a list of oil and gas service providers with the same parameters/columns. Anyway anyone can help me build this query or guide me on how to create it? I have tried the query below but the results were very small and not consistent (different result set every time i run the same query) or no values where returned to most of the parameters/columns i requested. thanks again for your help

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 ?petroleum_industryLabel ?subsidiaryLabel ?industryLabel ?countryLabel ?total_assets WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?petroleum_industry wdt:P452 wd:Q862571.
  OPTIONAL { ?petroleum_industry wdt:P452 ?industry. }
  OPTIONAL { ?petroleum_industry wdt:P17 ?country. }
  OPTIONAL { ?petroleum_industry wdt:P355 ?subsidiary. }
  OPTIONAL { ?petroleum_industry wdt:P2403 ?total_assets. }
  OPTIONAL { ?petroleum_industry wdt:P17 ?country. }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?country") v2("?industry") v1("?petroleum_industry") v4("?subsidiary") v5("?total_assets"):::projected c2(["bd:serviceParam"]):::iri c6(["wd:Q862571"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P452"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P452".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P17".-> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P355".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P2403".-> v5 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P17".-> v3 end