Skip to content
Alpha: see what works today →
Menu

Derivation

subjects

A record is about the subject when its current version names a patient profile a counting About judgment ties to them and no counting NotAbout over it for them outranks, or names the subject directly. A NotAbout outranks every About: one a person filed after it, or another person's, holds the profile back for review, and lifts nothing.

The query

PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>
PREFIX pav: <http://purl.org/pav/>
PREFIX prov: <http://www.w3.org/ns/prov#>

CONSTRUCT { ?record cascade:subject ?s }
WHERE {
  { ?record pav:hasCurrentVersion/cascade:patient ?profile .
    ?j cascade:countsUnderLens true ; cascade:verdict cascade:About ; prov:hadMember ?profile ; cascade:subject ?s .
    MINUS { ?denial cascade:countsUnderLens true ; cascade:verdict cascade:NotAbout ; prov:hadMember ?profile ;
                    cascade:subject ?s . } }
  UNION
  { ?record pav:hasCurrentVersion/cascade:patient ?s .
    ?s a cascade:Subject . }
}

Terms it reads

cascade:About · cascade:NotAbout · cascade:Subject · cascade:countsUnderLens · cascade:subject · cascade:verdict · pav:hasCurrentVersion · prov:hadMember

Rules and decision notes that name it

queries/derivations/subjects.rq on GitHub ↗