Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Files

The Dolfin files tree in the sidebar lists the project’s files. package.dlf is not in it: edit it through ⚙ Package.

Video 5.2 · Files, projects and teamwork, chapter “Files” (0:04–0:41). Watch on PeerTube

A file opens in the editor that matches its extension:

ExtensionEditor
.dlfThe Dolfin editor.
.ttl, .turtle, .n3The Turtle editor.
.mdA plain Markdown editor, handy for notes and a README. View in the bar above it shows the rendered page, unsaved edits included; Edit goes back to the editor.
.csvA table, see CSV files.
.json, .xml, .gpxA folding tree, see JSON and XML files.

Toolbar

ButtonAction
Collapse allFolds every folder.
ImportFiles… takes any mix of .zip, .dlf, .md, plain Turtle files (.ttl, .turtle, .n3, added as tree files: use Add as Turtle source on one to make it a source) and data files (.csv, .json, .xml, .gpx, .xlsx, .xlsm, .ods); Folder… takes a whole folder, read recursively. Everything lands at the package root: the picked folder’s own name is dropped, so foo/a.dlf becomes a.dlf, its subfolders are kept (foo/data/x.csv becomes data/x.csv), its package.dlf replaces the project’s, and a zip found in the folder is unpacked where it sits. Hidden files (.git/…) and other file types are skipped, and a notice lists them. If some names already exist, Agrafe asks whether to Overwrite all, Skip conflicts or Cancel. The result notice names each file it wrote or overwrote, with the first characters of its new version (the version that the MCP file tools use). A second notice names the files Skip conflicts left as they were, with the version each one kept, so a file that was not replaced is visible. A zip’s .dolfin/imports/** (as Export as zip writes it) is not added as files: once the files are imported, those locks become the project’s import locks, replacing its others. Each lock’s files are checked against its artifact_hash; if any lock does not match, is incomplete or repeats an import, none is restored, the project keeps its locks and a notice names the import. Nothing is fetched: a lock pointing at a release you cannot import here keeps its content but points at the import’s IRI instead. Without .dolfin/imports/, an import that brings a package.dlf locks its import lines as saving the Package pane does (a release you can import, else the line’s URL); a line that cannot be locked is named in a notice, the files stay imported, and the Package pane lets you fix it. Problems refreshes as soon as a lock changes.
Export as zipDownloads every file of the project, package.dlf included, as <package name>.zip. The project’s locked imports come along under .dolfin/imports/<import>/ (lock.json, interface.json, turtle.ttl, closure.ttl), so the unzipped folder passes radeau check without network access. If the locks cannot be fetched, a notice says so and the zip holds the project files only.
+Creates a new file at the top level.

The number of files per project depends on the owner’s plan.

Data files

A project can hold the data its mappings read: .csv, .json and .xml files, .gpx GPS tracks (XML, read as XPath), and spreadsheets (.xlsx, .xlsm, .ods), added with Import like any other file. A mapping names one by its path in the project, for example <package://Airport.csv>, and a deploy expands it into facts. The mapping form writes such a block for you. Delete the file and the next deploy fails on the missing source.

  • Each data file is limited to 5 MiB (for a spreadsheet, the size of the file itself). A larger file is refused with its size; the whole import is refused, not just that file.
  • Data and Turtle extensions are matched in any case: Airport.CSV, UP.JSON and UP.TTL are accepted like Airport.csv. .dlf and .md stay lower-case.
  • The Turtle tab compiles in your browser and cannot read spreadsheets: a mapping that reads one is left out there, with a # Not in this preview comment at the top naming it. Deploy and SPARQL on the live package read it.
  • A spreadsheet cannot be opened in the editor: clicking it says so. Use its right-click ⇄ New mapping from file… to see its sheets. Export as zip puts the original file in the zip. A spreadsheet can be renamed to another spreadsheet extension only.
  • File names cannot start with ., contain .., \ or control characters, or start with /.
  • Data files count towards the plan’s file limit.

CSV files

A .csv file opens as a table, its first row as the header. The search box above it keeps the rows with a cell containing the text (case is ignored), highlights the matches and counts them (3 of 120 rows); the header always stays. With edit rights, Edit turns every cell, header included, into a text field, and Done turns them back. Each change rewrites the file as CSV, quoting a field when it needs it, and saves like a typed edit, live for the other people in the file. Header cells name the columns a mapping reads, so renaming one affects the mappings that use that column. Opening or searching a file never changes it. Large files stay responsive: only the rows on screen are drawn, so cells show on one line and a long value is cut with … (the full text shows in Edit).

JSON and XML files

A .json, .xml or .gpx file opens as an indented tree: keys in file order, values, tags, attributes, text, comments. The ▸/▾ toggle folds an object, array or element to a one-line summary ({…3 keys}, […5 items], <tag>…</tag>); levels deeper than three start folded. If the file does not parse, a banner gives the error with its line and column, and the raw text shows below it. The search box highlights every key, value, tag, attribute or text containing the text (case is ignored), unfolds what hides a match and counts the matches; clearing it brings your folds back. With edit rights, Edit shows the whole text in a plain text area, saved like a typed edit and live for the other people in the file; Done checks it again and returns to the tree. Opening, folding or searching a file never changes it.

Folders

Folders come from file names: a file named models/person.dlf sits in a models folder. A folder disappears when its last file goes.

Hover a folder for two buttons: + (new file in that folder) and a hold-to-delete trash that removes the folder and every file in it.

Drag a file onto a folder to move it there; the folder under the pointer is outlined. Drop it on an empty part of the tree (or on a root-level file) to move it to the root. Hold a dragged file over a closed folder for a moment and it opens, so you can drop it deeper. A move is a rename: if a file with that name already exists there, the move is refused and a notice says why. Moving or renaming a .dlf that has no namespace line keeps its namespace: a namespace line is added at the top and a notice says kept namespace people (delete the namespace line to follow the new path). See File namespace.

Right-click menus

Right-click a file:

ItemAction
✏ RenameEdits the file’s full path in place, with the name selected. Change the folder part to move the file (models/person.dlf → people/person.dlf); an unknown folder is created. Enter confirms, Escape or clicking away cancels.
⇄ New mapping from file…Only on a .csv, .json, .xml, .gpx, .xlsx, .xlsm or .ods file. Opens the mapping form on a new mapping that reads it.
⇄ Mapping 1: Airport.csv …Only on a .dlf file, one item per mapping block in it. Opens that mapping in the mapping form; a (text) one opens as text only.
⟳ Re-translate to Dolfin…Only on the origin .ttl of a Turtle project. See Re-translate.
DeleteDeletes the file at once.

Right-click a folder:

ItemAction
+ New file hereCreates a file in that folder, ready to be renamed.
Delete folderDeletes the folder and all its files.

The same file actions also exist on hover: a pencil (Rename, also F2) and a hold-to-delete trash.

Renaming a Dolfin file changes its namespace, so the IRIs of everything declared in it change too.

Badges

  • A file with problems shows its error and warning counts next to its name. The Problems panel lists them.
  • In a project imported from Turtle, the original file carries an origin badge and stays at the top. Deleting it asks for confirmation, because Reveal and sync depend on it. See Importing a Turtle file.

Keyboard

The tree is a single stop in the tab order. Once it has focus:

KeyAction
↑ / ↓Previous / next row.
Home / EndFirst / last row.
→Opens a folder, then moves into it.
←Closes a folder, or moves to the parent folder.
EnterOpens the file, or toggles the folder.
SpaceToggles the folder.
F2Renames the file.