-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Managed cached endpoint #1599
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
cc @Rdataflow, waiting for the PROD endpoint to be fixed so we can properly test the change and implement any potential additional requirements (e.g. encoding the cube iri) 👀 |
Maybe you could extract all possible variable types with some typescript-fu:
then you can |
Thanks for the idea @ptbrowne, I will check it out tomorrow 💯 |
Ah this time, the end to end tests seem to have found something, I do not recognize the usual suspects in the failed E2E tests. |
Yes, I think it might be related to the fact that with this PR, the PROD endpoint is broken, so any test relying on it won't work. I'll re-check once it's fixed by Zazuko 👀 |
edf9179
to
377f82b
Compare
@bprusinowski can you add statistics on visit frequency to address case b)? (i.e. visits per chart key) |
@Rdataflow yes, that's the plan to try to add a new table to our database that would store information on views per chart config 👍 |
9234548
to
fdf74ac
Compare
@bprusinowski curious: is there already some PR around ? |
@Rdataflow yes, this was already implemented in #1613 😄 |
@bprusinowski the new varnish config is now on PROD 👍 and unblocks this PR 🚀 |
Thanks for a hint @Rdataflow! In this case I'll also take a look at pre-populating the cache for most viewed charts and then merge the PR. Will do it tomorrow 👍 |
…into feat/managed-cached-endpoint
@Rdataflow the changes should soon be on TEST :) |
@bprusinowski by inspecting the traffic I spotted 3 types of queries which shall also be passed to rationale is to harden the cached charts for the case of db outage and max out long term cache 😄
PREFIX cube: <https://cube.link/>
PREFIX schema: <http://schema.org/>
SELECT ?iri WHERE {
{
# Versioned cube.
SELECT ?iri ?version WHERE {
VALUES ?oldIri { <https://environment.ld.admin.ch/foen/ubd000503bis/2> }
?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)
} UNION {
{
# Version history of a cube.
SELECT ?iri ?status ?version WHERE {
VALUES ?versionHistory { <https://environment.ld.admin.ch/foen/ubd000503bis/2> }
?versionHistory schema:hasPart ?iri .
?iri schema:version ?version .
?iri schema:creativeWorkStatus ?status .
FILTER(NOT EXISTS { ?iri schema:expires ?expires . })
}
ORDER BY DESC(?status) DESC(?version)
}
} UNION {
{
# Non-versioned cube.
SELECT ?iri ?status WHERE {
VALUES ?iri { <https://environment.ld.admin.ch/foen/ubd000503bis/2> }
?iri cube:observationConstraint ?shape .
?iri schema:creativeWorkStatus ?status .
FILTER(NOT EXISTS { ?iri schema:expires ?expires . } && NOT EXISTS { ?versionHistory schema:hasPart ?iri . })
}
ORDER BY DESC(?status)
}
}
}
LIMIT 1
PREFIX cube: <https://cube.link/>
PREFIX schema: <http://schema.org/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
SELECT ?dimensionIri ?version ?nodeKind WHERE {
<https://environment.ld.admin.ch/foen/ubd000503bis/2> cube:observationConstraint/sh:property ?dimension .
?dimension sh:path ?dimensionIri .
OPTIONAL { ?dimension schema:version ?version . }
OPTIONAL { ?dimension sh:nodeKind ?nodeKind . }
FILTER(?dimensionIri IN (<https://environment.ld.admin.ch/foen/ubd000503bis/treibstoffe>))
}
PREFIX cube: <https://cube.link/>
PREFIX schema: <http://schema.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?dimension0_v WHERE {
<https://environment.ld.admin.ch/foen/ubd000503bis/2> cube:observationSet/cube:observation ?observation .
?observation <https://environment.ld.admin.ch/foen/ubd000503bis/treibstoffe> ?dimension0 .
?dimension0 schema:sameAs ?dimension0_v .
VALUES ?dimension0_v { <https://environment.ld.admin.ch/foen/ubd000503bis/Treibstoffe/treib1> }
}
LIMIT 1 |
😱 thanks for spotting this @Rdataflow, I will investigate why this is the case 👍 |
Closes #1596
This PR: