Skip to content
Alpha: see what works today →
Menu

Alex Rivera

How this pod is laid out

A pod is a person's own store of data on a Solid server, at an address of its own: this one is at https://pod.alex-rivera.example/. It is a tree of files, and every file but the stored documents is Turtle, statements of the form subject property value. Everything on this site was asked of those files with SPARQL, and every section shows the question it asked: open The query under any answer to read it, and run it yourself.

records/
What each source told the pod, one folder per type. A record's own file says only what it is; each time its source sends it, a revision arrives in a file of its own, carrying a version, the content, in another.
provenance/
Where records came from: each source document, each import that brought documents in, and each time the person entered something themselves.
attachments/
The source documents' own bytes, such as a hospital's FHIR file, each named by the hash of its bytes.
judgments/
Decisions about records: that two are the same thing, that they differ, that one is wrong, or whose a patient profile is.
references/
The code tables the matcher compares codes with, one file per table and per version.
subject/
The person the pod is about.
clinical/
The views: one file per type, listing entries an app can show. The build writes them and can always write them again.
profile/, settings/, manifest.ttl
Solid's own files: the owner's profile, which names the pod's root and the preferences file; the preferences file, which names the type index; and the type index, which says which view lists each type. The build writes the type index from the pod's layout, beside the manifest, which says what built the pod.

Some folders have two-character folders inside them. Those only spread the files out, so no folder holds too many.

What each folder holds

49 rows

A file's folder is its address after the storage root the owner's profile names, and GRAPH ?file reads one file at a time. Each row is one folder, one type of thing its files describe, and how many of them. A two-character folder only spreads files out, so its files count toward the folder above it. A version states no type of its own, so in a records folder the row with no type stated is its versions. The labels file names nearly everything, and is left out here; so is a thing described in a folder other than its own, such as the owner in each judgment they made.

?folder?type?things
/pod manifest cascade:PodManifest1
/clinical/allergy or intolerance cascade:AllergyOrIntolerance4
/clinical/medical procedure cascade:MedicalProcedure2
/clinical/patient profile cascade:PatientProfile1
/clinical/problem or diagnosis cascade:ProblemOrDiagnosis4
/clinical/vaccination cascade:Vaccination1
/clinical/view cascade:View6
/judgments/SoftwareAgent prov:SoftwareAgent1
/judgments/judgment cascade:Judgment20
/judgments/assertions/matcher judgment assertion cascade:MatcherJudgmentAssertion10
/judgments/retractions/Activity prov:Activity2
/profile/Person prov:Person1
/profile/foaf:Person1
/provenance/activities/Activity prov:Activity3
/provenance/activities/SoftwareAgent prov:SoftwareAgent1
/provenance/activities/hand entry session cascade:HandEntrySession1
/provenance/activities/matcher run cascade:MatcherRun2
/provenance/activities/snapshot cascade:Snapshot3
/provenance/documents/Entity prov:Entity33
/provenance/imports/Activity prov:Activity6
/provenance/imports/SoftwareAgent prov:SoftwareAgent1
/provenance/imports/document import cascade:DocumentImport6
/provenance/imports/snapshot cascade:Snapshot6
/records/allergies/FragmentSelector oa:FragmentSelector12
/records/allergies/allergy or intolerance cascade:AllergyOrIntolerance10
/records/allergies/revision cascade:Revision13
/records/allergies/no type stated13
/records/conditions/FragmentSelector oa:FragmentSelector12
/records/conditions/problem or diagnosis cascade:ProblemOrDiagnosis9
/records/conditions/revision cascade:Revision12
/records/conditions/no type stated11
/records/immunizations/FragmentSelector oa:FragmentSelector4
/records/immunizations/revision cascade:Revision4
/records/immunizations/vaccination cascade:Vaccination4
/records/immunizations/no type stated4
/records/procedures/FragmentSelector oa:FragmentSelector4
/records/procedures/medical procedure cascade:MedicalProcedure4
/records/procedures/revision cascade:Revision4
/records/procedures/no type stated4
/records/servers/server cascade:Server3
/references/dcat:Dataset1
/references/Entity prov:Entity2
/references/reference series cascade:ReferenceSeries2
/references/no type stated20
/settings/pim:ConfigurationFile1
/settings/Type index solid:TypeIndex1
/settings/Type Registration solid:TypeRegistration6
/settings/solid:UnlistedDocument1
/subject/subject cascade:Subject1

49 rows

The query: queries/questions/pod/What each folder holds.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pim: <http://www.w3.org/ns/pim/space#>

SELECT ?folder ?type (COUNT(DISTINCT ?thing) AS ?things)
WHERE {
  { SELECT DISTINCT ?file ?thing ?root
    WHERE {
      ?owner pim:storage ?root .
      GRAPH ?file { ?thing ?property ?value }
      FILTER (isIRI(?thing) && STRSTARTS(STR(?file), STR(?root)))
    } }
  OPTIONAL { GRAPH ?file { ?thing a ?stated } }
  BIND (CONCAT("/", REPLACE(STRAFTER(STR(?file), STR(?root)), "([0-9a-f]{2}/)?[^/]*$", "")) AS ?folder)
  BIND (COALESCE(?stated, "no type stated") AS ?type)
  FILTER (BOUND(?stated) || NOT EXISTS { ?file a cascade:View })
  FILTER (!STRSTARTS(STR(?thing), STR(?root)) || STRSTARTS(STR(?thing), CONCAT(STR(?root), SUBSTR(?folder, 2))))
}
GROUP BY ?folder ?type
ORDER BY ?folder ?type

The terms it uses: pim:storage, cascade:View.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/What each folder holds"

Or in GraphDB, open the saved query pod/What each folder holds in the repository alex-rivera.

The views

An app does not read records. It reads a view: one file per type, whose entries each join the records judged to be the same thing. How a view is built shows each step from records to views, and Not shown lists the records no view shows, and why.

Which view lists each kind

5 rows

An app finds a Solid pod's data through its type index: each registration names a type and the file that lists things of that type. Here each of those files is a view, and the entries are the things it lists. A view is never edited by hand; the build writes it from the records and the judgments.

5 rows

The query: queries/questions/pod/Which view lists each kind.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX solid: <http://www.w3.org/ns/solid/terms#>

SELECT ?title ?type ?view (COUNT(DISTINCT ?entry) AS ?entries)
WHERE {
  ?registration a solid:TypeRegistration ; solid:forClass ?type ; solid:instance ?view ; dct:title ?title .
  OPTIONAL { ?entry a ?type ; cascade:entryMember [] }
}
GROUP BY ?title ?type ?view
ORDER BY ?title ?view

The terms it uses: solid:TypeRegistration, solid:forClass, solid:instance, dct:title, cascade:entryMember.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/Which view lists each kind"

Or in GraphDB, open the saved query pod/Which view lists each kind in the repository alex-rivera.

Questions about the whole pod

Each record, entry, judgment and patient profile has a page of its own with the questions about it. These are the questions about the pod as a whole.

How many of each kind

30 rows

How many things of each type the pod's files state. Records and entries share a type, so an allergy or intolerance counts both the allergies each source sent and the entries the allergies view joins them into. GRAPH ?file reads one file at a time, and only files under the storage root count: a type only the derivations state, such as cascade:Record, is in the derived state's own graph and is left out.

