Skip to content
Alpha: see what works today →
Menu

Derivation

entries

Records of one kind, not left out, that are currently the same, directly or through each other, make one entry. It is named from its smallest member, so the same records always make the same entry.

The query

PREFIX cascade: <https://ns.cascadeprotocol.org/cascade#>

CONSTRUCT { ?record cascade:inEntry ?entry }
WHERE {
  { SELECT ?record (IRI(CONCAT("urn:cascade:entry:", SHA256(MIN(STR(?m))))) AS ?entry)
    WHERE {
      ?record cascade:recordKind ?kind ; cascade:currentlySame* ?m .
      ?m cascade:recordKind ?kind .
      FILTER NOT EXISTS { ?record cascade:leftOutFor [] }
      FILTER NOT EXISTS { ?m cascade:leftOutFor [] }
    }
    GROUP BY ?record }
}

Terms it reads

cascade:currentlySame · cascade:inEntry · cascade:leftOutFor · cascade:recordKind

Rules and decision notes that name it

queries/derivations/entries.rq on GitHub ↗