Skip to content
Alpha: see what works today →
Menu

Profile

Patient profile · Meridian Health System · first received 2027-02-10

urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a

A patient profile is how one hospital names the person. Each record names a profile as its patient, and an About judgment says whose the profile is. Until one counts, the records naming it stay out of every view.

Every section below is one question with only the rows about this profile. 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.

5 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 urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a.

Or in GraphDB, open the saved query pod/Which file states each thing in the repository alex-rivera.

What needs review

Each patient profile whose records are hidden until a person answers whose it is: one a record's current version names, other than the subject, that no counting About or NotAbout names; and one held back, a counting NotAbout and a person's About standing against it, which it does unless a counting NotAbout of the same maker was made after it. Each is listed once for each hospital whose records name it in their current version, with how many, and a held-back one with the people whose About stands against a NotAbout and the people whose NotAbout counts, each list in IRI order and separated by U+001F. A profile no record names is not listed. Which Abouts stand is read here and not from the derived left-out reasons, which name a profile and no one, and this lists each person.

Only the rows whose ?profile is this one.

?needs?hospital?records?saidAbout?saidNotAbout
no one has said whether it is the subject'sMeridian Health System3

1 row

The query: queries/questions/profile/What needs review.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 ?profile ?profileLabel ?needs ?hospital ?records ?saidAbout ?saidNotAbout
WHERE {
  { SELECT ?profile ?needs ?saidAbout ?saidNotAbout
    WHERE {
      { { SELECT DISTINCT ?profile WHERE { ?record pav:hasCurrentVersion/cascade:patient ?profile } }
        MINUS { ?profile a cascade:Subject }
        MINUS { ?claim cascade:countsUnderLens true ; cascade:verdict cascade:About ; prov:hadMember ?profile }
        MINUS { ?denial cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ; prov:hadMember ?profile }
        BIND ("no one has said whether it is the subject's" AS ?needs) }
      UNION
      { { SELECT ?profile
                 (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(STR(?by), "\u001F"), ""); separator=""), "\u001F$", "")
                  AS ?saidAbout)
          WHERE {
            { SELECT DISTINCT ?profile ?by
              WHERE {
                ?opposed cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ; prov:hadMember ?profile ;
                         cascade:subject ?s .
                ?against cascade:countsUnderLens true ; cascade:verdict cascade:About ; prov:hadMember ?profile ;
                         cascade:subject ?s ; prov:wasAttributedTo ?by ; prov:generatedAtTime ?made .
                ?by a prov:Person .
                MINUS {
                  ?outranking cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ; prov:hadMember ?profile ;
                              cascade:subject ?s ; prov:wasAttributedTo ?by ; prov:generatedAtTime ?later .
                  ?against cascade:verdict cascade:About ; prov:hadMember ?profile ; cascade:subject ?s ;
                           prov:wasAttributedTo ?by ; prov:generatedAtTime ?made .
                  FILTER (?later > ?made)
                }
              }
              ORDER BY ?profile ?by }
          }
          GROUP BY ?profile
          HAVING (BOUND(?profile)) }
        { SELECT ?profile
                 (REPLACE(GROUP_CONCAT(DISTINCT COALESCE(CONCAT(STR(?by), "\u001F"), ""); separator=""), "\u001F$", "")
                  AS ?saidNotAbout)
          WHERE {
            { SELECT DISTINCT ?profile ?by
              WHERE { ?denial cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ; prov:hadMember ?profile ;
                              prov:wasAttributedTo ?by . }
              ORDER BY ?profile ?by }
          }
          GROUP BY ?profile
          HAVING (BOUND(?profile)) }
        BIND ("judged both about and not about the subject" AS ?needs) }
    } }
  { SELECT ?profile ?hospital (COUNT(DISTINCT ?record) AS ?records)
    WHERE {
      { { SELECT DISTINCT ?document ?hospital
          WHERE { ?document prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } }
        ?revision prov:wasDerivedFrom ?document ; cascade:version ?version .
        ?record pav:hasCurrentVersion ?version .
        ?version cascade:patient ?profile . }
      UNION
      { ?record pav:hasCurrentVersion ?version .
        ?version cascade:patient ?profile .
        MINUS { ?revision cascade:version ?version ;
                          prov:wasDerivedFrom/prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } } }
    GROUP BY ?profile ?hospital
    HAVING (BOUND(?profile)) }
  OPTIONAL { ?profile rdfs:label ?profileLabel }
}
ORDER BY ?needs ?profileLabel ?profile ?hospital

The terms it uses: pav:hasCurrentVersion, cascade:Subject, cascade:countsUnderLens, cascade:verdict, cascade:About, prov:hadMember, cascade:NotAbout, cascade:subject, prov:wasAttributedTo, prov:generatedAtTime, prov:Person, rdfs:label, prov:wasDerivedFrom, cascade:version, cascade:patient.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "profile/What needs review"

It prints the rows for every profile; this block keeps those whose ?profile is urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a.

Or in GraphDB, open the saved query profile/What needs review in the repository alex-rivera.

Which judgments name it