30 rows

The query: queries/questions/pod/How many of each kind.rq on GitHub
PREFIX pim: <http://www.w3.org/ns/pim/space#>

SELECT ?type (COUNT(DISTINCT ?thing) AS ?things)
WHERE {
  GRAPH ?file { ?thing a ?type }
  ?owner pim:storage ?root .
  FILTER (STRSTARTS(STR(?file), STR(?root)))
}
GROUP BY ?type
ORDER BY ?type

The terms it uses: pim:storage.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/How many of each kind"

Or in GraphDB, open the saved query pod/How many of each kind in the repository alex-rivera.

My active allergies

4 rows

Read from the view alone, as an app would: each entry whose status is active, or that no document gives a status (its status then reads "not stated"), with its code, its criticality, its category and onset as its lead states them, else as the members chosen for them do, how many records it joins, what each record states of the reaction, and each record it joins, with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it. A record's reactions are its reaction texts, then its reaction codes in parentheses, then its severity, each as the record's current values state them, so a record that is not the entry's lead is read as much as the lead. A list holds its values in order, separated by U+001F, a record stating none of them is left out, and a list with nothing in it is unbound; a value's own parts are ended by ", ".

?allergenName?code?criticality?status?category?onset?reactionsByRecord?records?entry?sources
LatexSNOMED CT 111088007lowactiveenvironmenturn:uuid:b28ee795-dd4b-8fae-95cb-fe95c9a908cd Contact dermatitis1Allergy entry · Latexurn:uuid:b28ee795-dd4b-8fae-95cb-fe95c9a908cd from ni:///sha-256;KhxSx-TIKeJLC0RLZBluu78zuUIk67LG7SRAjvIL3Bc, retrieved 2026-11-20T09:00:00Z, written by Meridian Health System
Peanutshighnot statedurn:uuid:1cf6cca9-1098-8ca1-9155-ad7048360146 Anaphylaxis1Allergy entry · Peanutsurn:uuid:1cf6cca9-1098-8ca1-9155-ad7048360146
PenicillinSNOMED CT 373270004highactivemedication2019-06-14urn:uuid:0f282f2d-4ceb-897a-bdb8-750d6e25db2d Hivesurn:uuid:58e34d36-550a-882e-b43a-9225dbdce037 Hivesurn:uuid:69961a65-6383-84b7-96f1-0a88fb755c9c Hives3Allergy entry · Penicillinurn:uuid:0f282f2d-4ceb-897a-bdb8-750d6e25db2d from ni:///sha-256;QikKI44xZW8VbEs_UoN0xtF7wzhrF4TqXE2vwyoQTnw, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Healthurn:uuid:58e34d36-550a-882e-b43a-9225dbdce037 from ni:///sha-256;PHGfdoVLMSugnCba9doA7_kfDyJ32abX9loelLpSZDQ, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Healthurn:uuid:69961a65-6383-84b7-96f1-0a88fb755c9c from ni:///sha-256;KTBUa0_qvJ_3g2Vz7C4my_-C-9jkahpzl8IOoJ4Bchs, retrieved 2026-09-01T10:00:00Z, written by Meridian Health System
SulfamethoxazoleRxNorm 10180highactivemedication2022-05-03urn:uuid:5a16d5f4-34b0-8fb6-9f5c-59b37aa6d4dc Itching, Rashurn:uuid:828f3452-da1d-83e7-9fd4-23f49d355848 Hivesurn:uuid:b0492421-a1b7-8de4-817e-8940bf97f7df Hives3Allergy entry · Sulfamethoxazoleurn:uuid:5a16d5f4-34b0-8fb6-9f5c-59b37aa6d4dc from ni:///sha-256;aR9fwxPZ7i91Kw5BYYU_04tPlRZ3tAGAF_hMLFE7vBY, retrieved 2026-11-20T09:00:00Z, written by Meridian Health Systemurn:uuid:828f3452-da1d-83e7-9fd4-23f49d355848 from ni:///sha-256;4In_oVrmJrT2srA1AoevBN_tcXIim5nfwyGNV_erII8, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Healthurn:uuid:b0492421-a1b7-8de4-817e-8940bf97f7df from ni:///sha-256;Nzy98Fl4yOkQKqm5dNA_GBNn1TAlLc98ehXPsXYwG8A, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Health

4 rows

The query: queries/questions/pod/My active allergies.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 ?allergenName ?code ?criticality ?status ?category ?onset ?reactionsByRecord (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?memberText, "\u001F"), ""); separator=""), "\u001F$", "") AS ?allReactions)
    WHERE {
      { SELECT ?entry ?memberText
        WHERE {
          { SELECT ?entry ?member (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?reactionText, ", "), ""); separator=""), ", $", "") AS ?texts)
            WHERE {
              { SELECT ?entry ?member ?reactionText
                WHERE {
                  ?entry a cascade:AllergyOrIntolerance ; cascade:memberCurrentValues ?textValues .
                  FILTER NOT EXISTS { ?entry cascade:clinicalStatus ?other FILTER (?other != "active") }
                  ?textValues cascade:valuesOfMember ?member .
                  OPTIONAL { ?textValues cascade:reactionManifestationText ?reactionText }
                }
                ORDER BY ?entry ?member ?reactionText }
            }
            GROUP BY ?entry ?member }
          { SELECT ?entry ?member (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(STR(?memberCode), ", "), ""); separator=""), ", $", "") AS ?codes)
            WHERE {
              { SELECT ?entry ?member ?memberCode
                WHERE {
                  ?entry a cascade:AllergyOrIntolerance ; cascade:memberCurrentValues ?codeValues .
                  FILTER NOT EXISTS { ?entry cascade:clinicalStatus ?other FILTER (?other != "active") }
                  ?codeValues cascade:valuesOfMember ?member .
                  OPTIONAL { ?codeValues cascade:reactionManifestationCode ?memberCode }
                }
                ORDER BY ?entry ?member ?memberCode }
            }
            GROUP BY ?entry ?member }
          ?entry cascade:memberCurrentValues ?severityValues .
          ?severityValues cascade:valuesOfMember ?member .
          OPTIONAL { ?severityValues cascade:allergySeverity ?memberSeverity }
          BIND (IF(?texts = "" && ?codes = "" && !BOUND(?memberSeverity), 1/0,
                   CONCAT(STR(?member),
                          IF(?texts = "", "", CONCAT(" ", ?texts)),
                          IF(?codes = "", "", CONCAT(" (", ?codes, ")")),
                          COALESCE(CONCAT(", ", ?memberSeverity), ""))) AS ?memberText)
        }
        ORDER BY ?entry ?memberText }
    }
    GROUP BY ?entry }
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
    WHERE {
      { SELECT ?entry ?sourceText
        WHERE {
          { SELECT ?entry ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?entry a cascade:AllergyOrIntolerance ; cascade:entryMember ?sourceRecord .
                  FILTER NOT EXISTS { ?entry cascade:clinicalStatus ?other FILTER (?other != "active") }
                  OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                             OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                             OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                        ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                        FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                        OPTIONAL { ?agent rdfs:label ?agentLabel }
                                        OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                        BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                     COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                }
                ORDER BY ?entry ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?entry ?sourceText }
    }
    GROUP BY ?entry }
  ?entry a cascade:AllergyOrIntolerance ;
         cascade:allergenName ?allergenName ; cascade:entryMember ?record .
  OPTIONAL { ?entry cascade:clinicalStatus ?stated }
  FILTER (!BOUND(?stated) || ?stated = "active")
  OPTIONAL { ?entry cascade:allergenCode ?code }
  OPTIONAL { ?entry cascade:allergyCriticality ?criticality }
  OPTIONAL { ?entry cascade:allergyCategory ?category }
  OPTIONAL { ?entry cascade:onsetDate ?onset }
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  BIND (COALESCE(?stated, "not stated") AS ?status)
  BIND (IF(?allReactions = "", 1/0, ?allReactions) AS ?reactionsByRecord)
}
GROUP BY ?entry ?allergenName ?code ?criticality ?status ?category ?onset ?reactionsByRecord ?entryLabel ?sources
ORDER BY ?allergenName ?entry ?code

The terms it uses: cascade:AllergyOrIntolerance, cascade:memberCurrentValues, cascade:clinicalStatus, cascade:valuesOfMember, cascade:reactionManifestationText, cascade:reactionManifestationCode, cascade:allergySeverity, cascade:entryMember, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion, cascade:allergenName, cascade:allergenCode, cascade:allergyCriticality, cascade:allergyCategory, cascade:onsetDate.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/My active allergies"

Or in GraphDB, open the saved query pod/My active allergies in the repository alex-rivera.

My active conditions

3 rows

Read from the view alone, as an app would: each entry whose status is active and not ruled out, so not one whose status was taken from a refuted record (`pod/My condition history` lists those), with its codes, its onset, each entry of a medication, procedure or vaccination a record of which was given for one of its records, once, as "<entry>, <name>" (the entry IRI alone when it has no name; the entry IRI holds no ", ", so the first ", " ends it and the name, which may hold anything, is the rest; none when no record names one; not an entry of a medication its source marked entered in error), in code point order of name (an entry with no name first), then entry, how many records it joins, and each record with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it. A list holds its values in order, separated by U+001F, a value's own parts by ", ". Its code is the code IRI the entry states, in whichever listed system, the first in code point order when it states several, so that each entry is one row.

?condition?conditionCode?onset?entriesForIt?records?entry?sources
AsthmaSNOMED CT 1959670012008-09-012Condition entry · Asthma · 2008-09-01urn:uuid:3719cb66-c5be-8fac-a0bf-a6db7573fe71 from ni:///sha-256;JrahuZoHwbTA6XHjL2ULjX9vetTQjTNZFxr4LLytgqg, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Healthurn:uuid:fdf1589d-bc02-8c0f-8874-4d377574cc8d from ni:///sha-256;5kn5zMwKLefLlu2hz3EIBOHJv9XyGZvXlkp1ZH0pi5I, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Health
Essential hypertensionSNOMED CT 383410032021-04-023Condition entry · Essential hypertension · 2021-04-02urn:uuid:173c9663-2406-8025-843b-5f9b19c1b9f3 from ni:///sha-256;qryk4MG3hAJwf6mUdbw9UDLh84cFcozYJ3uA8qJmdKU, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Healthurn:uuid:e3889c3a-faa3-8a4f-a9f6-84d1dd1d85a4 from ni:///sha-256;aRA8S5IYHGF9i7_EnT7Z741PL7GXrlEpgr-uMxFK6jY, retrieved 2026-09-01T10:00:00Z, written by Meridian Health Systemurn:uuid:fb6ea0ec-3fbb-865c-a044-01b708d547f1 from ni:///sha-256;Cz5MtRwIZdqPndcnbRHYmSyV0ifFlAvMwatkhsAD_ho, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Health
Low back painSNOMED CT 2790390072026-06-011Condition entry · Low back pain · 2026-06-01urn:uuid:fc149b2f-bf16-816b-8beb-04ccaff3eade from ni:///sha-256;EFb7AR24q2Lv88l_MdKSLxswBox0YR9tZBjaCH9Rn8Q, retrieved 2027-08-20T08:00:00Z, written by Meridian Health System

3 rows

The query: queries/questions/pod/My active conditions.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 ?condition ?conditionCode ?onset ?entriesForIt (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT ?forLine; separator=""), "\u001F$", "") AS ?forIt)
    WHERE {
      { SELECT ?entry ?forLine
        WHERE {
          ?entry a cascade:ProblemOrDiagnosis ; cascade:entryMember ?conditionRecord .
          OPTIONAL { ?forValues cascade:reasonCondition ?conditionRecord .
                     ?forEntry cascade:memberCurrentValues ?forValues .
                     OPTIONAL { ?forEntry cascade:drugName ?drugName }
                     OPTIONAL { ?forEntry cascade:procedureName ?procedureName }
                     OPTIONAL { ?forEntry cascade:vaccineName ?vaccineName }
                     FILTER NOT EXISTS { ?forEntry cascade:lifecycle cascade:MedicationEnteredInError } }
          BIND (COALESCE(?drugName, ?procedureName, ?vaccineName) AS ?forName)
          BIND (IF(BOUND(?forEntry), CONCAT(STR(?forEntry), COALESCE(CONCAT(", ", ?forName), ""), "\u001F"), "") AS ?forLine)
        }
        ORDER BY ?entry ?forName ?forEntry }
    }
    GROUP BY ?entry }
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
    WHERE {
      { SELECT ?entry ?sourceText
        WHERE {
          { SELECT ?entry ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?entry a cascade:ProblemOrDiagnosis ; cascade:clinicalStatus "active" ; cascade:entryMember ?sourceRecord .
                  FILTER NOT EXISTS { ?entry cascade:verificationStatus "refuted" }
                  OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                             OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                             OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                        ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                        FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                        OPTIONAL { ?agent rdfs:label ?agentLabel }
                                        OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                        BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                     COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                }
                ORDER BY ?entry ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?entry ?sourceText }
    }
    GROUP BY ?entry }
  ?entry a cascade:ProblemOrDiagnosis ; cascade:clinicalStatus "active" ;
         cascade:conditionName ?condition ; cascade:entryMember ?record .
  FILTER NOT EXISTS { ?entry cascade:verificationStatus "refuted" }
  OPTIONAL {
    ?entry cascade:conditionCode ?conditionCode .
    FILTER NOT EXISTS {
      ?entry cascade:conditionCode ?earlier .
      FILTER (STR(?earlier) < STR(?conditionCode))
    }
  }
  OPTIONAL { ?entry cascade:onsetDate ?onset }
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  BIND (IF(?forIt = "", ?nothing, ?forIt) AS ?entriesForIt)
}
GROUP BY ?entry ?condition ?conditionCode ?onset ?entriesForIt ?entryLabel ?sources
ORDER BY ?condition ?entry

The terms it uses: cascade:ProblemOrDiagnosis, cascade:entryMember, cascade:reasonCondition, cascade:memberCurrentValues, cascade:drugName, cascade:procedureName, cascade:vaccineName, cascade:lifecycle, cascade:clinicalStatus, cascade:verificationStatus, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion, cascade:conditionName, cascade:conditionCode, cascade:onsetDate.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/My active conditions"

Or in GraphDB, open the saved query pod/My active conditions in the repository alex-rivera.

My active medications: none. The question

My condition history

4 rows

Read from the view alone, as an app would: each condition entry whatever its status, with its codes, its status, when it started and when it ended, each record's own status, each entry given for it as `pod/My active conditions` lists them ("<entry>, <name>", the entry IRI alone when it has no name, in code point order of name, then entry, and with a medication entered in error left out), how many records it joins, and each record with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it. The status is "ruled out" when the record the entry took its status from is refuted, whatever its clinical status, so a condition that was considered and refuted is never read as one that resolved; otherwise it is that record's clinical status, or none when it states none, and an entry ruled out has no abatement day. The verification status is as the source writes it. The entries whose status is active and not ruled out are the ones `pod/My active conditions` lists. A record's own status is its clinical status, "ruled out" alone when it is refuted; the day it abated follows a clinical status, never "ruled out". A list holds its values in order, separated by U+001F; a value's own parts are ended by ", ". Its code is the code IRI the entry states, in whichever listed system, the first in code point order when it states several, so that each entry is one row.

?condition?conditionCode?status?verificationStatus?onset?abated?statuses?entriesForIt?records?entry?sources
Acute bronchitisSNOMED CT 10509002resolvedconfirmed2026-08-122026-09-20urn:uuid:427f6a98-faf9-8e37-bd5d-6dca2a812580 resolved, abated 2026-09-201Condition entry · Acute bronchitis · 2026-08-12urn:uuid:427f6a98-faf9-8e37-bd5d-6dca2a812580 from ni:///sha-256;bX2lWmFFhM9GXagC-zoAMoV_w_8c4PxXI2u3y35J8aI, retrieved 2026-11-20T09:00:00Z, written by Meridian Health System
AsthmaSNOMED CT 195967001activeconfirmed2008-09-01urn:uuid:3719cb66-c5be-8fac-a0bf-a6db7573fe71 activeurn:uuid:fdf1589d-bc02-8c0f-8874-4d377574cc8d active2Condition entry · Asthma · 2008-09-01urn:uuid:3719cb66-c5be-8fac-a0bf-a6db7573fe71 from ni:///sha-256;JrahuZoHwbTA6XHjL2ULjX9vetTQjTNZFxr4LLytgqg, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Healthurn:uuid:fdf1589d-bc02-8c0f-8874-4d377574cc8d from ni:///sha-256;5kn5zMwKLefLlu2hz3EIBOHJv9XyGZvXlkp1ZH0pi5I, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Health
Essential hypertensionSNOMED CT 38341003activeconfirmed2021-04-02urn:uuid:173c9663-2406-8025-843b-5f9b19c1b9f3 activeurn:uuid:e3889c3a-faa3-8a4f-a9f6-84d1dd1d85a4 activeurn:uuid:fb6ea0ec-3fbb-865c-a044-01b708d547f1 active3Condition entry · Essential hypertension · 2021-04-02urn:uuid:173c9663-2406-8025-843b-5f9b19c1b9f3 from ni:///sha-256;qryk4MG3hAJwf6mUdbw9UDLh84cFcozYJ3uA8qJmdKU, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Healthurn:uuid:e3889c3a-faa3-8a4f-a9f6-84d1dd1d85a4 from ni:///sha-256;aRA8S5IYHGF9i7_EnT7Z741PL7GXrlEpgr-uMxFK6jY, retrieved 2026-09-01T10:00:00Z, written by Meridian Health Systemurn:uuid:fb6ea0ec-3fbb-865c-a044-01b708d547f1 from ni:///sha-256;Cz5MtRwIZdqPndcnbRHYmSyV0ifFlAvMwatkhsAD_ho, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Health
Low back painSNOMED CT 279039007activeconfirmed2026-06-01urn:uuid:fc149b2f-bf16-816b-8beb-04ccaff3eade active1Condition entry · Low back pain · 2026-06-01urn:uuid:fc149b2f-bf16-816b-8beb-04ccaff3eade from ni:///sha-256;EFb7AR24q2Lv88l_MdKSLxswBox0YR9tZBjaCH9Rn8Q, retrieved 2027-08-20T08:00:00Z, written by Meridian Health System

4 rows

The query: queries/questions/pod/My condition history.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 ?condition ?conditionCode ?status ?verificationStatus ?onset ?abated ?statuses ?entriesForIt
       (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT ?forLine; separator=""), "\u001F$", "") AS ?forIt)
    WHERE {
      { SELECT ?entry ?forLine
        WHERE {
          ?entry a cascade:ProblemOrDiagnosis ; cascade:entryMember ?conditionRecord .
          OPTIONAL { ?forValues cascade:reasonCondition ?conditionRecord .
                     ?forEntry cascade:memberCurrentValues ?forValues .
                     OPTIONAL { ?forEntry cascade:drugName ?drugName }
                     OPTIONAL { ?forEntry cascade:procedureName ?procedureName }
                     OPTIONAL { ?forEntry cascade:vaccineName ?vaccineName }
                     FILTER NOT EXISTS { ?forEntry cascade:lifecycle cascade:MedicationEnteredInError } }
          BIND (COALESCE(?drugName, ?procedureName, ?vaccineName) AS ?forName)
          BIND (IF(BOUND(?forEntry), CONCAT(STR(?forEntry), COALESCE(CONCAT(", ", ?forName), ""), "\u001F"), "") AS ?forLine)
        }
        ORDER BY ?entry ?forName ?forEntry }
    }
    GROUP BY ?entry }
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?statusText, "\u001F"); separator=""), "\u001F$", "") AS ?statuses)
    WHERE {
      { SELECT ?entry ?statusText
        WHERE {
          ?entry a cascade:ProblemOrDiagnosis ; cascade:memberCurrentValues ?values .
          ?values cascade:valuesOfMember ?member .
          OPTIONAL { ?values cascade:clinicalStatus ?memberClinicalStatus }
          OPTIONAL { ?values cascade:verificationStatus ?memberVerificationStatus }
          OPTIONAL { ?values cascade:abatementDate ?memberAbated }
          BIND (BOUND(?memberVerificationStatus) && ?memberVerificationStatus = "refuted" AS ?memberRuledOut)
          BIND (CONCAT(STR(?member), " ",
                       IF(?memberRuledOut, "ruled out", COALESCE(?memberClinicalStatus, "with no status")),
                       IF(?memberRuledOut, "", COALESCE(CONCAT(", abated ", STR(?memberAbated)), ""))) AS ?statusText)
        }
        ORDER BY ?entry ?statusText }
    }
    GROUP BY ?entry }
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
    WHERE {
      { SELECT ?entry ?sourceText
        WHERE {
          { SELECT ?entry ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?entry a cascade:ProblemOrDiagnosis ; cascade:entryMember ?sourceRecord .
                  OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                             OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                             OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                        ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                        FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                        OPTIONAL { ?agent rdfs:label ?agentLabel }
                                        OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                        BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                     COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                }
                ORDER BY ?entry ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?entry ?sourceText }
    }
    GROUP BY ?entry }
  ?entry a cascade:ProblemOrDiagnosis ; cascade:conditionName ?condition ; cascade:entryMember ?record .
  OPTIONAL { ?entry cascade:clinicalStatus ?clinicalStatus }
  OPTIONAL { ?entry cascade:verificationStatus ?verificationStatus }
  OPTIONAL {
    ?entry cascade:conditionCode ?conditionCode .
    FILTER NOT EXISTS {
      ?entry cascade:conditionCode ?earlier .
      FILTER (STR(?earlier) < STR(?conditionCode))
    }
  }
  OPTIONAL { ?entry cascade:onsetDate ?onset }
  OPTIONAL { ?entry cascade:abatementDate ?abated
             FILTER NOT EXISTS { ?entry cascade:verificationStatus "refuted" } }
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  BIND (IF(BOUND(?verificationStatus) && ?verificationStatus = "refuted", "ruled out", ?clinicalStatus) AS ?status)
  BIND (IF(?forIt = "", ?nothing, ?forIt) AS ?entriesForIt)
}
GROUP BY ?entry ?condition ?conditionCode ?status ?verificationStatus ?onset ?abated ?entryLabel ?statuses ?entriesForIt ?sources
ORDER BY ?condition ?entry

