Skip to content

Commit

Permalink
Add reglement type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
MPParsley committed May 31, 2024
1 parent f738ea5 commit ec460a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 10 additions & 0 deletions webcomponents/reglementen-lijst/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ <h2 class="h3" slot="title" style="display:flex;flex-direction:column;gap:30px;m
</h2>
</reglementen-lijst>

<reglementen-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="1"
types="https://data.vlaanderen.be/id/concept/BesluitType/e8afe7c5-9640-4db8-8f74-3f023bec3241"
>
<h2 class="h3" slot="title" style="display:flex;flex-direction:column;gap:30px;margin:0 0 30px 0;padding:0 20px;">
Meest recente Politiereglement Stad Gent
</h2>
</reglementen-lijst>

<reglementen-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="3"
Expand Down
11 changes: 9 additions & 2 deletions webcomponents/reglementen-lijst/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ class ReglementenLijst extends HTMLElement {
filterparams += "VALUES ?bestuursorgaanURI { " + bestuursorganenArray.map(bestuursorgaan => `<${bestuursorgaan.trim()}>`).join(" ") + " }"
}

// Type filter.
const types = this.getAttribute('types');
if (types) {
const typesArray = types.split(" ");
filterparams += "VALUES ?type { " + typesArray.map(type => `<${type.trim()}>`).join(" ") + " }"
} else {
filterparams += `VALUES ?type { ${Object.keys(ReglementenLijst.types).map((type) => `<${type}>`).join(" ")} }`;
}

let queryBestuursorgaan = `
prov:wasGeneratedBy/dct:subject ?agendapunt .
Expand Down Expand Up @@ -116,8 +125,6 @@ class ReglementenLijst extends HTMLElement {
${queryBestuursorgaan}
?bestuursorgaanURI skos:prefLabel ?orgaan .
VALUES ?type { ${Object.keys(ReglementenLijst.types).map((type) => `<${type}>`).join(" ")} }
${filterparams}
FILTER (!CONTAINS(STR(?url), "/notulen"))
FILTER (!CONTAINS(STR(?orgaan), "personeel"))
Expand Down

0 comments on commit ec460a0

Please sign in to comment.