Entry
Immunization entry · Influenza, injectable, quadrivalent, preservative free · 2025-10-15
https://pod.alex-rivera.example/clinical/immunizations.ttl#b4e59f6dd44ac422142f1730ed4c5377db6560d42fe1fdbb6ae881aedd6d22aa
An entry is what an app shows: one allergy, one condition, one vaccination. The build makes it in a view by joining the records judged to be the same thing, and takes each of its values from one of them. Follow a member to see where it came from.
Every section below is one question with only the rows about this entry. The first lists the files of the pod that say something about it or name it. A Turtle link beside a thing opens the file it arrived in; a thing only ever named, or written by the build, has none.
Which file states each thing
The store loads each file twice: into the default graph, which the other questions read, and into a graph named by its address, which GRAPH ?file reads. A file states a thing when it says something about it, or names it as the value of a statement: a patient profile has no file of its own, so the files that name it are where it is stated. Named marks a row for a file that names the thing, and rebuilt a view or the labels, which the build writes. Files the build did not write come first, and among them the file a thing arrived in, if it has one.
Only the rows whose ?thing is this one.
| ?file | ?named | ?rebuilt |
|---|---|---|
clinical/immunizations.ttl page | false | true |
clinical/labels.ttl | false | true |
2 rows
The query: queries/questions/pod/Which file states each thing.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pim: <http://www.w3.org/ns/pim/space#>
SELECT DISTINCT ?thing ?file ?named ?rebuilt
WHERE {
{ { SELECT DISTINCT ?file ?thing
WHERE {
?owner pim:storage ?root .
GRAPH ?file { ?thing ?property ?value }
FILTER (isIRI(?thing) && STRSTARTS(STR(?file), STR(?root)))
} }
BIND (false AS ?named)
BIND (EXISTS { ?file a cascade:View } AS ?rebuilt) }
UNION
{ { SELECT DISTINCT ?file ?thing
WHERE {
?owner pim:storage ?root .
GRAPH ?file { ?subject ?property ?thing }
FILTER (isIRI(?thing) && STRSTARTS(STR(?file), STR(?root)))
} }
BIND (true AS ?named)
BIND (EXISTS { ?file a cascade:View } AS ?rebuilt) }
}
ORDER BY ?thing ?rebuilt ?named ?file
The terms it uses: pim:storage, cascade:View.
Run it yourself, from the runtime's root:
npm run ask -- alex-rivera "pod/Which file states each thing"
It prints the rows for every thing; this block keeps those whose ?thing is
https://pod.alex-rivera.example/clinical/immunizations.ttl#b4e59f6dd44ac422142f1730ed4c5377db6560d42fe1fdbb6ae881aedd6d22aa.
Or in GraphDB, open the saved query pod/Which file states each thing in the repository alex-rivera.
What it shows
What each entry shows: every value its view states of it and every value its members' current versions state of the fields the view shows, each with From, the member whose current version states it, and Lead, whether that member is the entry's lead (cascade:leadMember), whose values come first. An entry is what an app shows: one allergy, one condition, one vaccination; no merged record is stored, so the view holds each member's current values as a node of its own (cascade:memberCurrentValues) and this reads the view alone. The view takes the entry's name and codes from its lead, and its status and dates from the members the derivations chose for them (cascade:statusFrom, cascade:dateFrom and, for a medication, cascade:medicationUseStartDateFrom, cascade:prescriptionWrittenDateFrom and cascade:dosageFrom, and for an allergy cascade:allergyCategoryFrom and cascade:onsetDateFrom). A value no member states, such as the highest criticality among them, has no From. A padded time is shown as the time, and a reference range as its text, its bounds being nodes of the view of their own; the node saying a time was written short of the second is no value of its own.
Only the rows whose ?entry is this one.
18 rows
The query: queries/questions/entry/What it shows.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entry ?entryLabel ?view ?field ?value ?valueLabel ?from ?fromLabel ?lead
WHERE {
{ GRAPH ?view { ?entry cascade:entryMember [] ; cascade:leadMember ?leader ; cascade:memberCurrentValues ?values .
?values cascade:valuesOfMember ?from ; ?field ?value .
FILTER (?field NOT IN (cascade:valuesOfMember, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh)) }
BIND (?from = ?leader AS ?lead)
OPTIONAL { ?from rdfs:label ?fromLabel }
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?value rdfs:label ?valueLabel } }
UNION
{ GRAPH ?view { ?entry cascade:entryMember [] ; ?field ?value
FILTER (?field NOT IN (cascade:memberCurrentValues, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh))
FILTER NOT EXISTS { ?entry cascade:memberCurrentValues ?held . ?held ?field ?value } }
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?value rdfs:label ?valueLabel } }
}
ORDER BY ?entryLabel ?entry ?field DESC(?lead) STR(?value) ?from
The terms it uses: cascade:entryMember, cascade:leadMember, cascade:memberCurrentValues, cascade:valuesOfMember, cascade:paddedDateTime, cascade:referenceRangeLow, cascade:referenceRangeHigh, rdfs:label.
Run it yourself, from the runtime's root:
npm run ask -- alex-rivera "entry/What it shows"
It prints the rows for every entry; this block keeps those whose ?entry is
https://pod.alex-rivera.example/clinical/immunizations.ttl#b4e59f6dd44ac422142f1730ed4c5377db6560d42fe1fdbb6ae881aedd6d22aa.
Or in GraphDB, open the saved query entry/What it shows in the repository alex-rivera.
What needs review
Entries a person should look at, and why: its members disagree on how severe an allergy is, the matcher joined it for two different reasons, two records judged different are still joined in it, a matcher's Same of two records now in two entries has lapsed (an open adopted newer tables or rules and did not file it again, so the pair it joined is apart until a person judges it), a finding of the matcher judgments a rule list version no longer reaches names a lapsed matcher judgment of two records now in two entries (listed as one line, the finding, expanding to its pairs, each with the matcher judgment of least IRI that names it, until a person judges the pair, or files an acknowledgement of that kind naming both its records and no other, which takes the pair off; a lapsed Same such a finding names is listed with it, never alone), or two of its conditions, in two entries, carry one code and their dates cannot tell whether they are one condition: either has no onset, or one has an unknown end (no abatement that is a date ending on or after its onset begins, and no status that keeps it going: active, recurrence or relapse) and its onset begins on or before the other's end, the other's period counted as the matcher's rule R8 counts it, each date read as the days its precision covers. A condition with an unknown end that began after the other's end is apart from it: the two are two episodes, not joined and not listed, as are two whose periods are both known and apart. Two medications in two entries that share an RxNorm code or an NDC are possibly the same medication: a pod cannot tell which shared code names a product, and the matcher's rule R11 has already joined every pair that shares one the held drug products table knows, so what is left is a pair sharing an ingredient, a strength, a dose form, a brand name or a salt, a pair of which one carries more than one product code (R11 leaves it out, as A with X, B with X and Y, C with Y), a code no held table knows, which is every shared RxNorm code when no drug products table is held, or, from the rule list's version 18, a pair of one product or one NDC whose exposure periods share no day, or of which one has no exposure start: two courses, or one course with a gap, which a person can tell apart and the dates cannot (decisions/medication-matching.md). A pair is listed once, from the entry of its smaller record, unless a person judged it different or a lapsed Same of it is listed already. An entry joined by an NDC (R5) and a product code (R11) alone is joined through one kind of sameness, since both are exact identity, and so is an entry joined by a grown note (R19), one note sent twice (R20) and one document identifier (R21) alone, since each says the members are one note; any other two justifications are two kinds, with any of these included. A join by a shared business identifier within one organization (R18) is certain, so it adds no kind: an entry it joins with one other rule is joined through that rule's kind alone. An entry the matcher joined by the same result on one day (R15) is listed with that Same: at least one of the two results was stamped with a day alone or a time its source wrote short of the second, and two draws in one day are common, so the join is likely, not sure. Two lab results in two entries of one test code at one instant whose values' units differ once their UCUM annotations are dropped are listed too, once, from the entry of the smaller record, unless a person judged them different: mmol/L and mg/dL may measure one draw, and no rule converts one into the other. A finding of different result values at one instant (R16) is listed, as the finding with its two results, while both are at the versions it compared, until a person files an acknowledgement of its kind naming the two results and no other, or judges them different. A finding of different values or units is not listed while R18 joins the two, as sharing a business identifier within one organization, and the current version of one of them says it was corrected or amended: the source said the second value is its correction. Two results R18 joins that neither marks so are still listed, since two channels of one organization disagreeing is for a person to see. The build never settles these itself; a person does, with a judgment.
Only the rows whose ?entry is this one.
| ?needs | ?finding | ?judgment | ?record | ?otherRecord |
|---|---|---|---|---|
| joined through two kinds of machine sameness |
1 row
The query: queries/questions/entry/What needs review.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX pav: <http://purl.org/pav/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?entry ?entryLabel ?needs ?finding ?judgment ?judgmentLabel ?record ?recordLabel ?otherRecord ?otherRecordLabel
WHERE {
{ { SELECT ?entry
WHERE {
?member ^cascade:entryMember ?entry ;
pav:hasCurrentVersion/cascade:allergyCriticality ?criticality .
}
GROUP BY ?entry
HAVING (COUNT(DISTINCT ?criticality) > 1) }
BIND ("members disagree on criticality" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel } }
UNION
{ { SELECT ?entry
WHERE {
?same cascade:countsUnderLens true ; cascade:verdict cascade:Same ; cascade:justification ?why ;
prov:wasAttributedTo/a prov:SoftwareAgent ; prov:hadMember ?member .
?member ^cascade:entryMember ?entry .
FILTER (?why != cascade:SameBusinessIdentifierAndTestCodeWithinOneOrganization)
}
GROUP BY ?entry
HAVING (COUNT(DISTINCT ?why) > 1
&& SUM(IF(?why IN (cascade:SameMedicationCode, cascade:SameProductCode), 0, 1)) > 0
&& SUM(IF(?why IN (cascade:SameNoteTypeAndTextGrownWithinOneOrganization, cascade:SameNoteTypeAndText,
cascade:SameNoteOrDocumentMasterIdentifier), 0, 1)) > 0) }
BIND ("joined through two kinds of machine sameness" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel } }
UNION
{ ?record cascade:currentlyDifferent ?otherRecord ; ^cascade:entryMember ?entry .
?otherRecord ^cascade:entryMember ?entry .
FILTER (STR(?record) < STR(?otherRecord))
BIND ("judged different, still joined" AS ?needs)
OPTIONAL { ?judgment cascade:countsUnderLens true ; cascade:verdict ?judgedVerdict ; prov:hadMember ?record , ?otherRecord
FILTER (?judgedVerdict = cascade:Different) }
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?judgment rdfs:label ?judgmentLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
UNION
{ { SELECT ?record ?otherRecord (MIN(STR(?lapsed)) AS ?first)
WHERE {
?lapsed cascade:lapsed true ; prov:hadMember ?record , ?otherRecord .
FILTER (STR(?record) < STR(?otherRecord))
FILTER NOT EXISTS { ?naming oa:hasBody cascade:MatcherJudgmentsNoLongerReached ; oa:hasTarget ?lapsed }
}
GROUP BY ?record ?otherRecord }
?judgment cascade:lapsed true ; prov:hadMember ?record , ?otherRecord .
?record ^cascade:entryMember ?entry .
?otherRecord ^cascade:entryMember ?otherEntry .
FILTER (STR(?judgment) = ?first && ?entry != ?otherEntry
&& !EXISTS { ?record cascade:currentlyDifferent ?otherRecord })
BIND ("joined before, apart under newer tables or rules" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?judgment rdfs:label ?judgmentLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
UNION
{ { { SELECT ?finding ?record ?otherRecord (MIN(STR(?lapsedJudgment)) AS ?first)
WHERE {
?finding oa:hasBody cascade:MatcherJudgmentsNoLongerReached ; oa:hasTarget ?lapsedJudgment .
?lapsedJudgment cascade:lapsed true ; prov:hadMember ?record , ?otherRecord .
FILTER (STR(?record) < STR(?otherRecord))
}
GROUP BY ?finding ?record ?otherRecord }
FILTER (BOUND(?first)) }
BIND (IRI(?first) AS ?judgment)
?record ^cascade:entryMember ?entry .
?otherRecord ^cascade:entryMember ?otherEntry .
FILTER (?entry != ?otherEntry
&& !EXISTS { ?record cascade:currentlyDifferent ?otherRecord })
MINUS { ?acknowledgement cascade:countsUnderLens true ; cascade:verdict cascade:Acknowledged ;
cascade:answersWarningOfKind cascade:MatcherJudgmentsNoLongerReached ;
prov:hadMember ?record , ?otherRecord .
FILTER NOT EXISTS { ?acknowledgement prov:hadMember ?third . FILTER (?third NOT IN (?record, ?otherRecord)) } }
BIND ("no longer joined under a newer rule list version" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?judgment rdfs:label ?judgmentLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
UNION
{
{ SELECT ?record ?entry ?property ?code ?dated ?from ?to ?open
WHERE {
VALUES ?property { cascade:conditionCode }
?record cascade:recordKind "Condition" ; pav:hasCurrentVersion ?version ; ^cascade:entryMember ?entry .
?version ?property ?code .
OPTIONAL { ?version cascade:displayDate ?onset }
OPTIONAL { ?version cascade:abatementDate ?end }
OPTIONAL { ?version cascade:clinicalStatus ?status }
BIND (IF(DATATYPE(?onset) = xsd:gYear, CONCAT(SUBSTR(STR(?onset), 1, 4), "-01-01"),
IF(DATATYPE(?onset) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?onset), 1, 7), "-01"), SUBSTR(STR(?onset), 1, 10))) AS ?from)
BIND (IF(DATATYPE(?onset) = xsd:gYear, CONCAT(SUBSTR(STR(?onset), 1, 4), "-12-31"),
IF(DATATYPE(?onset) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?onset), 1, 7), "-31"), SUBSTR(STR(?onset), 1, 10))) AS ?onsetTo)
BIND (IF(BOUND(?end) && isLiteral(?end) && DATATYPE(?end) IN (xsd:date, xsd:dateTime), SUBSTR(STR(?end), 1, 10),
IF(BOUND(?end) && isLiteral(?end) && DATATYPE(?end) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?end), 1, 7), "-31"),
IF(BOUND(?end) && isLiteral(?end) && DATATYPE(?end) = xsd:gYear, CONCAT(SUBSTR(STR(?end), 1, 4), "-12-31"), ""))) AS ?endTo)
BIND (COALESCE(?status, "") IN ("active", "recurrence", "relapse") AS ?keepsGoing)
BIND (BOUND(?onset) AS ?dated)
BIND (IF(?endTo != "" && ?endTo >= ?from, ?endTo, IF(?keepsGoing, "9999-12-31", ?onsetTo)) AS ?to)
BIND (!(?endTo != "" && ?endTo >= ?from) && !?keepsGoing AS ?open)
} }
{ SELECT ?otherRecord ?otherEntry ?property ?code ?otherDated ?otherFrom ?otherTo ?otherOpen
WHERE {
VALUES ?property { cascade:conditionCode }
?otherRecord cascade:recordKind "Condition" ; pav:hasCurrentVersion ?otherVersion ; ^cascade:entryMember ?otherEntry .
?otherVersion ?property ?code .
OPTIONAL { ?otherVersion cascade:displayDate ?otherOnset }
OPTIONAL { ?otherVersion cascade:abatementDate ?otherEnd }
OPTIONAL { ?otherVersion cascade:clinicalStatus ?otherStatus }
BIND (IF(DATATYPE(?otherOnset) = xsd:gYear, CONCAT(SUBSTR(STR(?otherOnset), 1, 4), "-01-01"),
IF(DATATYPE(?otherOnset) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?otherOnset), 1, 7), "-01"), SUBSTR(STR(?otherOnset), 1, 10))) AS ?otherFrom)
BIND (IF(DATATYPE(?otherOnset) = xsd:gYear, CONCAT(SUBSTR(STR(?otherOnset), 1, 4), "-12-31"),
IF(DATATYPE(?otherOnset) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?otherOnset), 1, 7), "-31"), SUBSTR(STR(?otherOnset), 1, 10))) AS ?otherOnsetTo)
BIND (IF(BOUND(?otherEnd) && isLiteral(?otherEnd) && DATATYPE(?otherEnd) IN (xsd:date, xsd:dateTime), SUBSTR(STR(?otherEnd), 1, 10),
IF(BOUND(?otherEnd) && isLiteral(?otherEnd) && DATATYPE(?otherEnd) = xsd:gYearMonth, CONCAT(SUBSTR(STR(?otherEnd), 1, 7), "-31"),
IF(BOUND(?otherEnd) && isLiteral(?otherEnd) && DATATYPE(?otherEnd) = xsd:gYear, CONCAT(SUBSTR(STR(?otherEnd), 1, 4), "-12-31"), ""))) AS ?otherEndTo)
BIND (COALESCE(?otherStatus, "") IN ("active", "recurrence", "relapse") AS ?otherKeepsGoing)
BIND (BOUND(?otherOnset) AS ?otherDated)
BIND (IF(?otherEndTo != "" && ?otherEndTo >= ?otherFrom, ?otherEndTo, IF(?otherKeepsGoing, "9999-12-31", ?otherOnsetTo)) AS ?otherTo)
BIND (!(?otherEndTo != "" && ?otherEndTo >= ?otherFrom) && !?otherKeepsGoing AS ?otherOpen)
} }
MINUS { ?record cascade:currentlyDifferent ?otherRecord }
FILTER (STR(?record) < STR(?otherRecord) && ?entry != ?otherEntry
&& (!?dated || !?otherDated || (?open && ?from <= ?otherTo) || (?otherOpen && ?otherFrom <= ?to)))
BIND ("same code, dates cannot tell" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
UNION
{ VALUES ?codeProperty { cascade:rxNormCode cascade:ndcCode }
?version ?codeProperty ?code .
?otherVersion ?codeProperty ?code .
?record cascade:recordKind "Medication" ; pav:hasCurrentVersion ?version ; ^cascade:entryMember ?entry .
?otherRecord cascade:recordKind "Medication" ; pav:hasCurrentVersion ?otherVersion ; ^cascade:entryMember ?otherEntry .
FILTER (STR(?record) < STR(?otherRecord) && ?entry != ?otherEntry)
MINUS { ?record cascade:currentlyDifferent ?otherRecord }
MINUS { ?lapsed cascade:lapsed true ; prov:hadMember ?record , ?otherRecord }
BIND ("possibly the same medication" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
UNION
{ ?judgment cascade:countsUnderLens true ; cascade:verdict cascade:Same ; cascade:justification cascade:SameResultOnOneDay ;
prov:hadMember ?member .
?member ^cascade:entryMember ?entry .
BIND ("joined on one day, with no time to tell two draws apart" AS ?needs)
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?judgment rdfs:label ?judgmentLabel } }
UNION
{ VALUES (?kind ?needs) {
(cascade:DifferentResultValuesAtOneInstant "one test at one instant, two values")
(cascade:DifferentResultUnitsAtOneInstant "one test at one instant, in units that differ")
}
?finding oa:hasBody ?kind ; oa:hasTarget ?record , ?otherRecord ; prov:wasDerivedFrom ?version , ?otherVersion .
?record pav:hasCurrentVersion ?version ; ^cascade:entryMember ?entry .
?otherRecord pav:hasCurrentVersion ?otherVersion .
FILTER (STR(?record) < STR(?otherRecord))
MINUS { ?record cascade:currentlyDifferent ?otherRecord }
MINUS { ?acknowledgement cascade:countsUnderLens true ; cascade:verdict cascade:Acknowledged ;
cascade:answersWarningOfKind ?kind ; prov:hadMember ?record , ?otherRecord .
FILTER NOT EXISTS { ?acknowledgement prov:hadMember ?third . FILTER (?third NOT IN (?record, ?otherRecord)) } }
MINUS { ?same cascade:countsUnderLens true ; cascade:verdict cascade:Same ; prov:hadMember ?record , ?otherRecord .
FILTER NOT EXISTS { ?same prov:wasAttributedTo/a prov:SoftwareAgent } }
MINUS { ?certain cascade:countsUnderLens true ; cascade:verdict cascade:Same ;
cascade:justification cascade:SameBusinessIdentifierAndTestCodeWithinOneOrganization ;
prov:hadMember ?record , ?otherRecord , ?corrected .
?corrected pav:hasCurrentVersion/cascade:workflowStatus ?status .
FILTER (?corrected IN (?record, ?otherRecord) && ?status IN ("corrected", "amended")) }
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?otherRecord rdfs:label ?otherRecordLabel } }
}
ORDER BY ?needs ?finding ?entryLabel ?entry ?judgment ?record ?otherRecord
The terms it uses: cascade:entryMember, pav:hasCurrentVersion, rdfs:label, cascade:countsUnderLens, cascade:verdict, cascade:Same, cascade:justification, prov:wasAttributedTo, prov:SoftwareAgent, prov:hadMember, cascade:SameBusinessIdentifierAndTestCodeWithinOneOrganization, cascade:SameMedicationCode, cascade:SameProductCode, cascade:SameNoteTypeAndTextGrownWithinOneOrganization, cascade:SameNoteTypeAndText, cascade:SameNoteOrDocumentMasterIdentifier, cascade:currentlyDifferent, cascade:Different, cascade:lapsed, oa:hasBody, oa:hasTarget, cascade:Acknowledged, cascade:answersWarningOfKind, cascade:conditionCode, cascade:recordKind, cascade:displayDate, cascade:abatementDate, cascade:clinicalStatus, cascade:rxNormCode, cascade:ndcCode, cascade:SameResultOnOneDay, prov:wasDerivedFrom.
Run it yourself, from the runtime's root:
npm run ask -- alex-rivera "entry/What needs review"
It prints the rows for every entry; this block keeps those whose ?entry is
https://pod.alex-rivera.example/clinical/immunizations.ttl#b4e59f6dd44ac422142f1730ed4c5377db6560d42fe1fdbb6ae881aedd6d22aa.
Or in GraphDB, open the saved query entry/What needs review in the repository alex-rivera.
Where it came from
For each member of an entry: when its current revision arrived, the import that brought it, and the document it was derived from, with each hospital that wrote or keeps that document and when it was retrieved. A record the person entered has no document.
Only the rows whose ?entry is this one.
| ?record | ?arrived | ?import | ?document | ?hospital | ?retrieved |
|---|---|---|---|---|---|
| Immunization · Influenza, seasonal · Meridian Health System · imm-flu-2025 Turtle | 2026-09-01 10:00 UTC | Apple Health export | Document · Meridian Health System · Immunization/imm-flu-2025 · retrieved 2026-09-01 Turtle | Meridian Health System | 2026-09-01 10:00 UTC |
| Immunization · Influenza, seasonal · Larkspur Valley Health · im-5501 Turtle | 2026-10-14 15:42 UTC | Apple Health export | Document · Larkspur Valley Health · Immunization/im-5501 · retrieved 2026-10-14 Turtle | Larkspur Valley Health | 2026-10-14 15:40 UTC |
| Immunization · Influenza, injectable, quadrivalent, preservative free · Larkspur Valley Health · lv-imm-301 Turtle | 2027-03-18 12:00 UTC | Apple Health export | Document · Larkspur Valley Health · Immunization/lv-imm-301 · retrieved 2027-03-18 Turtle | Larkspur Valley Health | 2027-03-18 12:00 UTC |
3 rows
The query: queries/questions/entry/Where it came from.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX pav: <http://purl.org/pav/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?entry ?entryLabel ?record ?recordLabel ?arrived ?import ?importLabel ?document ?documentLabel ?hospital ?retrieved
WHERE {
?record ^cascade:entryMember ?entry ; cascade:currentRevision ?revision .
?revision prov:generatedAtTime ?arrived .
OPTIONAL { ?entry rdfs:label ?entryLabel }
OPTIONAL { ?record rdfs:label ?recordLabel }
OPTIONAL { ?revision prov:wasGeneratedBy ?import .
OPTIONAL { ?import rdfs:label ?importLabel } }
OPTIONAL { ?revision prov:wasDerivedFrom ?document .
OPTIONAL { ?document rdfs:label ?documentLabel }
OPTIONAL { ?document pav:retrievedOn ?retrieved }
OPTIONAL { ?document prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } }
}
ORDER BY ?entryLabel ?entry ?arrived ?recordLabel ?record ?document ?hospital ?retrieved
The terms it uses: cascade:entryMember, cascade:currentRevision, prov:generatedAtTime, rdfs:label, prov:wasGeneratedBy, prov:wasDerivedFrom, pav:retrievedOn, prov:wasAttributedTo, pav:hasCurrentVersion.
Run it yourself, from the runtime's root:
npm run ask -- alex-rivera "entry/Where it came from"
It prints the rows for every entry; this block keeps those whose ?entry is
https://pod.alex-rivera.example/clinical/immunizations.ttl#b4e59f6dd44ac422142f1730ed4c5377db6560d42fe1fdbb6ae881aedd6d22aa.
Or in GraphDB, open the saved query entry/Where it came from in the repository alex-rivera.