The terms it uses: cascade:ProblemOrDiagnosis, cascade:entryMember, cascade:reasonCondition, cascade:memberCurrentValues, cascade:drugName, cascade:procedureName, cascade:vaccineName, cascade:lifecycle, cascade:valuesOfMember, cascade:clinicalStatus, cascade:verificationStatus, cascade:abatementDate, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion, cascade:conditionName, cascade:conditionCode, cascade:onsetDate.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/My condition history"

Or in GraphDB, open the saved query pod/My condition history in the repository alex-rivera.

My genetic variants: none. The question

My immunizations

1 row

Read from the view alone, as an app would, newest first by the date as written, so a year follows its months and days, with how many records each entry joins, each CVX code the entry states, a row for each, and each record it joins with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it, in order, separated by U+001F, its own parts by ", ". Times written with a zone are ordered by their wall time as written, not as instants: 23:00-05:00 sorts before 01:00Z the next day, though it is later.

?given?vaccine?code?status?records?entry?sources
2025-10-15Influenza, injectable, quadrivalent, preservative freeCVX 150completed3Immunization entry · Influenza, injectable, quadrivalent, preservative free · 2025-10-15urn:uuid:7d77d9e0-5457-86f2-8d9d-827c65c11b21 from ni:///sha-256;P6xPAvjVjqgUn9UXSeFZnWc52vDAAQZnCfb5xytEMFQ, retrieved 2026-09-01T10:00:00Z, written by Meridian Health Systemurn:uuid:7e3decf1-6e9a-8e95-b982-c2e7d18be3f1 from ni:///sha-256;LVAYE3hro7inQx9KKeCT54MbpvAkcQihcjALweOmbNI, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Healthurn:uuid:c0a85df6-e2ef-85a1-ac62-b6b454bac0c5 from ni:///sha-256;ssSLEj6SMsYuwpHfAjdgeqmUMA75jzmwX_4oimVUuyM, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Health

1 row

The query: queries/questions/pod/My immunizations.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 ?given ?vaccine ?code ?status (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
    WHERE {
      { SELECT ?entry ?sourceText
        WHERE {
          { SELECT ?entry ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?entry a cascade:Vaccination ; cascade:entryMember ?sourceRecord .
                  OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                             OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                             OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                        ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                        FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                        OPTIONAL { ?agent rdfs:label ?agentLabel }
                                        OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                        BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                     COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                }
                ORDER BY ?entry ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?entry ?sourceText }
    }
    GROUP BY ?entry }
  ?entry a cascade:Vaccination ; cascade:entryMember ?record .
  OPTIONAL { ?entry cascade:vaccinationOccurrenceTime ?given }
  OPTIONAL { ?entry cascade:vaccineName ?vaccine }
  OPTIONAL { ?entry cascade:vaccineCode ?code }
  OPTIONAL { ?entry cascade:workflowStatus ?status }
  OPTIONAL { ?entry rdfs:label ?entryLabel }
}
GROUP BY ?entry ?given ?vaccine ?code ?status ?entryLabel ?sources
ORDER BY DESC(COALESCE(STR(?given), "")) ?vaccine ?entry ?code

The terms it uses: cascade:Vaccination, cascade:entryMember, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion, cascade:vaccinationOccurrenceTime, cascade:vaccineName, cascade:vaccineCode, cascade:workflowStatus.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/My immunizations"

Or in GraphDB, open the saved query pod/My immunizations in the repository alex-rivera.

My lab results: none. The question

My medication history: none. The question

My procedures

2 rows

Read from the view alone, as an app would, newest first by the date as written, so a year follows its months and days, with how many records each entry joins, its code IRI, the first in code point order when it states several, the text each record's source wrote for it, such as the finding beside a screening (none when no record has one), and each record it joins with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it, in order, separated by U+001F, its own parts by ", ". Times written with a zone are ordered by their wall time as written, not as instants: 23:00-05:00 sorts before 01:00Z the next day, though it is later.

?performed?procedure?procedureCode?status?narrativeTexts?records?entry?sources
2026-08-19ColonoscopySNOMED CT 73761001completed2Procedure entry · Colonoscopy · 2026-08-19urn:uuid:7a11ba0d-eaa3-881d-a511-1f2ee8b8b0e9 from ni:///sha-256;ltngd2O05L-Jeq4u_dBI2rxpRUzXYj-ZiNpjJO9doV0, retrieved 2026-10-14T15:40:00Z, written by Larkspur Valley Healthurn:uuid:cfe67786-af77-8fb0-8c99-3d9faedcf182 from ni:///sha-256;Kl2jU5ZSxb7vZ9IYZT4E7Cs6tP8AmSBqqKD8yXCICdM, retrieved 2027-03-18T12:00:00Z, written by Larkspur Valley Health
2025-02-18ColonoscopySNOMED CT 73761001completed1Procedure entry · Colonoscopy · 2025-02-18urn:uuid:c6f34248-0b58-8e8a-8e52-f426d1a8be5c from ni:///sha-256;SPGEJSdaOinAgDgw_i4ycahIFdhqFfdqb9G_YFrU6RA, retrieved 2026-09-01T10:00:00Z, written by Meridian Health System

2 rows

The query: queries/questions/pod/My procedures.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 ?performed ?procedure ?procedureCode ?status ?narrativeTexts (COUNT(?record) AS ?records) ?entry ?entryLabel ?sources
WHERE {
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT ?narrativeLine; separator=""), "\u001F$", "") AS ?said)
    WHERE {
      { SELECT ?entry ?narrativeLine
        WHERE {
          ?entry a cascade:MedicalProcedure ; cascade:memberCurrentValues ?values .
          ?values cascade:valuesOfMember ?member .
          OPTIONAL { ?values cascade:narrativeText ?memberNarrativeText }
          BIND (IF(BOUND(?memberNarrativeText), CONCAT(STR(?member), " ", ?memberNarrativeText, "\u001F"), "") AS ?narrativeLine)
        }
        ORDER BY ?entry ?narrativeLine }
    }
    GROUP BY ?entry }
  { SELECT ?entry (REPLACE(GROUP_CONCAT(DISTINCT CONCAT(?sourceText, "\u001F"); separator=""), "\u001F$", "") AS ?sources)
    WHERE {
      { SELECT ?entry ?sourceText
        WHERE {
          { SELECT ?entry ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?entry ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?entry a cascade:MedicalProcedure ; cascade:entryMember ?sourceRecord .
                  OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                             OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                             OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                        ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                        FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                        OPTIONAL { ?agent rdfs:label ?agentLabel }
                                        OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                        BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                     COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                }
                ORDER BY ?entry ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?entry ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?entry ?sourceText }
    }
    GROUP BY ?entry }
  ?entry a cascade:MedicalProcedure ; cascade:entryMember ?record .
  OPTIONAL { ?entry cascade:procedureDate ?performed }
  OPTIONAL { ?entry cascade:procedureName ?procedure }
  OPTIONAL {
    ?entry cascade:procedureCode ?procedureCode .
    FILTER NOT EXISTS {
      ?entry cascade:procedureCode ?earlier .
      FILTER (STR(?earlier) < STR(?procedureCode))
    }
  }
  OPTIONAL { ?entry cascade:workflowStatus ?status }
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  BIND (IF(?said = "", ?nothing, ?said) AS ?narrativeTexts)
}
GROUP BY ?entry ?performed ?procedure ?procedureCode ?status ?narrativeTexts ?entryLabel ?sources
ORDER BY DESC(COALESCE(STR(?performed), "")) ?procedure ?entry

The terms it uses: cascade:MedicalProcedure, cascade:memberCurrentValues, cascade:valuesOfMember, cascade:narrativeText, cascade:entryMember, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion, cascade:procedureDate, cascade:procedureName, cascade:procedureCode, cascade:workflowStatus.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/My procedures"

Or in GraphDB, open the saved query pod/My procedures in the repository alex-rivera.

My reports, notes and documents: none. The question

The person this pod is about

1 row

Each hospital knows the person by a patient profile of its own, and About judgments tie those profiles to one subject, whom every record in a view is about. Read from the patient-profile view, as an app would: what each profile the view joins for the subject, a counting About tying it and no counting NotAbout outranking that, says of the person's date of birth, administrative gender, whether they have died and when, each value after the profile that states it, so sources that disagree are told apart and none is chosen; and each profile with the document it was derived from, when that was retrieved, and the hospitals that wrote it and that keep it. A list holds its values in order, separated by U+001F, and a list with nothing in it is unbound; a value's own parts are ended by ", ".

?subject?dateOfBirth?administrativeGender?deceased?dateOfDeath?sources
The person this pod is about Turtleurn:uuid:5056e058-324f-8c70-b69b-fb27a061cdc5urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ffurn:uuid:d461e692-842c-8a30-a8ba-940a908c8cab

1 row

The query: queries/questions/pod/The person this pod is about.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 ?subject ?subjectLabel ?dateOfBirth ?administrativeGender ?deceased ?dateOfDeath ?sources
WHERE {
  { SELECT ?subject
           (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?birthText, "\u001F"), ""); separator=""), "\u001F$", "") AS ?births)
           (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?genderText, "\u001F"), ""); separator=""), "\u001F$", "") AS ?genders)
           (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?deceasedText, "\u001F"), ""); separator=""), "\u001F$", "") AS ?deaths)
           (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?deathDateText, "\u001F"), ""); separator=""), "\u001F$", "") AS ?deathDates)
    WHERE {
      { SELECT ?subject ?birthText ?genderText ?deceasedText ?deathDateText
        WHERE {
          ?subject a cascade:Subject .
          OPTIONAL {
            ?about cascade:countsUnderLens true ; cascade:verdict ?aboutVerdict ; prov:hadMember ?profile ;
                   cascade:subject ?subject .
            ?entry a ?entryKind ; cascade:memberCurrentValues ?values .
            ?values cascade:valuesOfMember ?profile .
            FILTER (?aboutVerdict = cascade:About && ?entryKind = cascade:PatientProfile)
            OPTIONAL { ?values cascade:dateOfBirth ?birth }
            OPTIONAL { ?values cascade:administrativeGender ?gender }
            OPTIONAL { ?values cascade:deceased ?dead }
            OPTIONAL { ?values cascade:dateOfDeath ?died }
          }
          BIND (CONCAT(STR(?profile), " ", STR(?birth)) AS ?birthText)
          BIND (CONCAT(STR(?profile), " ", ?gender) AS ?genderText)
          BIND (CONCAT(STR(?profile), " ", STR(?dead)) AS ?deceasedText)
          BIND (CONCAT(STR(?profile), " ", STR(?died)) AS ?deathDateText)
        }
        ORDER BY ?subject ?profile }
    }
    GROUP BY ?subject }
  { SELECT ?subject (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?sourceText, "\u001F"), ""); separator=""), "\u001F$", "")
                     AS ?allSources)
    WHERE {
      { SELECT ?subject ?sourceText
        WHERE {
          { SELECT ?subject ?sourceRecord ?document ?retrievedOn
                   (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(?hospital, ", "), ""); separator=""), ", $", "") AS ?hospitals)
            WHERE {
              { SELECT ?subject ?sourceRecord ?document ?retrievedOn ?hospital
                WHERE {
                  ?subject a cascade:Subject .
                  OPTIONAL {
                    ?about cascade:countsUnderLens true ; cascade:verdict ?aboutVerdict ; prov:hadMember ?sourceRecord ;
                           cascade:subject ?subject .
                    ?entry a ?entryKind ; cascade:entryMember ?sourceRecord .
                    FILTER (?aboutVerdict = cascade:About && ?entryKind = cascade:PatientProfile)
                    OPTIONAL { ?sourceRecord cascade:currentRevision/prov:wasDerivedFrom ?document .
                               OPTIONAL { ?document pav:retrievedOn ?retrievedOn }
                               OPTIONAL { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                                          ?association prov:hadRole ?hospitalRole ; prov:agent ?agent
                                          FILTER (?hospitalRole IN (cascade:AuthorRole, cascade:CustodianRole))
                                          OPTIONAL { ?agent rdfs:label ?agentLabel }
                                          OPTIONAL { ?agent pav:hasCurrentVersion/foaf:name ?agentName }
                                          BIND (CONCAT(IF(?hospitalRole = cascade:AuthorRole, "written by ", "kept by "),
                                                       COALESCE(?agentLabel, ?agentName)) AS ?hospital) } }
                  }
                }
                ORDER BY ?subject ?sourceRecord ?document ?hospital }
            }
            GROUP BY ?subject ?sourceRecord ?document ?retrievedOn }
          BIND (CONCAT(STR(?sourceRecord), COALESCE(CONCAT(" from ", STR(?document)), ""),
                       COALESCE(CONCAT(", retrieved ", STR(?retrievedOn)), ""),
                       IF(?hospitals = "", "", CONCAT(", ", ?hospitals))) AS ?sourceText)
        }
        ORDER BY ?subject ?sourceText }
    }
    GROUP BY ?subject }
  ?subject a cascade:Subject .
  OPTIONAL { ?subject rdfs:label ?subjectLabel }
  BIND (IF(?births = "", 1/0, ?births) AS ?dateOfBirth)
  BIND (IF(?genders = "", 1/0, ?genders) AS ?administrativeGender)
  BIND (IF(?deaths = "", 1/0, ?deaths) AS ?deceased)
  BIND (IF(?deathDates = "", 1/0, ?deathDates) AS ?dateOfDeath)
  BIND (IF(?allSources = "", 1/0, ?allSources) AS ?sources)
}
ORDER BY ?subject

