Skip to content

Commit

Permalink
fix: Ordering of cubes (latest cube query)
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Mar 7, 2024
1 parent 3797a3b commit 28fedbd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/rdf/query-latest-cube-iri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PREFIX schema: <http://schema.org/>
SELECT ?iri WHERE {
{
# Versioned cube.
SELECT ?iri WHERE {
SELECT ?iri ?version WHERE {
VALUES ?oldIri { <${cubeIri}> }
?versionHistory schema:hasPart ?oldIri .
?versionHistory schema:hasPart ?iri .
Expand All @@ -30,11 +30,13 @@ SELECT ?iri WHERE {
} UNION {
{
# Version history of a cube.
VALUES ?versionHistory { <${cubeIri}> }
?versionHistory schema:hasPart ?iri .
?iri schema:version ?version .
?iri schema:creativeWorkStatus ?status .
FILTER(NOT EXISTS { ?iri schema:expires ?expires . } && ?status = <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published>)
SELECT ?iri ?version WHERE {
VALUES ?versionHistory { <${cubeIri}> }
?versionHistory schema:hasPart ?iri .
?iri schema:version ?version .
?iri schema:creativeWorkStatus ?status .
FILTER(NOT EXISTS { ?iri schema:expires ?expires . } && ?status = <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published>)
}
}
}
}
Expand Down

0 comments on commit 28fedbd

Please sign in to comment.