Connected Flows

When the Process Flow and Code Flow are both in the graph they are intimately connected, relatable, and queryable. Answers to questions like “What R programs Create TTL Files for upload into the graph database?” are a simple query away.

Figure 5.4 Connected Flows.
Figure 5.4 Connected Flows.

To find the answer, all you need to do is specify the title of the step and type of file (FileTypeTTL) you are looking for. The query and the connected nature of graph data does the rest.

PREFIX :        <https://www.example.org/tw/filecat#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT ?step ?title ?TTLFile ?rFile
WHERE{
    ?flowStep :relatedFile  ?f ;
              dcterms:title ?title ;
              :stepNumber   ?step .
    ?f        :fileName     ?TTLFile ;
              rdf:type      ?fType .
    ?rF       :writes       ?f ;
              :fileName     ?rFile .
    FILTER (?title IN ("Create TTL Files"))
    FILTER (?fType IN (:FileTypeTTL))
}

The result shows that the R programs associated with the Process Flow step “Create TTL Files” creates two files for upload to the database. All of the other steps in the process flow can be queried in a similar manner.

step  title               TTLfile             Rfile
8     "Create TTL Files"  "FileCat.TTL"       "02-Dictionary.R"
8     "Create TTL Files"  "Dictionary.TTL"    "03FileCatTTL.R"

A single file like Dictionary.TTL can be associated with multiple steps as an input or an output. With a simple SPARQL query it can be determined that the file is associated with four process flow steps that include: term identification, creation of TTL files, validation of said files, and loading of the TTL files into the database.

PREFIX :        <https://www.example.org/tw/filecat#>
PREFIX dcterms: <http://purl.org/dc/terms/>
SELECT ?step ?title
WHERE{
      ?f  :fileName     ?file ;
          :pFlowStep    ?pf .
      ?pf dcterms:title ?title ;   
          :stepNumber   ?step .
    FILTER (?file IN ("Dictionary.TTL"))
} ORDER BY ?step
step  title
7     "Identify terms"
8     "Create TTL Files"
9     "Validate with SHACL"
10    "Load TTL into Database"

NEXT: 6. Finding Files

Previous