Skip to content
Alpha: see what works today →
Menu

Entry

Procedure entry · Colonoscopy · 2026-08-19

https://pod.alex-rivera.example/clinical/procedures.ttl#231ed99c9f5f4560aacff4cad3013bd36d168676c8bfe3c4d470ac73a9b1d70d

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/labels.ttlfalsetrue
clinical/procedures.ttl pagefalsetrue

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/procedures.ttl#231ed99c9f5f4560aacff4cad3013bd36d168676c8bfe3c4d470ac73a9b1d70d.

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.

?view?field?value?from?lead
clinical/procedures.ttl pagerdf:typemedical procedure cascade:MedicalProcedure
clinical/procedures.ttl pageentry member cascade:entryMemberProcedure · Colonoscopy · Larkspur Valley Health · px-55120 Turtle
clinical/procedures.ttl pageentry member cascade:entryMemberProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtle
clinical/procedures.ttl pagelead member cascade:leadMember termProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtle
clinical/procedures.ttl pageprocedure code cascade:procedureCodeSNOMED CT 73761001Procedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtletrue
clinical/procedures.ttl pageprocedure code cascade:procedureCodeSNOMED CT 73761001Procedure · Colonoscopy · Larkspur Valley Health · px-55120 Turtlefalse
clinical/procedures.ttl pageprocedure date cascade:procedureDate2026-08-19Procedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtletrue
clinical/procedures.ttl pageprocedure date cascade:procedureDate2026-08-19Procedure · Colonoscopy · Larkspur Valley Health · px-55120 Turtlefalse
clinical/procedures.ttl pageprocedure name cascade:procedureNameColonoscopyProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtletrue
clinical/procedures.ttl pageprocedure name cascade:procedureNameColonoscopyProcedure · Colonoscopy · Larkspur Valley Health · px-55120 Turtlefalse
clinical/procedures.ttl pagestatus from cascade:statusFrom termProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtle
clinical/procedures.ttl pageworkflow status cascade:workflowStatuscompletedProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 Turtletrue
clinical/procedures.ttl pageworkflow status cascade:workflowStatuscompletedProcedure · Colonoscopy · Larkspur Valley Health · px-55120 Turtlefalse

13 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/procedures.ttl#231ed99c9f5f4560aacff4cad3013bd36d168676c8bfe3c4d470ac73a9b1d70d.

Or in GraphDB, open the saved query entry/What it shows in the repository alex-rivera.

What needs review: none. The question

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.

2 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/procedures.ttl#231ed99c9f5f4560aacff4cad3013bd36d168676c8bfe3c4d470ac73a9b1d70d.

Or in GraphDB, open the saved query entry/Where it came from in the repository alex-rivera.