Skip to content

Commit

Permalink
Merge pull request #1940 from Rdataflow/fix-use-standard-sparql-iri
Browse files Browse the repository at this point in the history
fix: use standard SPARQL IRI starting with <https://...>
  • Loading branch information
bprusinowski authored Dec 16, 2024
2 parents 5c4a4c9 + 4078702 commit 716d2ae
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
6 changes: 4 additions & 2 deletions app/rdf/parse-search-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const visualizePredicates = {
hasDimension: ns.visualizeAdmin`hasDimension`.value,
hasTermset: ns.visualizeAdmin`hasTermset`.value,
hasTimeUnit: ns.visualizeAdmin`hasTimeUnit`.value,
hasThemeIris: ns.visualizeAdmin`hasThemeIris`.value,
hasThemeLabels: ns.visualizeAdmin`hasThemeLabels`.value,
};

function buildSearchCubes(
Expand Down Expand Up @@ -39,9 +41,9 @@ function buildSearchCubes(
if (cubeQuads) {
const unversionedIri =
cubeQuads.get(ns.schema.hasPart.value)?.[0].object.value ?? iri;
const themeQuads = cubeQuads.get("tag:/themeIris")?.[0];
const themeQuads = cubeQuads.get(visualizePredicates.hasThemeIris)?.[0];
const themeIris = themeQuads?.object.value.split(GROUP_SEPARATOR);
const themeLabelQuads = cubeQuads.get("tag:/themeLabels")?.[0];
const themeLabelQuads = cubeQuads.get(visualizePredicates.hasThemeLabels)?.[0];
const themeLabels = themeLabelQuads?.object.value.split(GROUP_SEPARATOR);
const subthemesQuads = cubeQuads.get(ns.schema.about.value);
const dimensions = cubeQuads.get(visualizePredicates.hasDimension);
Expand Down
4 changes: 2 additions & 2 deletions app/rdf/query-search-results-photovoltaikanlagen.mock.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","http://schema.org/description","Seit 2014 werden Photovoltaikanlagen mit einer Einmalvergütung (EIV) gefördert. Dabei wird abhängig von der Leistung, der Anlagenkategorie und dem Inbetriebnahmedatum ein einmaliger Beitrag an die Anlagenbetreiber ausbezahlt. Hier finden Sie pro Kanton und Auszahlungsjahr einen Überblick über die Anzahl geförderter EIV-Anlagen, die installierte Leistung in Kilowatt (kW) sowie den ausbezahlten EIV-Förderbeitrag. Die dargestellten Daten entsprechen nicht vollständig der offiziellen Statistik der erneuerbaren Energien durch das BFE. Da der Abbau der Wartelisten zeitverzögert stattfindet, können Abweichungen entstehen."
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","http://schema.org/name","Einmalvergütung für Photovoltaikanlagen"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","http://schema.org/workExample","https://ld.admin.ch/application/visualize"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","tag:/themeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/national-economy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","tag:/themeLabels","Energy|||National economy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","https://visualize.admin.ch/hasThemeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/national-economy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10","https://visualize.admin.ch/hasThemeLabels","Energy|||National economy"
"https://ld.admin.ch/dimension/office","https://cube.link/meta/isUsedIn","https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/10"
"https://ld.admin.ch/dimension/office","http://schema.org/name","Federal Offices"
"https://register.ld.admin.ch/opendataswiss/org/bundesamt-fur-energie-bfe","http://schema.org/name","Swiss Federal Office of Energy SFOE"
Expand Down
8 changes: 4 additions & 4 deletions app/rdf/query-search-results-shared-dimensions.mock.csv
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","http://schema.org/name","Einmalvergütung für Photovoltaikanlagen"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","http://schema.org/workExample","https://ld.admin.ch/application/visualize"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","https://visualize.admin.ch/hasDimension","https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","tag:/themeIris","https://register.ld.admin.ch/opendataswiss/category/national-economy|||https://register.ld.admin.ch/opendataswiss/category/energy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","tag:/themeLabels","National economy|||Energy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","https://visualize.admin.ch/hasThemeIris","https://register.ld.admin.ch/opendataswiss/category/national-economy|||https://register.ld.admin.ch/opendataswiss/category/energy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/14","https://visualize.admin.ch/hasThemeLabels","National economy|||Energy"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton","https://visualize.admin.ch/hasTermset","https://ld.admin.ch/dimension/canton"
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton","http://schema.org/name","Kanton"
"https://register.ld.admin.ch/opendataswiss/org/bundesamt-fur-energie-bfe","http://schema.org/name","Swiss Federal Office of Energy SFOE"
Expand All @@ -50,8 +50,8 @@
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","http://schema.org/name","Gebäudeprogramm - CO2-Wirkungen je Massnahmenbereich"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","http://schema.org/workExample","https://ld.admin.ch/application/visualize"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","https://visualize.admin.ch/hasDimension","https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/region"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","tag:/themeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/construction|||https://register.ld.admin.ch/opendataswiss/category/statistical-basis|||https://register.ld.admin.ch/opendataswiss/category/population"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","tag:/themeLabels","Energy|||Construction and housing|||Statistical basis|||Population"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","https://visualize.admin.ch/hasThemeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/construction|||https://register.ld.admin.ch/opendataswiss/category/statistical-basis|||https://register.ld.admin.ch/opendataswiss/category/population"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/4","https://visualize.admin.ch/hasThemeLabels","Energy|||Construction and housing|||Statistical basis|||Population"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/region","https://visualize.admin.ch/hasTermset","https://ld.admin.ch/dimension/country"
"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_co2wirkung/region","http://schema.org/name","Region"
"https://ld.admin.ch/dimension/country","http://schema.org/name","Countries"
Expand Down
8 changes: 4 additions & 4 deletions app/rdf/query-search-results-temporal.mock.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","http://schema.org/name","GEB - Einmalvergütung für Photovoltaikanlagen"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","http://schema.org/workExample","https://ld.admin.ch/application/visualize"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","https://visualize.admin.ch/hasDimension","https://energy.ld.admin.ch/sfoe/OGD84GebTest/Jahr"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","tag:/themeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/national-economy"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","tag:/themeLabels","Energie|||Volkswirtschaft"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","https://visualize.admin.ch/hasThemeIris","https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/national-economy"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/1","https://visualize.admin.ch/hasThemeLabels","Energie|||Volkswirtschaft"
"https://energy.ld.admin.ch/sfoe/OGD84GebTest/Jahr","https://visualize.admin.ch/hasTimeUnit","http://www.w3.org/2006/time#unitYear"
"https://register.ld.admin.ch/opendataswiss/org/bundesamt-fur-energie-bfe","http://schema.org/name","Bundesamt für Energie BFE"
"https://register.ld.admin.ch/opendataswiss/category/energy","http://schema.org/name","Energie"
Expand All @@ -55,8 +55,8 @@
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","http://schema.org/name","Statistik der Wasserkraftanlagen (WASTA)"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","http://schema.org/workExample","https://ld.admin.ch/application/visualize"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","https://visualize.admin.ch/hasDimension","https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/YearOfStatistic"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","tag:/themeIris","https://register.ld.admin.ch/opendataswiss/category/territory|||https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/geography|||https://register.ld.admin.ch/opendataswiss/category/culture"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","tag:/themeLabels","Raum und Umwelt|||Energie|||Geographie|||Kultur, Medien, Informationsgesellschaft, Sport"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","https://visualize.admin.ch/hasThemeIris","https://register.ld.admin.ch/opendataswiss/category/territory|||https://register.ld.admin.ch/opendataswiss/category/energy|||https://register.ld.admin.ch/opendataswiss/category/geography|||https://register.ld.admin.ch/opendataswiss/category/culture"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/7","https://visualize.admin.ch/hasThemeLabels","Raum und Umwelt|||Energie|||Geographie|||Kultur, Medien, Informationsgesellschaft, Sport"
"https://energy.ld.admin.ch/sfoe/bfe_ogd40_wasta/YearOfStatistic","https://visualize.admin.ch/hasTimeUnit","http://www.w3.org/2006/time#unitYear"
"https://register.ld.admin.ch/opendataswiss/category/territory","http://schema.org/name","Raum und Umwelt"
"https://register.ld.admin.ch/foen/theme/15","http://schema.org/inDefinedTermSet","https://register.ld.admin.ch/foen/theme"
Expand Down
4 changes: 2 additions & 2 deletions app/rdf/query-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ const mkScoresQuery = (
schema:name ?title ;
schema:workExample <https://ld.admin.ch/application/visualize> ;
visualize:hasDimension ?dimensionIri ;
<themeIris> ?themeIris ;
<themeLabels> ?themeLabels .
visualize:hasThemeIris ?themeIris ;
visualize:hasThemeLabels ?themeLabels .
?dimensionIri
visualize:hasTimeUnit ?unitType ;
Expand Down

0 comments on commit 716d2ae

Please sign in to comment.