The terms it uses: cascade:Subject, cascade:countsUnderLens, cascade:verdict, prov:hadMember, cascade:subject, cascade:memberCurrentValues, cascade:valuesOfMember, cascade:About, cascade:PatientProfile, cascade:dateOfBirth, cascade:administrativeGender, cascade:deceased, cascade:dateOfDeath, cascade:entryMember, cascade:currentRevision, pav:retrievedOn, prov:wasGeneratedBy, prov:hadRole, prov:agent, cascade:AuthorRole, cascade:CustodianRole, rdfs:label, pav:hasCurrentVersion.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/The person this pod is about"

Or in GraphDB, open the saved query pod/The person this pod is about in the repository alex-rivera.

What each import brought in

33 rows

An import is one run of the Bridge over one download, or one session of the person entering things. Rows come in the order the imports started: every revision it added, the record it revised, and the version it carries.

?started?import?record?revision?version
2026-09-01 10:00 UTCApple Health exportAllergy · Codeine · Meridian Health System · alg-codeine-1 TurtleRevision · Codeine · alg-codeine-1 · received 2026-09-01Allergy version · Codeine · active · alg-codeine-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportAllergy · Latex · Meridian Health System · alg-latex-1 TurtleRevision · Latex · alg-latex-1 · received 2026-09-01Allergy version · Latex · active · alg-latex-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportAllergy · Penicillin G · Meridian Health System · alg-pcn-1 TurtleRevision · Penicillin G · alg-pcn-1 · received 2026-09-01Allergy version · Penicillin G · active · alg-pcn-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportAllergy · Sulfamethoxazole · Meridian Health System · alg-sulfa-1 TurtleRevision · Sulfamethoxazole · alg-sulfa-1 · received 2026-09-01Allergy version · Sulfamethoxazole · active · alg-sulfa-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportCondition · Acute bronchitis · Meridian Health System · cond-bronch-1 TurtleRevision · Acute bronchitis · cond-bronch-1 · received 2026-09-01Condition version · Acute bronchitis · active · cond-bronch-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportCondition · Essential hypertension · Meridian Health System · cond-htn-1 TurtleRevision · Essential hypertension · cond-htn-1 · received 2026-09-01Condition version · Essential hypertension · active · cond-htn-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportCondition · Low back pain · Meridian Health System · cond-back-1 TurtleRevision · Low back pain · cond-back-1 · received 2026-09-01Condition version · Low back pain · active · cond-back-1 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportImmunization · Influenza, seasonal · Meridian Health System · imm-flu-2025 TurtleRevision · Influenza, seasonal · imm-flu-2025 · received 2026-09-01Immunization version · Influenza, seasonal · completed · imm-flu-2025 · first received 2026-09-01
2026-09-01 10:00 UTCApple Health exportProcedure · Colonoscopy · Meridian Health System · proc-colonoscopy-1 TurtleRevision · Colonoscopy · proc-colonoscopy-1 · received 2026-09-01Procedure version · Colonoscopy · completed · proc-colonoscopy-1 · first received 2026-09-01
2026-09-01 18:30 UTCentered by Alex in the Cascade appAllergy · Peanuts · own entry TurtleRevision · Peanuts · own entry · received 2026-09-01Allergy version · Peanuts · criticality high · own entry · first received 2026-09-01
2026-10-14 15:42 UTCApple Health exportAllergy · Penicillin · Larkspur Valley Health · al-8237461 TurtleRevision · Penicillin · al-8237461 · received 2026-10-14Allergy version · Penicillin · active · al-8237461 · first received 2026-10-14
2026-10-14 15:42 UTCApple Health exportAllergy · Sulfamethoxazole · Larkspur Valley Health · al-8237462 TurtleRevision · Sulfamethoxazole · al-8237462 · received 2026-10-14Allergy version · Sulfamethoxazole · active · al-8237462 · first received 2026-10-14
2026-10-14 15:42 UTCApple Health exportCondition · Asthma · Larkspur Valley Health · pr-30018 TurtleRevision · Asthma · pr-30018 · received 2026-10-14Condition version · Asthma · active · pr-30018 · first received 2026-10-14
2026-10-14 15:42 UTCApple Health exportCondition · Hypertension · Larkspur Valley Health · pr-30017 TurtleRevision · Hypertension · pr-30017 · received 2026-10-14Condition version · Hypertension · active · pr-30017 · first received 2026-10-14
2026-10-14 15:42 UTCApple Health exportImmunization · Influenza, seasonal · Larkspur Valley Health · im-5501 TurtleRevision · Influenza, seasonal · im-5501 · received 2026-10-14Immunization version · Influenza, seasonal · completed · im-5501 · first received 2026-10-14
2026-10-14 15:42 UTCApple Health exportProcedure · Colonoscopy · Larkspur Valley Health · px-55120 TurtleRevision · Colonoscopy · px-55120 · received 2026-10-14Procedure version · Colonoscopy · completed · px-55120 · first received 2026-10-14
2026-11-20 09:00 UTCApple Health exportAllergy · Codeine · Meridian Health System · alg-codeine-1 TurtleRevision · Codeine · alg-codeine-1 · received 2026-11-20Allergy version · Codeine · entered-in-error · alg-codeine-1 · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportAllergy · Latex · Meridian Health System · alg-latex-1 TurtleRevision · Latex · alg-latex-1 · received 2026-11-20Allergy version · Latex · active · alg-latex-1 · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportAllergy · Sulfamethoxazole · Meridian Health System · alg-sulfa-1 TurtleRevision · Sulfamethoxazole · alg-sulfa-1 · received 2026-11-20Allergy version · Sulfamethoxazole · active · alg-sulfa-1 · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportCondition · Acute bronchitis · Meridian Health System · cond-bronch-1 TurtleRevision · Acute bronchitis · cond-bronch-1 · received 2026-11-20Condition version · Acute bronchitis · resolved · cond-bronch-1 · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportCondition · Low back pain · Meridian Health System · cond-back-1 TurtleRevision · Low back pain · cond-back-1 · received 2026-11-20Condition version · Low back pain · resolved · cond-back-1 · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportImmunization · Tdap · unknown source TurtleRevision · Tdap · unknown source · received 2026-11-20Immunization version · Tdap · completed · unknown source · first received 2026-11-20
2026-11-20 09:00 UTCApple Health exportProcedure · Echocardiography · Meridian Health System · proc-echo-1 TurtleRevision · Echocardiography · proc-echo-1 · received 2026-11-20Procedure version · Echocardiography · completed · proc-echo-1 · first received 2026-11-20
2027-02-10 17:21 UTCApple Health exportAllergy · Amoxicillin · Meridian Health System · alg-amox-2 TurtleRevision · Amoxicillin · alg-amox-2 · received 2027-02-10Allergy version · Amoxicillin · active · alg-amox-2 · first received 2027-02-10
2027-02-10 17:21 UTCApple Health exportCondition · Atopic dermatitis · Meridian Health System · cond-eczema-2 TurtleRevision · Atopic dermatitis · cond-eczema-2 · received 2027-02-10Condition version · Atopic dermatitis · active · cond-eczema-2 · first received 2027-02-10
2027-02-10 17:21 UTCApple Health exportCondition · Otitis media · Meridian Health System · cond-otitis-2 TurtleRevision · Otitis media · cond-otitis-2 · received 2027-02-10Condition version · Otitis media · active · cond-otitis-2 · first received 2027-02-10
2027-03-18 12:00 UTCApple Health exportAllergy · Penicillin · Larkspur Valley Health · lv-alg-101 TurtleRevision · Penicillin · lv-alg-101 · received 2027-03-18Allergy version · Penicillin · active · lv-alg-101 · first received 2027-03-18
2027-03-18 12:00 UTCApple Health exportAllergy · Sulfamethoxazole · Larkspur Valley Health · lv-alg-102 TurtleRevision · Sulfamethoxazole · lv-alg-102 · received 2027-03-18Allergy version · Sulfamethoxazole · active · lv-alg-102 · first received 2027-03-18
2027-03-18 12:00 UTCApple Health exportCondition · Asthma · Larkspur Valley Health · lv-cond-202 TurtleRevision · Asthma · lv-cond-202 · received 2027-03-18Condition version · Asthma · active · lv-cond-202 · first received 2027-03-18
2027-03-18 12:00 UTCApple Health exportCondition · Essential hypertension · Larkspur Valley Health · lv-cond-201 TurtleRevision · Essential hypertension · lv-cond-201 · received 2027-03-18Condition version · Essential hypertension · active · lv-cond-201 · first received 2027-03-18
2027-03-18 12:00 UTCApple Health exportImmunization · Influenza, injectable, quadrivalent, preservative free · Larkspur Valley Health · lv-imm-301 TurtleRevision · Influenza, injectable, quadrivalent, preservative free · lv-imm-301 · received 2027-03-18Immunization version · Influenza, injectable, quadrivalent, preservative free · completed · lv-imm-301 · first received 2027-03-18
2027-03-18 12:00 UTCApple Health exportProcedure · Colonoscopy · Larkspur Valley Health · lv-proc-401 TurtleRevision · Colonoscopy · lv-proc-401 · received 2027-03-18Procedure version · Colonoscopy · completed · lv-proc-401 · first received 2027-03-18
2027-08-20 08:00 UTCApple Health exportCondition · Low back pain · Meridian Health System · cond-back-1 TurtleRevision · Low back pain · cond-back-1 · received 2027-08-20Condition version · Low back pain · active · cond-back-1 · first received 2026-09-01