An About or a NotAbout judgment names a patient profile as its member and says whether it is the subject's; until an About counts that no counting NotAbout outranks, the records that name the profile are in no view. Rows come in the order the judgments were made.

Only the rows whose ?profile is this one.

?made?judgment?verdict?counts
2027-02-10 17:21 UTCAbout · the patient · 2027-02-10 · a patient profile Turtleabout cascade:Aboutfalse

1 row

The query: queries/questions/profile/Which judgments name it.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 ?profile ?profileLabel ?made ?judgment ?judgmentLabel ?verdict ?counts
WHERE {
  ?version cascade:patient ?profile .
  ?judgment a cascade:Judgment ; prov:hadMember ?profile ; prov:generatedAtTime ?made .
  OPTIONAL { ?judgment cascade:verdict ?verdict }
  OPTIONAL { ?judgment cascade:countsUnderLens ?counted }
  BIND (COALESCE(?counted, false) AS ?counts)
  OPTIONAL { ?profile rdfs:label ?profileLabel }
  OPTIONAL { ?judgment rdfs:label ?judgmentLabel }
}
ORDER BY ?profileLabel ?profile ?made ?judgment

The terms it uses: cascade:patient, cascade:Judgment, prov:hadMember, prov:generatedAtTime, cascade:verdict, cascade:countsUnderLens, rdfs:label.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "profile/Which judgments name it"

It prints the rows for every profile; this block keeps those whose ?profile is urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a.

Or in GraphDB, open the saved query profile/Which judgments name it in the repository alex-rivera.

Which records name it

A record names its patient through its current version's cascade:patient. Each hospital names its own profile for the person.

Only the rows whose ?profile is this one.

3 rows

The query: queries/questions/profile/Which records name it.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 ?profile ?profileLabel ?record ?recordLabel
WHERE {
  ?record pav:hasCurrentVersion/cascade:patient ?profile .
  OPTIONAL { ?profile rdfs:label ?profileLabel }
  OPTIONAL { ?record rdfs:label ?recordLabel }
}
ORDER BY ?profileLabel ?profile ?recordLabel ?record

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

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "profile/Which records name it"

It prints the rows for every profile; this block keeps those whose ?profile is urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a.

Or in GraphDB, open the saved query profile/Which records name it in the repository alex-rivera.

Whose it is counted as

About judgments say whose a patient profile is, and only one that counts is believed, while no counting NotAbout over the profile for that subject outranks it. Each row is one hospital whose records name the profile, with how many of them it sent. Records naming a profile no counting About judgment claims, or a counting NotAbout denies, stay out of every view.

Only the rows whose ?profile is this one.

?subject?counts?about?hospital?records
The person this pod is about TurtlefalseAbout · the patient · 2027-02-10 · a patient profile TurtleMeridian Health System3

1 row

The query: queries/questions/profile/Whose it is counted as.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 ?profile ?profileLabel ?subject ?subjectLabel ?counts ?about ?aboutLabel ?hospital ?records
WHERE {
  { SELECT ?profile ?hospital (COUNT(DISTINCT ?record) AS ?records)
    WHERE {
      { { SELECT DISTINCT ?document ?hospital
          WHERE { ?document prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } }
        ?revision prov:wasDerivedFrom ?document ; cascade:version ?version .
        ?version cascade:patient ?profile ; prov:specializationOf ?record . }
      UNION
      { ?version cascade:patient ?profile ; prov:specializationOf ?record .
        MINUS { ?revision cascade:version ?version ;
                          prov:wasDerivedFrom/prov:wasAttributedTo/(rdfs:label|pav:hasCurrentVersion/foaf:name) ?hospital } } }
    GROUP BY ?profile ?hospital
    HAVING (BOUND(?profile)) }
  ?about a cascade:Judgment ; cascade:verdict cascade:About ; prov:hadMember ?profile ; cascade:subject ?subject .
  OPTIONAL { ?about cascade:countsUnderLens ?counted }
  BIND (COALESCE(?counted, false) && !EXISTS { ?denial cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ;
                                                       prov:hadMember ?profile ; cascade:subject ?subject }
        AS ?counts)
  OPTIONAL { ?profile rdfs:label ?profileLabel }
  OPTIONAL { ?subject rdfs:label ?subjectLabel }
  OPTIONAL { ?about rdfs:label ?aboutLabel }
}
ORDER BY ?profileLabel ?profile ?aboutLabel ?about ?hospital

The terms it uses: prov:wasAttributedTo, rdfs:label, pav:hasCurrentVersion, prov:wasDerivedFrom, cascade:version, cascade:patient, prov:specializationOf, cascade:Judgment, cascade:verdict, cascade:About, prov:hadMember, cascade:subject, cascade:countsUnderLens, cascade:NotAbout.

Run it yourself, from the runtime's root:

npm run ask -- alex-rivera "profile/Whose it is counted as"

It prints the rows for every profile; this block keeps those whose ?profile is urn:uuid:e6ef533e-087e-8aff-8979-1e62c5e9d06a.

Or in GraphDB, open the saved query profile/Whose it is counted as in the repository alex-rivera.