Skip to content

Commit

Permalink
fix: Consider cube status when fetching newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Feb 29, 2024
1 parent ad9fd7a commit 12bef54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/rdf/light-cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ export class LightCube {
const query = `PREFIX schema: <http://schema.org/>
SELECT ?iri WHERE {
?versionHistory schema:hasPart <${this.iri}> .
VALUES ?oldIri { <${this.iri}> }
?versionHistory schema:hasPart ?oldIri .
?versionHistory schema:hasPart ?iri .
?iri schema:version ?version .
?iri schema:creativeWorkStatus ?status .
?oldIri schema:creativeWorkStatus ?oldStatus .
FILTER(NOT EXISTS { ?iri schema:expires ?expires . } && ?status IN (?oldStatus, <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published>))
}
ORDER BY DESC(?version)
LIMIT 1`;
Expand Down

0 comments on commit 12bef54

Please sign in to comment.