33 rows

The query: queries/questions/pod/What each import brought in.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?started ?import ?importLabel ?record ?recordLabel ?revision ?revisionLabel ?version ?versionLabel
WHERE {
  VALUES ?kind { cascade:DocumentImport cascade:HandEntrySession }
  ?import a ?kind ; prov:startedAtTime ?started .
  ?revision prov:wasGeneratedBy ?import ; cascade:revisionOf ?record ; cascade:version ?version .
  OPTIONAL { ?import rdfs:label ?importLabel }
  OPTIONAL { ?record rdfs:label ?recordLabel }
  OPTIONAL { ?revision rdfs:label ?revisionLabel }
  OPTIONAL { ?version rdfs:label ?versionLabel }
}
ORDER BY ?started ?import ?recordLabel ?revision

The terms it uses: cascade:DocumentImport, cascade:HandEntrySession, prov:startedAtTime, prov:wasGeneratedBy, cascade:revisionOf, cascade:version, rdfs:label.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/What each import brought in"

Or in GraphDB, open the saved query pod/What each import brought in in the repository alex-rivera.

What each report says of a variant: none. The question

What was seen more than once

10 rows

Each entry that holds more than one record, once for each place its records came from: how many of its records came from that place, and from how many places they came. A record's place is read from its current revision: a hospital that wrote or keeps the document it was derived from, by its label or its organization record's current name, or, when it has none, the label of the import or session that generated it. A place is told apart by that text alone: a hospital with two names is two places, and a hospital and an import that share a name are one. A record with two hospitals counts at each, so an entry's records can add up to more than it holds; a record with no hospital and no labelled import or session is given no place, and is not counted in places. Entries seen at more than one place come first.

10 rows

The query: queries/questions/pod/What was seen more than once.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 ?entry ?entryLabel ?place (COUNT(DISTINCT ?record) AS ?records) ?places
WHERE {
  { SELECT ?entry (COUNT(DISTINCT ?somewhere) AS ?places)
    WHERE {
      ?member a cascade:Record ; ^cascade:entryMember ?entry ; cascade:currentRevision ?memberRevision .
      OPTIONAL { ?memberRevision prov:wasGeneratedBy/rdfs:label ?memberImportLabel }
      OPTIONAL { ?memberRevision prov:wasDerivedFrom/prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?memberHospital }
      BIND (COALESCE(?memberHospital, ?memberImportLabel) AS ?somewhere)
    }
    GROUP BY ?entry
    HAVING (COUNT(DISTINCT ?member) > 1) }
  ?record ^cascade:entryMember ?entry ; cascade:currentRevision ?revision .
  OPTIONAL { ?entry rdfs:label ?entryLabel }
  OPTIONAL { ?revision prov:wasGeneratedBy/rdfs:label ?importLabel }
  OPTIONAL { ?revision prov:wasDerivedFrom/prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital }
  BIND (COALESCE(?hospital, ?importLabel) AS ?place)
}
GROUP BY ?entry ?entryLabel ?place ?places
ORDER BY DESC(?places) ?entryLabel ?entry ?place

The terms it uses: cascade:Record, cascade:entryMember, cascade:currentRevision, prov:wasGeneratedBy, prov:wasDerivedFrom, rdfs:label, pav:hasCurrentVersion.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/What was seen more than once"

Or in GraphDB, open the saved query pod/What was seen more than once in the repository alex-rivera.

Which files are out of place: none. The question

Which reference versions are current

2 rows

The matcher compares codes using reference tables, and each table comes in versions. The newest is the one no other revises; a matcher judgment made with an older one stops counting, unless the newest one's rows join its records too.

2 rows

The query: queries/questions/pod/Which reference versions are current.rq on GitHub
PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pav: <http://purl.org/pav/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?series ?seriesLabel ?version ?versionLabel
WHERE {
  ?series a cascade:ReferenceSeries ; pav:hasCurrentVersion ?version .
  OPTIONAL { ?series rdfs:label ?seriesLabel }
  OPTIONAL { ?version rdfs:label ?versionLabel }
}
ORDER BY ?series ?version

The terms it uses: cascade:ReferenceSeries, pav:hasCurrentVersion, rdfs:label.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "pod/Which reference versions are current"

Or in GraphDB, open the saved query pod/Which reference versions are current in the repository alex-rivera.