zazuko / rdf-cube-view-query

RDF Cube View Schema query library
2 stars 3 forks source link

Investigate for optimized Queries with multiple languages with Stardog. #77

Open l00mi opened 2 years ago

l00mi commented 2 years ago

From https://control.vshn.net/tickets/SBAR-711

Username : trifid-lindas
Database : lindas
Started  : 2022-08-26 02:05:46 PM
Elapsed  : 00:03:48.089
Timeout  : 00:20:00.000
Reasoning: false
Query    : 
SELECT DISTINCT ?dimension0 ?dimension1 ?dimension2 ?dimension3 ?dimension4 ?dimension5 ?dimension6 ?dimension7 ?dimension8 ?dimension9 ?dimension10 ?dimension11 ?dimension12 ?dimension13 ?dimension14 ?dimension15 ?dimension16 ?dimension17 ?dimension18 ?dimension19 ?dimension20 WHERE {
  <https://energy.ld.admin.ch/elcom/electricityprice> <https://cube.link/observationSet> ?observationSet0 .
  ?observationSet0 <https://cube.link/observation> ?source0 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/category> ?dimension0 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/municipality> ?dimension1 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/operator> ?dimension2 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/period> ?dimension3 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/aidfee> ?dimension4 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/charge> ?dimension5 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/energy> ?dimension6 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/fixcosts> ?dimension7 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/fixcostspercent> ?dimension8 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/gridusage> ?dimension9 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/total> ?dimension10 .
  ?source0 <https://energy.ld.admin.ch/elcom/electricityprice/dimension/product> ?dimension11 .
  FILTER (
    (?dimension0 = <https://energy.ld.admin.ch/elcom/electricityprice/category/C1>)
  )
  FILTER (
    (?dimension1 = <https://ld.admin.ch/municipality/1>)
  )
  FILTER (
    (?dimension2 = <https://energy.ld.admin.ch/elcom/electricityprice/operator/10>)
  )
  FILTER (
    (?dimension11 = <https://energy.ld.admin.ch/elcom/electricityprice/product/cheapest>)
  )
  OPTIONAL {
    ?dimension0 <http://schema.org/name> ?dimension12_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension12_0), "de")
    )
  }
  OPTIONAL {
    ?dimension0 <http://schema.org/name> ?dimension12_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension12_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension0 <http://schema.org/name> ?dimension12_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension12_2), "it")
    )
  }
  OPTIONAL {
    ?dimension0 <http://schema.org/name> ?dimension12_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension12_3), "en")
    )
  }
  OPTIONAL {
    ?dimension0 <http://schema.org/name> ?dimension12_4 .
    FILTER (
      (LANG(?dimension12_4) = "")
    )
  }
  BIND(COALESCE(?dimension12_0, ?dimension12_1, ?dimension12_2, ?dimension12_3, ?dimension12_4) AS ?dimension12)
  OPTIONAL {
    ?dimension1 <http://schema.org/name> ?dimension13_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension13_0), "de")
    )
  }
  OPTIONAL {
    ?dimension1 <http://schema.org/name> ?dimension13_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension13_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension1 <http://schema.org/name> ?dimension13_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension13_2), "it")
    )
  }
  OPTIONAL {
    ?dimension1 <http://schema.org/name> ?dimension13_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension13_3), "en")
    )
  }
  OPTIONAL {
    ?dimension1 <http://schema.org/name> ?dimension13_4 .
    FILTER (
      (LANG(?dimension13_4) = "")
    )
  }
  BIND(COALESCE(?dimension13_0, ?dimension13_1, ?dimension13_2, ?dimension13_3, ?dimension13_4) AS ?dimension13)
  OPTIONAL {
    ?dimension2 <http://schema.org/name> ?dimension14_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension14_0), "de")
    )
  }
  OPTIONAL {
    ?dimension2 <http://schema.org/name> ?dimension14_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension14_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension2 <http://schema.org/name> ?dimension14_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension14_2), "it")
    )
  }
  OPTIONAL {
    ?dimension2 <http://schema.org/name> ?dimension14_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension14_3), "en")
    )
  }
  OPTIONAL {
    ?dimension2 <http://schema.org/name> ?dimension14_4 .
    FILTER (
      (LANG(?dimension14_4) = "")
    )
  }
  BIND(COALESCE(?dimension14_0, ?dimension14_1, ?dimension14_2, ?dimension14_3, ?dimension14_4) AS ?dimension14)
  OPTIONAL {
    ?dimension4 <http://schema.org/name> ?dimension15_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension15_0), "de")
    )
  }
  OPTIONAL {
    ?dimension4 <http://schema.org/name> ?dimension15_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension15_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension4 <http://schema.org/name> ?dimension15_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension15_2), "it")
    )
  }
  OPTIONAL {
    ?dimension4 <http://schema.org/name> ?dimension15_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension15_3), "en")
    )
  }
  OPTIONAL {
    ?dimension4 <http://schema.org/name> ?dimension15_4 .
    FILTER (
      (LANG(?dimension15_4) = "")
    )
  }
  BIND(COALESCE(?dimension15_0, ?dimension15_1, ?dimension15_2, ?dimension15_3, ?dimension15_4) AS ?dimension15)
  OPTIONAL {
    ?dimension5 <http://schema.org/name> ?dimension16_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension16_0), "de")
    )
  }
  OPTIONAL {
    ?dimension5 <http://schema.org/name> ?dimension16_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension16_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension5 <http://schema.org/name> ?dimension16_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension16_2), "it")
    )
  }
  OPTIONAL {
    ?dimension5 <http://schema.org/name> ?dimension16_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension16_3), "en")
    )
  }
  OPTIONAL {
    ?dimension5 <http://schema.org/name> ?dimension16_4 .
    FILTER (
      (LANG(?dimension16_4) = "")
    )
  }
  BIND(COALESCE(?dimension16_0, ?dimension16_1, ?dimension16_2, ?dimension16_3, ?dimension16_4) AS ?dimension16)
  OPTIONAL {
    ?dimension6 <http://schema.org/name> ?dimension17_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension17_0), "de")
    )
  }
  OPTIONAL {
    ?dimension6 <http://schema.org/name> ?dimension17_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension17_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension6 <http://schema.org/name> ?dimension17_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension17_2), "it")
    )
  }
  OPTIONAL {
    ?dimension6 <http://schema.org/name> ?dimension17_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension17_3), "en")
    )
  }
  OPTIONAL {
    ?dimension6 <http://schema.org/name> ?dimension17_4 .
    FILTER (
      (LANG(?dimension17_4) = "")
    )
  }
  BIND(COALESCE(?dimension17_0, ?dimension17_1, ?dimension17_2, ?dimension17_3, ?dimension17_4) AS ?dimension17)
  OPTIONAL {
    ?dimension9 <http://schema.org/name> ?dimension18_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension18_0), "de")
    )
  }
  OPTIONAL {
    ?dimension9 <http://schema.org/name> ?dimension18_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension18_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension9 <http://schema.org/name> ?dimension18_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension18_2), "it")
    )
  }
  OPTIONAL {
    ?dimension9 <http://schema.org/name> ?dimension18_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension18_3), "en")
    )
  }
  OPTIONAL {
    ?dimension9 <http://schema.org/name> ?dimension18_4 .
    FILTER (
      (LANG(?dimension18_4) = "")
    )
  }
  BIND(COALESCE(?dimension18_0, ?dimension18_1, ?dimension18_2, ?dimension18_3, ?dimension18_4) AS ?dimension18)
  OPTIONAL {
    ?dimension10 <http://schema.org/name> ?dimension19_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension19_0), "de")
    )
  }
  OPTIONAL {
    ?dimension10 <http://schema.org/name> ?dimension19_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension19_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension10 <http://schema.org/name> ?dimension19_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension19_2), "it")
    )
  }
  OPTIONAL {
    ?dimension10 <http://schema.org/name> ?dimension19_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension19_3), "en")
    )
  }
  OPTIONAL {
    ?dimension10 <http://schema.org/name> ?dimension19_4 .
    FILTER (
      (LANG(?dimension19_4) = "")
    )
  }
  BIND(COALESCE(?dimension19_0, ?dimension19_1, ?dimension19_2, ?dimension19_3, ?dimension19_4) AS ?dimension19)
  OPTIONAL {
    ?dimension11 <http://schema.org/name> ?dimension20_0 .
    FILTER (
      LANGMATCHES(LANG(?dimension20_0), "de")
    )
  }
  OPTIONAL {
    ?dimension11 <http://schema.org/name> ?dimension20_1 .
    FILTER (
      LANGMATCHES(LANG(?dimension20_1), "fr")
    )
  }
  OPTIONAL {
    ?dimension11 <http://schema.org/name> ?dimension20_2 .
    FILTER (
      LANGMATCHES(LANG(?dimension20_2), "it")
    )
  }
  OPTIONAL {
    ?dimension11 <http://schema.org/name> ?dimension20_3 .
    FILTER (
      LANGMATCHES(LANG(?dimension20_3), "en")
    )
  }
  OPTIONAL {
    ?dimension11 <http://schema.org/name> ?dimension20_4 .
    FILTER (
      (LANG(?dimension20_4) = "")
    )
  }
  BIND(COALESCE(?dimension20_0, ?dimension20_1, ?dimension20_2, ?dimension20_3, ?dimension20_4) AS ?dimension20)
}
GROUP BY ?dimension0 ?dimension1 ?dimension2 ?dimension3 ?dimension4 ?dimension5 ?dimension6 ?dimension7 ?dimension8 ?dimension9 ?dimension10 ?dimension11 ?dimension12 ?dimension13 ?dimension14 ?dimension15 ?dimension16 ?dimension17 ?dimension18 ?dimension19 ?dimension20