Skip to content

Commit

Permalink
PROBE: Add optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MPParsley committed Sep 3, 2024
1 parent 58b0830 commit 7605901
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 54 deletions.
47 changes: 0 additions & 47 deletions webcomponents/besluiten-lijst/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
</head>
<body class="cs--blue">
<h1>Besluiten lijst</h1>
<besluiten-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="5"
bestuursorganen="http://data.lblod.info/id/bestuursorganen/c126b20bc1a94de293b7fceaf998c82e9a7a1d56ba34cbf9992aa4bf01ae2b01 http://data.lblod.info/id/bestuursorganen/6efc9b0c3ebb3371031d45e517d88f66eb115adf28e5e1827684522f56a8aa2c"
>
<span slot="title">5 meest recente besluiten gemeenteraad en burgemeester (probe)</span>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="5"
Expand All @@ -46,45 +39,5 @@ <h1>Besluiten lijst</h1>
>
<span slot="title">Alle besluiten gemeenteraad en burgemeester voor het thema "Wegenregister" (probe)</span>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="5"
pager="true"
start="2024-01-01"
eind="2024-01-07"
>
<span slot="title">Alle besluiten tussen 1 januari 2024 en 7 januari 2024 (probe)</span>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="1"
bestuursorganen="http://data.lblod.info/id/bestuursorganen/c126b20bc1a94de293b7fceaf998c82e9a7a1d56ba34cbf9992aa4bf01ae2b01 http://data.lblod.info/id/bestuursorganen/6efc9b0c3ebb3371031d45e517d88f66eb115adf28e5e1827684522f56a8aa2c"
statussen="Afgekeurd"
>
<span slot="title">Meest recente afgekeurd besluit gemeenteraad en burgemeester aanvaard tot de zitting als hoogdringend agendapunt (probe)</span>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="1"
bestuursorganen="http://data.lblod.info/id/bestuursorganen/c126b20bc1a94de293b7fceaf998c82e9a7a1d56ba34cbf9992aa4bf01ae2b01 http://data.lblod.info/id/bestuursorganen/6efc9b0c3ebb3371031d45e517d88f66eb115adf28e5e1827684522f56a8aa2c"
statussen="Gedeeltelijke ingetrokken, Verdaagd"
>
<span slot="title">Meest recente gedeeltelijke ingetrokken of verdaagd besluit gemeenteraad en burgemeester (probe)</span>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://qa.centrale-vindplaats.lblod.info/sparql"
aantal="1"
>
<span slot="title">Meest recente besluit op centrale vindplaats</span>
<a slot="raadpleegomgeving" href="https://qa.centrale-vindplaats.lblod.info/" class="button button-primary">Alle besluiten op centrale vindplaats</a>
</besluiten-lijst>
<besluiten-lijst
sparql-endpoint="https://qa.centrale-vindplaats.lblod.info/sparql"
aantal="1"
bestuurseenheden="http://data.lblod.info/id/bestuurseenheden/763adc09114dd8d54a1c8bfabeaec5e5ce543d858c3dff057a1c39f9103249a0"
>
<span slot="title">Meest recente besluit op centrale vindplaats van Heist-op-den-Berg</span>
<a slot="raadpleegomgeving" href="https://qa.centrale-vindplaats.lblod.info/" class="button button-primary">Alle besluiten op centrale vindplaats</a>
</besluiten-lijst>
</body>
</html>
14 changes: 8 additions & 6 deletions webcomponents/besluiten-lijst/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ class BesluitenLijst extends HTMLElement {
}

// @TODO: remove OPTIONAL {} when eenheden are available.
queryBestuurseenheid = `OPTIONAL {${queryBestuurseenheid}}`;
let queryOptional = `OPTIONAL {${queryBestuurseenheid}}`;

// @TODO: remove OPTIONAL {} when statusses are available.
queryOptional += `OPTIONAL { ?besluit prov:wasGeneratedBy/besluit:heeftStemming/besluit:gevolg ?status }`;

// @TODO: remove with query below after Bestuursorgaan has been moved to Zitting iso BehandelingVanAgendapunt
const endpoint = this.getAttribute('sparql-endpoint')
Expand All @@ -174,7 +177,7 @@ class BesluitenLijst extends HTMLElement {
queryBestuursorgaan,
queryThema,
filterparams,
queryBestuurseenheid,
queryOptional,
orderbyClause,
limitClause,
offsetClause
Expand All @@ -184,13 +187,13 @@ class BesluitenLijst extends HTMLElement {
queryBestuursorgaan,
queryThema,
filterparams,
queryBestuurseenheid
queryOptional
);

return this.selectQuery;
}

getQuery(fields, queryBestuursorgaan, queryThema, filterparams, queryBestuurseenheid, orderbyClause='', limitClause='', offsetClause='') {
getQuery(fields, queryBestuursorgaan, queryThema, filterparams, optionalQuery, orderbyClause='', limitClause='', offsetClause='') {
return `
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX prov: <http://www.w3.org/ns/prov#>
Expand All @@ -206,12 +209,11 @@ class BesluitenLijst extends HTMLElement {
?besluit a besluit:Besluit ;
eli:title_short ?title ;
prov:wasDerivedFrom ?url ;
prov:wasGeneratedBy/besluit:heeftStemming/besluit:gevolg ?status ;
${queryBestuursorgaan}
?bestuursorgaanURI skos:prefLabel ?orgaanLabel .
${queryThema}
${queryBestuurseenheid}
${optionalQuery}
${filterparams}
BIND(CONCAT(UCASE(SUBSTR(?orgaanLabel, 1, 1)), SUBSTR(?orgaanLabel, 2)) AS ?orgaan)
}
Expand Down
2 changes: 1 addition & 1 deletion webcomponents/reglementen-lijst/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ class ReglementenLijst extends HTMLElement {
eli:date_publication ?publicatie_datum ;
eli:title_short ?title ;
prov:wasDerivedFrom ?url ;
prov:wasGeneratedBy/besluit:heeftStemming/besluit:gevolg ?status ;
${queryBestuursorgaan}
?bestuursorgaanURI skos:prefLabel ?orgaan .
OPTIONAL { ?bestuursorgaanURI besluit:bestuurt ?bestuureenheidURI . }
OPTIONAL { ?besluit prov:wasGeneratedBy/besluit:heeftStemming/besluit:gevolg ?status }
${queryThema}
${filterparams}
Expand Down

0 comments on commit 7605901

Please sign in to comment.