Skip to content
Alpha: see what works today →
Menu

Named question about pod

What each folder holds

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.

The query

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

Terms it reads

cascade:View · pim:storage

Rules and decision notes that name it

No rule or decision note writes its path.

Its rows on Alex Rivera's pod

The first 10 of 49 rows, as Alex Rivera's explorer shows them. Every row of every question is in answers.json.

foldertypethings
/cascade:PodManifest1
/clinical/cascade:AllergyOrIntolerance4
/clinical/cascade:MedicalProcedure2
/clinical/cascade:PatientProfile1
/clinical/cascade:ProblemOrDiagnosis4
/clinical/cascade:Vaccination1
/clinical/cascade:View6
/judgments/prov:SoftwareAgent1
/judgments/cascade:Judgment20
/judgments/assertions/cascade:MatcherJudgmentAssertion10

queries/questions/pod/What each folder holds.rq on GitHub ↗