Introduction
Agrafe is the Dolfin web app for writing, compiling and deploying ontologies in your browser. This book documents Agrafe itself: its features, screens and integrations.
The Dolfin language (syntax, types, units, the Turtle correspondence) has its own documentation at www.dolfin.fr/docs. Nothing here repeats it.
What is covered
Using Agrafe: from an empty account to a live API.
- Projects: create, organise in folders, share and publish projects.
- The project workspace: the screen you work in, and how its parts fit together.
- Files: the file tree, its right-click menus, zip import and export.
- The Dolfin editor: completion, hover, quick fixes and the right-click menu.
- The mapping form: turn a CSV data file into facts by pointing and clicking.
- Problems, hints and quick fixes: what the checker reports and how to fix it in one click.
- The output panel: Parse, Turtle and SVG, the interactive Graph and its right-click menus, the SPARQL console, Deployments and their API, and History.
- Collaboration: roles, editing together, public projects.
- Account settings and Keyboard and mouse.
Turtle projects: start from an existing OWL/Turtle file and keep both worlds connected.
- Importing a Turtle file creates a Dolfin project and keeps the original
.ttlin it. - The Turtle editor edits that file with syntax checking.
- Reveal jumps from a Dolfin declaration to the Turtle it corresponds to, and back.
- Sync writes your Dolfin edits into the Turtle automatically.
- Re-translate regenerates the Dolfin files after you changed the Turtle by hand.
Integrations: query your deployed ontologies from Claude and other MCP clients.
First steps
- On the Projects page, press + and choose New project.
- Open it and pick an example, or paste your own Dolfin. See An empty project.
- Edit. The Problems panel and the Graph follow as you type.
- Press Deploy in the Deployments tab and copy your token. See Deployments.
A short guided tour runs the first time you open the Projects page and a project. The ? button in the output panel walks you through its tabs at any time.
Conventions
- Dolfin file or dlf: a
.dlfsource file of the project. - Origin: the
.ttla project was imported from (see Importing). - Menu and button names are written exactly as they appear in the app.
- On a Mac, read ⌘ wherever this book says Ctrl.
Projects
The Projects page is where you land after signing in. It lists your projects and folders, and the projects other people shared with you.
Creating a project
The round + button (bottom right) opens three choices:
| Choice | What it does |
|---|---|
| New project | Creates an empty project called New project in the folder you are in, with its name ready to edit. Type the real name and press Enter. |
| New folder | Creates a folder at the current level. |
| Import from Turtle | Creates one project from one or more existing .ttl files, in the folder you are in; each file becomes a Turtle source. See Importing a Turtle file. You can also drop .ttl files anywhere on the page. To add Turtle files to an existing project, use Import → Add Turtle source… in its file tree (Adding a Turtle source). |
When you have no project yet, the page shows the same two starting points as cards: Start from scratch and Import from Turtle.
The number of projects you can own depends on your plan. When you reach it, a message says so; Settings → License lists the plans that raise it.
Finding a project
- Search filters by project name and comment.
- Sort orders the list: Manual (the order you dragged things into), Recently opened or Recently modified.
Folders
Folders group projects. They are yours only: they are not shared with anyone.
- A folder shows as a title bar with a horizontal preview of what it contains. Click it to open it; the breadcrumb above the list (Home › …) takes you back up.
- An open folder has its own address, such as
/home/Clients/Acme%20Corp: bookmark it or reopen it in another tab, and the browser’s Back and Forward buttons move between folders. If two folders in the same place share a name, the address uses the folder’s id instead of its name. - Drag a project onto a folder to move it there. Hold a dragged project over a folder title for a moment and the folder springs open, so you can drop it deeper.
- In Manual sort, dragging also reorders projects and folders. The other cards move aside as you drag, so the list already shows the order you get when you let go. Drag a card over a folder’s preview to place it inside that folder at that exact spot. On a folder title, the middle moves the item into the folder; the top and bottom edges place it before or after the folder. Press Escape to cancel.
- Rename a folder with its pencil button; press Enter to confirm or Escape to cancel.
- Delete a folder by pressing and holding its trash button for two seconds. Only an empty folder can be deleted.
Dragging to the bin
While you drag a project or a folder, in any sort mode, a bin appears at the bottom of the page: Drop here to delete.
- A project dropped on the bin is deleted at once, with no confirmation.
- An empty folder is deleted at once.
- A folder with content is refused the first time: a dialog says how many projects and sub-folders it holds, counted at every depth. Drop the same folder on the bin again, without doing anything else first, to delete it together with everything inside. Anything in between cancels the request: grabbing another item, dropping the folder elsewhere, a click, opening a folder or a project, a new search or sort, or closing the dialog.
Dragging needs a mouse. On a touch screen, use the hold-to-delete buttons instead.
Project card
Each project card shows its name, its creation date and, for a shared project, who shared it. The card actions are for the owner:
| Action | How |
|---|---|
| Public switch | Anyone, even without an account, can view the project read-only at /public/<id>. It is listed on the Public projects page. |
| Share | Invite someone by email as Viewer or Editor. The dialog also lists the people who have access and lets you remove them. See Collaboration. |
| Rename | Edits the name in place. Enter confirms, Escape cancels. |
| Delete | Press and hold the trash button for two seconds. A short click only shows a reminder. |
On the public page, any file named *.md (lowercase extension; README.MD is shown as source) is shown rendered, like on GitHub. Raw HTML in it is shown as text, links other than http(s):, mailto: and relative ones are dropped, and images are not loaded (so visitors cannot be tracked). A relative link to another project file (docs/spec.dlf, ./a.dlf, ../model.dlf, or /model.dlf from the project root) is resolved from the folder of the .md file and opens that file on the public page, in the same version shown. A link that goes above the project root is shown as plain text. A folder link (docs/) matches no file, so it opens the root README. /public/<id>?file=<path> opens a given file directly; an unknown name opens the README. Links open in a new tab.
Projects shared with you appear under Shared with you.
Public projects
/public lists every public project, most recently changed first, without an account. More cards load as you scroll (or with Load more). Each card shows the version, the owner’s name and handle, the description and the tags. Click a handle or a tag to list the projects that share it.
The search box filters as you type. The search is kept in the address (/public?q=…), so you can share it.
| You type | Finds |
|---|---|
beds | Projects whose name contains beds, or with the tag beds |
@alice | Projects owned by @alice. Several handles: projects of any of them |
#health | Projects with the tag health |
@alice #health beds | All terms together |
Case does not matter.
The Live view switch is not on the card: the owner finds it in the header of the project’s Deployments panel, next to Deploy. Off by default, it lets AI assistants connected over MCP run SPARQL and validation on the project’s current files, without deploying.
Hold-to-delete buttons
Every destructive button in Agrafe (projects, folders, files, deployments, restoring a version) is a hold button: press and keep holding until the fill completes. Releasing early cancels. A quick click only shows a reminder, so you cannot delete anything by accident. The one exception is dragging to the bin, which deletes a project as soon as you let go.
The project workspace
Opening a project shows the workspace. It is made for a wide screen; on a narrow one Agrafe asks for a wider window.
┌───────────┬──────────────────────────────┬───────────────────────────────┐
│ Sidebar │ File tabs │ Output tabs │
│ ├──────────────────────────────┤ Parse · Turtle · SVG · Graph │
│ Search │ │ SPARQL · Deployments · History│
│ Public │ Editor │ Output panel │
│ Release │ │ (Deploy: Deployments tab) │
│ Files │ │ │
│ │ │ │
│ ⚙ Package ├──────────────────────────────┴───────────────────────────────┤
│ │ Problems │
└───────────┴──────────────────────────────────────────────────────────────┘
Sidebar
From top to bottom:
| Element | Purpose |
|---|---|
| ‹ | Hides the sidebar. The thin › rail on the left brings it back. Your choice is remembered. |
| Role badge | Shown on a project shared with you: viewer or editor. |
| Search… | Searches the whole project, see below. |
| Public | Owner only. Makes the project readable by anyone at /public/<id>. |
| Create release | Owner and editors. Freezes the saved files as an immutable release under the version in package.dlf, so other projects can import it. A version can be released only once. See Releases. |
| Dolfin files | The file tree and its toolbar. |
| ⚙ Package | Opens the package settings. |
On a tablet in landscape (600–1024 px wide) the sidebar opens as a drawer over the editor: swipe right from the left edge of the screen to open it, and swipe left on it or on the dimmed area beside it to close it. The same works on a public project page (/public/<id>).
Searching the project
Type at least two characters in Search…. Results come from every file and are labelled by kind: concept, property, rule, fact or comment, with the file and line. Click a result to open the file at that line. Escape clears the search.
Case is ignored. Several words separated by spaces must all appear: has part finds hasPart, has_part and has-part first, then hasSomePart (words in order with a gap), then partOfHas (words in any order). Comments include #@ annotations. Each file shows at most 50 results.
The row of kind icons above the results hides or shows each kind (concept, property, rule, fact, comment); the file and folder counts then count only the shown results. All kinds are shown again for each new search.
Click ~ at the right of the field to turn on fuzzy matching: the letters you type only need to appear in order, so prsnm finds personName. Fuzzy results come after all regular ones, best match first. The toggle is off by default and your choice is remembered. Starting the query with ~ also turns fuzzy matching on for that search, without changing the remembered toggle; the ~ button shows as pressed while it applies.
File tabs
Each file you open gets a tab above the editor. Click a tab to switch, click its ✕ to close it. The ‹ at the left of the tab bar hides the editor so the output panel takes the full width; the thin › rail brings it back, and so does opening a file. Your choice is remembered. Both appear only while the editor and output sit side by side; on a touch screen the editor starts hidden until you show it once. When you view an old version from History, a purple Diff: file @ version tab appears; closing it returns to the live file. The mapping form opens under a teal Mapping N: file or New mapping: file tab the same way.
In a project imported from Turtle, a sync status chip sits at the right of the tab bar. See Keeping Turtle and Dolfin in sync.
Saving
There is no save button. Every edit is saved automatically a moment after you stop typing. The editor header shows Saving…, then Saved (or Save error).
Compiled output (Turtle, diagram, graph, problems) follows the saved source.
Resizing
- The strip between the editor and the output panel resizes both. Drag it, or focus it and use ← / →. Double-click it (or press Home) to reset the split.
- The top edge of the Problems panel resizes it; click its header to fold it.
Both sizes are remembered in your browser.
On a phone or tablet
Below 600px wide, and on a tablet held upright (portrait, up to 1024px), the workspace shows one pane at a time. The bar at the bottom of the screen switches between Files, Code, View (the output panel) and Problems; the Problems button shows the error count. Opening a file, a problem or a graph node’s source jumps to Code. The last pane you chose is remembered. A public project page (/public/<id>) has the same bar, Problems included (read-only; when a file does not parse, the mapping checks (S050/S051) are skipped and the panel says so); it always opens on View with the graph, and does not change the pane your own projects remember.
Held sideways (landscape), a tablet keeps the editor and the output side by side with the resize strip between them; the file list opens from the left edge.
An empty project
A project with no file of its own offers two ways to start:
- Start from an example: Library (books, members and loans: concepts, enums, facts, a rule and a query) or People (one concept, one enum, a few facts). The example becomes an ordinary file you can edit.
- Paste or import existing Dolfin: Paste Dolfin… opens a box where you name the file and paste its source, then Create file.
Nothing is deployed until you press Deploy.
Package settings
⚙ Package replaces the editor with a form over the project’s package.dlf, a file that is hidden from the tree:
| Field | Notes |
|---|---|
| Package name * | Required. Used by Deploy and to name the Turtle download and the zip export. |
| Dolfin version | The language version the package targets. |
| RDF version | RDF 1.1 (default) or RDF 1.2: how reified properties are written in the RDF output. See rdf_version. |
| Package version * | Required. Your own version number (semver, for example 1.2.0). The Turtle download is named <name>-<version>.ttl. |
| Author | Free text. |
| Tags | Comma-separated keywords (the manifest’s tags line). Saved lowercase, spaces become -, duplicates are dropped. On a public project they show on its card and people can find it by #tag on the Public projects page. |
| Description | One line per language. The small box is a language tag (en, fr, pt-BR); leave it blank for an untagged description. |
| Imports | One row per imported ontology. See Imports. |
| Reasoning | Which inferences the package runs. See Reasoning. |
Imports
+ Add import adds a row. Its first box picks where the import comes from:
- Project: pick a project (project · owner), then one of its versions; the version list shows only
--version--until a project is picked. Projects are grouped under Your projects (yours and those shared with you) and Public projects, minus the ones this project may not import (a public project can only import public releases). The row writesimport <package-iri> "version". - URL: type the address of a Turtle or RDF/XML file, or pick a well-known vocabulary from Browse… (RDF, RDFS, OWL, SKOS, Dublin Core, FOAF, PROV-O, Schema.org, DCAT and more). The second box is the IRI the import goes by; left blank, it is the URL. The row writes
import <iri> from <url>. - Text: edit the raw
importline. A line the other two cannot show opens here.
Under a Project or URL row, the line it will write is shown. Saving locks each import to what it resolves to, and the row then shows Locked, Failed with a reason, or a choice when several releases match. Only a Locked import is visible to your files.
Using imported names in your files
An import is project-wide, but each .dlf file that uses its names declares a prefix for it first:
prefix com.acme.hr.person as hr
concept Team:
has lead: one hr:Employee
For a project import, the namespace is the imported project’s package path followed by one of its file names (com.acme.hr + person.dlf → com.acme.hr.person). For a URL import, prefix <http://xmlns.com/foaf/0.1/> as foaf works. The language reference explains how namespaces are named, alias, and the rules.
In the editor, typing hr: lists the names that import defines, and hovering an imported name shows its label, IRI and imported from … (see The Dolfin editor). A name the import does not define is reported in the Problems panel.
Reasoning
Automatic (recommended) is on while package.dlf has no reasoning line. The sentence under it says what Automatic picks for the current files, and why: for example RDFS + OWL, because link is symmetric, or RDFS only.
Turn it off to choose yourself: the RDFS and OWL boxes appear, ticked as Automatic had them, and the form writes the matching reasoning line. Unticking both writes reasoning none, and the form warns that only the package’s own rules then run. Turning Automatic back on removes the line. A value the form does not recognise is shown as such and kept until you tick a box.
What each profile infers is in the language reference, under Reasoning. Viewers see the section but cannot change it.
The form tells you whether there are unsaved changes. Save package settings writes them to package.dlf. Closing the form with unsaved changes asks whether to Discard them or Keep editing.
Files
The Dolfin files tree in the sidebar lists the project’s files. package.dlf is not in it: edit it through ⚙ Package.
A file opens in the editor that matches its extension:
| Extension | Editor |
|---|---|
.dlf | The Dolfin editor. |
.ttl, .turtle, .n3 | The Turtle editor. |
.md | A 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. |
.csv | A table, see CSV files. |
.json, .xml, .gpx | A folding tree, see JSON and XML files. |
Toolbar
| Button | Action |
|---|---|
| Collapse all | Folds every folder. |
| Import | Files… 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 zip | Downloads 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.JSONandUP.TTLare accepted likeAirport.csv..dlfand.mdstay 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 previewcomment 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:
| Item | Action |
|---|---|
| ✏ Rename | Edits 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. |
| Delete | Deletes the file at once. |
Right-click a folder:
| Item | Action |
|---|---|
| + New file here | Creates a file in that folder, ready to be renamed. |
| Delete folder | Deletes 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:
| Key | Action |
|---|---|
| ↑ / ↓ | Previous / next row. |
| Home / End | First / last row. |
| → | Opens a folder, then moves into it. |
| ← | Closes a folder, or moves to the parent folder. |
| Enter | Opens the file, or toggles the folder. |
| Space | Toggles the folder. |
| F2 | Renames the file. |
The Dolfin editor
.dlf files open in the Dolfin editor. It checks your source as you type, completes names, explains symbols and fixes common mistakes for you.
As you type
| Feature | Behaviour |
|---|---|
| Highlighting | Keywords, names, literals and comments are coloured. Names are coloured by what they are (concept, property…), not only by syntax. |
| Diagnostics | Errors and warnings are underlined, with a marker in the gutter. Hover the underline to read the message. Hints (for example trailing spaces) are not underlined: they are listed in the Problems panel only. |
| Completion | Keywords, and the concepts and properties of the whole project. After a prefix over an import, such as hr:, only the names that import defines. When a keyword such as date is typed where a name belongs, the escaped form `date` is offered too. |
| Hover | Hover a name to see its declaration and its description. When descriptions exist in several languages (#en>, #fr>…), the one shown follows your order in Settings → Languages. Hovering a prefix shows the IRI it expands to. Hovering an imported name shows its label, its IRI and imported from <IRI>@<version>. |
| Indentation | Two spaces. Tab indents the selection, Shift+Tab un-indents it. |
| Comment continuation | Enter on a comment line (# ), a language-tagged comment (#en> ) or an annotation line (#@ ) starts the next line with the same prefix. Backspace right after a bare prefix removes the whole prefix. |
| Reference count | A faint line such as 3 references sits above each concept, property, rule and query declaration. It counts uses across the whole project, not the declaration itself, so 0 references flags an unused name. Click it to list the uses and jump to one. It refreshes each time the file is re-checked, and is shown in read-only files too. Once the declaration is on screen, a count from the project’s saved files is added: 12 instances for a concept (inferred and subclass ones included), the rows a rule’s match: block finds, the rows a query returns, or 5 uses for a property (the triples that use it), each shown as 1000+ past 1000. It updates after each save, and is left out when the count cannot be computed. |
| Folding | Click the arrows in the gutter to fold a declaration, a run of annotations or a group of language-tagged comments. |
Quick fixes
When a problem has a mechanical fix, the editor offers it in two places:
- A line reading 💡 fix — click to insert above the affected block. Click it to apply the fix.
- The tooltip of the underlined text, which lists the same fix as a button.
The fix is also a button on the problem’s row in the Problems panel. A fix may edit another file, or create one: Declare concept Person in people.dlf adds the declaration to people.dlf.
Right-click menu
Right-click in the editor. What the menu shows depends on where you click.
| Item | Shown when | Action |
|---|---|---|
| ✂ Cut / ⧉ Copy | Text is selected. | Clipboard. |
| # Copy name | On a name. | Copies the name as written, for example people.Person. |
| ▢ Select word | On a name. | Selects it. |
| ▢ Select block | Inside a declaration. | Selects the whole declaration (a concept, property, fact…). |
| 🕸 Reveal in graph | On a name. | Switches the output panel to Graph, centres the node and highlights it. |
| 🐢 Reveal in turtle export | On a name, in an ordinary project. | Switches to the Turtle tab and highlights the Turtle generated for that declaration. See Reveal. |
| 🐢 Reveal in turtle source | On a name, in a project imported from Turtle. | Opens the original .ttl at the matching statement. See Reveal. |
| ⇄ Open in mapping editor | Inside a mapping block, for people who may edit the project. | Opens that block in the mapping form. |
| ⎘ Paste | Always. | Pastes the clipboard. Your browser may ask for permission first. |
| ⌖ Go to definition | On a name. | Jumps to its declaration, opening the other file if needed. Same as F12. |
| ℹ Peek info | On a name. | Shows the hover information in a popup where you clicked. Escape closes it. |
| 🔗 Find all references | On a name. | Lists every place the name is used, declaration included. Click one to go there. |
| ✎ Rename symbol | On a name. | Asks for a new name and renames the declaration and every use, in every file. |
The Go to definition, Peek info, Find all references and Rename symbol items appear once the language service has started, a second or two after the page loads.
The Turtle editor has a shorter menu.
To edit a mapping block in a form instead, right-click inside it and choose ⇄ Open in mapping editor, or right-click the file in the file tree and pick the mapping: see The mapping form. Its Edit as text button brings you back here, at the block.
Keyboard
The usual editing keys work: undo and redo, search and replace, bracket matching. See Keyboard shortcuts for the full list.
On a phone or tablet
While you type in a Dolfin file on a touch screen, a row of keys sits on top of the on-screen keyboard: { } : -> ; " Tab Esc Undo Redo. Swipe the row sideways if it does not fit.
- Tab indents, or accepts the open suggestion (on a desktop keyboard Tab only indents).
- Esc only closes the suggestion list; your cursor and selection stay put.
- Undo and Redo follow the shared undo when you edit a file together, so they never undo someone else’s edits. They do nothing when you can only view the file.
- A key acts when you lift your finger, so scrolling the row never types.
The row does not appear in Markdown or Turtle files, in history diffs or source views, or with a mouse.
Editing together
When someone else has the same file open, you see their cursor and selection in their colour, labelled with their name, and their edits appear as they type. Undo only undoes your own edits. See Collaboration.
Who can edit
On a project shared with you as Viewer, the editor is read-only: you can select, copy, hover, search, reveal and go to definition, but Cut, Paste, Rename symbol and quick fixes are not offered. The same goes for an Editor whose plan does not include editing shared projects. See Collaboration.
On a phone or tablet (touch screen, up to 1024 px wide), a file opens read-only, so scrolling does not bring up the keyboard; tap Edit in the bar above the code to start editing. Without edit rights there is no Edit button.
The mapping form
The mapping form builds a mapping block for a CSV, JSON, XML or spreadsheet data file by pointing and clicking. It writes ordinary Dolfin into a .dlf file: the text is the only copy, and the form is another way to look at it. What the form saves is exactly what the formatter would print.
Opening it
- New mapping: right-click a
.csv,.json,.xml,.gpx,.xlsx,.xlsmor.odsfile in the file tree and choose ⇄ New mapping from file…. Pick the.dlffile to write into at the top of the form. It defaults to the open file when that is a.dlf, else to the first.dlfof the project by name. A project with no.dlffile yet asks you to create one first. - Existing mapping: right-click a
.dlffile. Each mapping in it is listed as ⇄ Mapping 1: Airport.csv, ⇄ Mapping 2: …. Choose one to open it. A mapping marked (text) opens in Edit as text only. - From the editor: right-click inside a
mappingblock of an open.dlffile and choose ⇄ Open in mapping editor. If you just edited the block and the change is not saved yet, a message says so: try again a moment later.
The form opens in the editor pane, under a tab such as New mapping: Airport.csv or Mapping 1: airports.dlf. Its ✕ or the form’s Close button closes it without saving.
The right-click menu, and so the form, is only offered to people who may edit the project.
The three columns
| Column | What you do there |
|---|---|
| Source | For a CSV, its header and first 20 rows. Click a header to bind it to a variable, click it again to unbind. Bound headers are highlighted. A spreadsheet shows one sheet the same way: see Spreadsheet sources. A JSON or XML file is shown as a tree instead: see JSON and XML sources. |
| Variables | One line per bound column or path. Rename a variable here (latitude → lat) or remove it with ×. A header (or a JSON key, an attribute or an element name) becomes a lowercased name with every character other than an ASCII letter or digit replaced by _ (Stop name → stop_name), with a _ in front of a leading digit, col for an empty header, and _2, _3… when the name is taken. |
| Target | The facts each row produces. Per fact: a prefix picker and the subject template (the variable chips below it insert {?id}), the class after a, then one row per property: the property, a value (a variable picked from the list, or any constant), and a cast (int, float, boolean, date, string, or no cast). The cast is pre-filled from the property’s type when the project declares it. + add property and + add fact add rows, × removes one. |
A subject or value that mentions a variable no binding defines (after a rename, say) is flagged in red under it: Unknown variable ?x.
Spreadsheet sources
An .xlsx, .xlsm or .ods file is read on the server; the form shows one of its sheets like a CSV file: the header and the first 20 rows, with headers to click. Above the table:
- sheet lists the workbook’s worksheets in order, hidden ones included. (first worksheet) leaves the
sheetline out, and the mapping reads the first worksheet. Picking a sheet writessheet "Stops". - header row is the sheet row number of the header, as the spreadsheet application numbers it. Rows above it are skipped. Empty, it leaves the
header rowline out, and the header is the sheet’s first used row. Typing3writesheader row 3.
Cells are shown as a deploy reads them: dates as 2024-01-01, numbers without a trailing .0, an error cell as its code (#DIV/0!). Blank rows are skipped. The language reference explains how cells become text.
Changing the sheet keeps your bindings: a header the new sheet lacks shows up as an error in the preview, as for a CSV file. A sheet that is empty shows This sheet is empty.; a missing sheet, an empty header row or a file that is not a valid workbook shows the reason under the controls.
Spreadsheets need an Agrafe server built with spreadsheet support (agrafe.dolfin.fr is). Without it they cannot be imported, and a spreadsheet mapping opens in Edit as text only.
JSON and XML sources
A .json, .xml or .gpx file is shown as a tree, and the form writes the path form of the mapping: a for each line and one path per variable.
- for each. A node that can say what a row is carries a for each button: a JSON array (shown as
[*] each of 3 items) or an XML element. Elements repeated under one parent are marked (repeated): they are the usual choice. Click for each to make that node the row, click it again to go back to one row for the whole document. The current choice is shown above the tree. - Binding a value. Click a leaf to bind it, click it again to unbind it. A JSON leaf is a single value (string, number,
true/false,null); an XML leaf is an attribute (@id) or an element’s text (text()). Objects and elements with children are not leaves: bind the values inside them. An array of plain values is a leaf too, with a note that a binding takes its first value unless that array is the for each. - Paths. Each binding is written relative to the for each: with
for each "$.venue[*]", the city is"$.location.city"; withfor each "/transport/bus", the bus number is"@id"and its name"name/text()". A leaf outside the for each is dimmed and cannot be bound. Choosing another for each rewrites the bound paths for it; bindings that fall outside it are removed, and the form names them. - Order. JSON object members are listed in alphabetical order, the order the reader uses; array items keep the file’s order. The tree merges the items of an array, so a key only some items have is still listed.
- XML namespaces. An element or attribute in a namespace is written with a prefix the
.dlffile declares for that namespace, such ash:itemafterprefix <http://h.example/ns#> as h. Without such a line the node is shown greyed out with a hint, and nothing under it can be bound: add theprefixline to the file the mapping is written into and the tree updates. See Namespaces for how prefixes resolve. - Large and broken files. The tree reads the first 20 items of each array and of each repeated element, up to 400 nodes, and says so when it shows a sample. A file that is not valid JSON or XML (including an XML file with a DTD) shows the parser’s error instead of the tree; the other columns stay usable.
The language reference explains what a path matches, and the XPath subset mappings accept.
Suggestions
Once a fact has a class the project declares, the form matches the CSV headers (or, for JSON and XML, the names of the leaves under the for each) to that class’s property names (ignoring case, camelCase, snake_case, dashes and spaces, and tolerating a prefix, a missing word or a small typo, such as lat for latitude) and lists the matches under Suggested from the source, as dimmed rows under the fact’s properties. Accept binds the header or leaf if needed and adds the property row with the cast its type calls for; Accept all does it for every row; Dismiss hides one while the form stays open. Nothing is added to the mapping until you accept it. Headers and leaves a property row already reads, and properties already present, are not suggested. Only properties with a literal type (string, int, date…) are suggested: a property whose type is a concept needs an IRI, not a cell.
The MCP tool draft_mapping builds the same kind of draft for a whole CSV file.
Preview
Once a value is bound and a fact exists, Preview (first 20 rows) below the columns expands the mapping over the first 20 rows as you edit (CSV records, or matches of the for each; a spreadsheet mapping expands its whole sheet), and shows the Turtle it produces with a summary such as 3 rows → 2 facts · row 2: empty value for required binding ?id. When several rows are skipped, the summary names the first and adds (+2 more skipped); a skip is named before any warning on an earlier row, and when no row is skipped the summary names the first row with a warning instead.
A row with a bad value, such as an empty cell the subject needs or a cell a cast cannot read, is skipped whole, as a deploy would skip it. Skipped rows are shown in red in the source table, with the reason on hover, and listed under the table or the tree (row 2 is the second match of the for each). Errors that concern the whole mapping, such as a template that does not parse, are shown in the preview. The language reference explains which values skip a row.
Saving
Save writes the block into the chosen file (a new mapping is appended, an existing one is replaced in place), shows Mapping saved, refreshes the graph and closes the form. If the save is refused, the reason is shown above the columns and your draft is kept.
If the mapping you opened is no longer where it was in the file (a collaborator edited or removed it, or removed a mapping above it), saving is refused with a message asking you to reload. Click Reload: if the mapping only moved, the form follows it and you can save again. If it was edited, removed, or can no longer be shown in the form, the form closes and asks you to reopen it from the file tree.
Edit as text
Edit as text opens the .dlf file at the mapping in the Dolfin editor. Some blocks cannot be shown faithfully in the form: a comment inside the block, a sheet or header row line outside a spreadsheet mapping, a for each in a CSV or spreadsheet mapping, an is … of or a … line in a fact, a value with several entries or a nested [ … ], a where: block or a case table. Those open as a short notice with only Edit as text and Close, so saving from the form never drops anything.
Problems, hints and quick fixes
The Problems panel runs along the bottom of the workspace. It lists what is wrong, or could be better, in every file of the project, not only the open one.
Reading the panel
The header sums up the project: ❌ 3 errors, ⚠ 2 warnings, or ✓ No problems. Click the header to fold or unfold the panel; drag its top edge to resize it.
Below, problems are grouped by file. Click a file name to fold its group. Each row shows:
❌ 14:12 unknown property `titel` in fact `hobbit` [Replace with `title`]
did you mean `title`?
| Part | Meaning |
|---|---|
| Icon | The severity, see below. |
line:col | Where the problem is. Click the row to open the file at that spot. |
| Message | What is wrong. |
| Button | A quick fix, when there is one. |
| Second line | A hint on how to fix it, when the checker has one. |
While your latest edit is being checked, the list is dimmed with ⟳ updating… and cannot be clicked, so you never apply a fix to a problem that is already gone.
Severities and filters
| Icon | Severity | Meaning | Filter |
|---|---|---|---|
| ❌ | Error | The project does not compile, or compiles to something wrong. | Errors |
| ⚠️ | Warning | Compiles, but is probably a mistake or breaks a convention. | Warnings |
| 💡 / ℹ️ | Hint / Info | Style suggestions. They are listed here but not underlined in the editor. | Hints |
Untick a filter to hide that severity. The counts in the header always include everything.
The file tree also shows error and warning counts next to each file.
Quick fixes
A problem with a mechanical fix has a button on its row, labelled with what it will do. Click it to apply the edit. The same fix is offered in the editor, as a 💡 … — click to insert line above the block and in the tooltip of the underlined text (see The Dolfin editor).
A fix can change another file than the one with the problem. It is saved like any edit, and the problem disappears once the project is checked again.
Fix all next to a file name applies every quick fix listed for that file. Fix all in the panel header applies every quick fix listed for the whole project. Both follow the filters (Errors, Warnings, Hints, Validation): only what the panel shows is fixed. When two fixes touch the same text, only one is applied; the next check offers the other again. Fix all applies quick fixes only, not the full re-layout of radeau fmt.
If the server check fails, a red note next to the checkbox says why: the Validation run timed out, a mapping cannot run at all (Data validation failed: Mapping source not found: stops.csv), or a file fails to load. A Validation failure goes away on the next run or when you untick Validation. A mapping or load failure is reported whether Validation is ticked or not, until it is fixed. The MCP get_problems tool returns the same text as fact_error.
| Fix | Offered for |
|---|---|
Declare concept X | A reference to a concept that does not exist. Adds concept X to the current file. |
Declare concept X in file | The same, when the name points to another file of the project (for example animals.Dog). Adds the declaration at the end of that file. |
Create file and declare concept X | The same, when that file does not exist yet. |
| Replace with ‘…’ / Replace with qualified name ‘…’ | A misspelled type or property that is close to an existing one. |
| Rename to ‘…’ | A concept not in PascalCase or a property not in camelCase. Renames the declaration and its uses. |
Wrap word in backticks to use it as a name | A keyword used where a name is expected, for example has date: date. Turns it into `date`. Not offered when no name could go there (e.g. concept Foo is). |
Add any (field may be absent) | A fact misses a field declared with no cardinality keyword, which means required. Adds any before the field’s type, in the file that declares it. Not offered for a field from an import, or when the field is not written name: Type with one space after the colon. |
| Remove trailing whitespace | Spaces at the end of a line. |
| Remove extra blank lines | More than two blank lines in a row. |
What is checked
Besides syntax errors, which come with a hint when the parser can guess what you meant, the checker reports the following. For what the language allows, see the Dolfin language documentation.
Errors
| Message | Why |
|---|---|
| Unresolved type ‘X’ in … of ‘Y’ | A field, sub or range names a type that is not declared. When a close name exists, the message ends with Did you mean …? and a fix is offered. |
concept X has circular inheritance (S003) | X is, through sub, its own ancestor. |
| Duplicate property ‘p’ in concept ‘X’ | The concept declares has p twice. |
unknown property p in … | A query, rule or fact uses a property that does not exist. When a close name exists, the hint line says did you mean …? and a fix is offered. |
| Silent variable ‘?_x’ cannot appear in the return block of query ‘q’ | ?_ variables mean “value not needed”; they cannot be returned. |
| Query ‘q’ composes undefined query ‘r’ | A query builds on a query that does not exist. |
| Query ‘q’ has a circular composition dependency | Queries that compose each other in a loop. |
hr:X is not defined by import <iri> | The prefix points into an import, but that import does not define X. Imports are not transitive: a name the importee itself imports is not reachable through it. |
| Ambiguous imported namespace ‘p’; use an IRI prefix instead | Two imports map to the same dotted name. Write the prefix as prefix <namespace-iri> as p. |
| Alias ‘a’ targets ‘t’, which no import defines and the package does not declare | The alias target does not exist. |
| Alias ‘a’ clashes with a declaration of the same name | Rename the alias or the declaration. |
| S040: rule ‘r’ … so it cannot be materialized: every query on a deployment would fail | A rule, a key (the key of ‘C’) or an equivalent to concept depends on itself, or concludes a key merge, a sub or a sub-property, through an aggregate (sum, min, max, average, count) or a negation (none, all), directly or through other rules. The message names them. Deploy refuses such a package. Drop the aggregate or negation from the cycle. The check runs on the server after each save and when the project opens, not while you type, and needs no Validation checkbox: it materializes the rules with the same reasoner as the deployment queries, which the in-browser checker does not have. It only sees the package’s schema, so a refusal that depends on the data (a key merging two facts only after an aggregate) shows at Deploy only. |
S041: rex is a OverweightDog but fails with weight: > quantity(40 kg) | A fact asserted to be an instance of a concept defined with equivalent to does not satisfy one of its with lines. It is underlined on that with line. Listed only while Validation is ticked, like S017 (see Validation). Fix the fact, or drop its asserted type. |
Warnings
| Message | Why |
|---|---|
| Concept ‘x’ should be PascalCase | Naming convention. Fix: Rename to ‘X’. |
| Property ‘X’ should be camelCase | Naming convention. Fix: Rename to ‘x’. |
| Enum variant ‘x’ should be UPPER_CASE or PascalCase | Naming convention for the values of a one of: block: RED or Red, not red. No automatic fix, pick one style yourself. |
| Prefix ‘p’ is declared but never used | Leftover prefix line. |
| Variable ‘?x’ in rule ‘r’ appears only once | The variable neither joins two match lines nor reaches then. Usually a typo. If it is on purpose, name it ?_x. |
| Variable ‘?x’ in query ‘q’ appears only once | Usually a typo. If it is on purpose, name it ?_x. |
`=` / `!=` on a quantity is unreliable after unit normalisation | Two equal quantities in different units may not compare equal. Use >, <, >= or <=. |
| S050: row 2: empty value for required binding ?id / S051: iteration path ‘$.venues[]’ matched nothing* | A mapping diagnostic (S051). Shown in the .dlf holding the mapping, on the binding’s map: line or the mapping from line, with an info entry S050: N row(s) skipped when rows were skipped. Checked on the server after each save and when a data file changes or is uploaded; needs no Validation checkbox. A mapping that cannot run at all (a missing data file) shows in the note instead. |
| S055: sh:sparql on PersonShape: validated by the server only | A form capability entry: a SHACL construct the derived form does not render. Points at the field’s has line or the concept. Never an error. |
Hints
| Message | Why |
|---|---|
| Trailing whitespace on line N | Fix: Remove trailing whitespace. |
| Too many consecutive blank lines | Fix: Remove extra blank lines. |
| Declarations should come after all prefix declarations | Put prefix lines at the top of the file. |
When the project does not compile
The outputs keep the last version that compiled, dimmed, with a note such as Showing the last valid graph; the current source doesn’t parse yet. Open Problems to see what to fix. The Turtle download is disabled until the errors are fixed. See Compiled output.
The panel lists the compile error first, as Project does not compile: …, even when files also have errors. Those are often its consequences (an Unresolved type in another file), so fix the compile error first.
Form capability report
At deploy, Agrafe derives one form per concept from the project’s SHACL
shapes. Some SHACL constructs have no form widget. The deriver records each
one in the form’s capability report: the construct (sh:sparql,
sh:and, …), the node shape that holds it, the path of the field it applies
to (if any), and what the form does instead. The report is served with the
forms by GET /api/data/:id/form-specs, as each spec’s capabilities
list. A form with no such construct omits the capabilities key.
S055 warnings
The Problems panel lists every report entry as an S055 warning, source
forms:
| Message | Meaning |
|---|---|
| S055: sh:and on PersonShape/age: not rendered, the field is rendered read-only | The field is shown with its value but cannot be edited. |
| S055: sh:or on PersonShape: not rendered, checked on the whole form | No single field hosts the constraint. It is checked when the whole form is validated. |
| S055: sh:pattern on PersonShape/email: not rendered, checked by the validator | The field renders as usual. The validator enforces the constraint. |
| S055: sh:sparql on PersonShape: validated by the server only | See below. |
A concept’s sub parent gives no warning: the parent’s fields are part of the form.
Each warning points at the Dolfin declaration behind the shape:
- the field’s
hasline, when the entry has a path. For a nested path, the field is the path’s last step. - else the concept’s name. Inverse, alternative and repeated paths name no field, so they point at the concept.
- else
package.dlf.
The check runs on the server after each save. It needs no Validation checkbox.
Validated by the server only
Shapes with sh:sparql (from a concept’s check conditions) need SPARQL.
The validator in the browser runs without SPARQL, so only Agrafe’s write gate
checks them, when the form is submitted. The field stays editable.
In Formol
A form whose report has entries shows a note under its title: Some constraints are checked by the server on submit. Read-only fields are shown greyed out with their value and cannot be edited; the required-field check skips them. A form with no entries shows neither.
Public share-link forms behave the same. A link only receives the fields and report entries of the fields it exposes.
Never blocking
S055 is a warning. It never counts as an error, and never fails a build, a
deploy or the “project has errors” check.
Compiled output: Parse, Turtle, SVG
The output panel on the right of the workspace has seven tabs. This page covers the first three, which show what the compiler makes of your source. The others are Graph, SPARQL, Deployments and History.
The ? at the end of the tab bar starts a short guided tour of the tabs.
Output follows the saved source
Every tab updates a moment after your edit is saved. When the source stops compiling (you are half-way through typing a concept, say), the tabs do not go blank: they keep the last output that compiled, dimmed, under a note such as:
Showing the last valid Turtle; the current source doesn’t compile yet, so the download is disabled. Open Problems to see what to fix.
The reason is in the Problems panel. When nothing has ever compiled, the tab says so instead.
Parse
The parse tree of the open file: the syntax exactly as the compiler reads it. Useful to check how an indented block or an annotation was understood.
If the file has syntax errors, the tab lists them instead, each with its Ln, Col position (click it to jump there) and a hint when there is one.
Turtle
The whole project compiled to RDF Turtle, with syntax colouring: exactly what a deployment serves and what the triple store holds for your schema. Named queries of the project appear as # Query: … blocks.
- ⬇ Download .ttl saves it as
<package name>-<package version>.ttl(both come from the package settings). The button is disabled while the output is out of date. - Reveal in turtle export, in the editor’s right-click menu, switches to this tab and highlights the block generated for a declaration. See Reveal. A folded block opens first.
- Search: type in the box above the Turtle. Matching is case-insensitive, all matches are highlighted and the count shows
current/total. Press Enter for the next match, Shift+Enter for the previous one, or use ‹ / ›. Esc clears the search. A match inside a folded block opens that block. - Fold: click ▾ on a file header, a declaration block or a rule to fold it to its first line; ▸ opens it again. Each file header with rules also has a [Rules] toggle that folds or opens all of that file’s rules at once. Folds stay as they are when the project recompiles. Folding only changes the view: Download .ttl and copy always give the full text.
SVG
A diagram of the open file: its concepts, their fields and the relations between them.
| To | Do |
|---|---|
| Pan | Drag the background. |
| Zoom | Scroll, or use the + / − buttons at the top right. |
| Zoom into an area | Ctrl+drag (⌘+drag on a Mac) a rectangle. A plain Ctrl+click zooms in one step. |
| Zoom out | Ctrl+Shift+drag a rectangle: the current view shrinks into it. A plain Ctrl+Shift+click zooms out one step. |
⬇ Download .svg saves the diagram as <file name>.svg.
When other people have the project open, their visible area can be shown as a labelled frame. Right-click the SVG tab to Show others’ viewports or Hide others’ viewports. See Collaboration.
For an interactive view of the whole project, use the Graph tab.
Graph
The Graph tab draws the whole project as an interactive graph. You can rearrange it, navigate from it to your source, and act on concepts and files through right-click menus.
What you see
| Shape | Meaning |
|---|---|
| Box with a header and rows | A concept. Each row is a field (has …) with its type and cardinality. |
| Rounded box | A property declared on its own whose domain or range is in another file, outside the project, a union, or missing. |
| Small square | A union type such as (Cat or Dog), used as a range or a field type. |
| Frame around boxes | A file: every node declared in one .dlf is grouped in the frame, labelled with the file name. |
| Line | Meaning |
|---|---|
| Thick, arrow | sub: the concept is a subclass of the one it points to. |
| Thin, arrow | has: a field pointing to its type. |
| Dashed, arrow | The range of a property. |
| Dotted | A member of a union. |
A concept or property box shows its label (the label / pref_label of its #@ glossary: block) in your preferred language, or its name when it has none. When the labels exist in several languages, a language picker appears at the top right: pick one to relabel the boxes, or Default to go back to your preferred language. Your choice is remembered, and Pangloss uses the same one. Field rows and arrows keep their names.
Nodes that do not belong to the open file are faded, so the file you are working on stands out. Hover a node to read its description. Hover a property (an arrow, a field row inside a box, or a property node) to read its # comment. A field or arrow without its own comment shows the comment of the top-level property of the same name, marked [inherited]. With neither, you see its signature, Domain -> Range, with cardinalities.
Moving around
| To | Do |
|---|---|
| Pan | Drag the background. |
| Zoom | Scroll (towards the pointer), or Zoom in / Zoom out in the magnifying-glass menu at the top right. The menu stays open, so you can click them several times. |
| Zoom into an area | Ctrl+drag (⌘+drag on a Mac) a rectangle. A plain Ctrl+click zooms in one step. |
| Zoom out | Ctrl+Shift+drag a rectangle. A plain Ctrl+Shift+click zooms out one step. |
| Move a node | Drag it. |
| Move a whole file | Drag its frame. |
| Tidy by hierarchy | Arrange by hierarchy, in the magnifying-glass menu at the top right, lays out each file’s concepts top-down, with every parent above its sub-concepts, then places the files so that a file whose concepts extend another file’s sits below it. |
| Start over | Reset layout, in the magnifying-glass menu at the top right, puts every node back where Agrafe first placed it. |
Arrange by hierarchy only follows the parent / sub-concept links. Concepts with no such link, property nodes and union nodes are set together in a block next to the trees. The result is saved like a layout you made by hand (on the public page or as a viewer it stays on your screen only), and you can move boxes afterwards. Reset layout still returns to Agrafe’s first placement.
The layout, zoom included, is saved with the project when its owner or an editor moves it: you find it as you left it, and so do the people you share the project with. A viewer’s moves last until the page is reloaded.
Going to the source
Hover a node: a ⌖ target appears at the right of its header. Click it to open the file at the declaration.
From the editor, right-click a name and choose Reveal in graph: the Graph tab opens, centres on the node and highlights it.
Right-click a node
| Item | Action |
|---|---|
| ⌖ Go to… | Opens the file at the declaration. Only for nodes that come from your source. |
| 🔗 Get references | Lists every place in the project where the name is used, with the line of source. Click one to go there. |
| 🕸 Show neighbors | Lists every node directly linked to this one (parents, children, field types, ranges…). Click one to go to its declaration. |
| 🆔 Copy id | Copies the node id, for example animals:Dog. |
| 📋 Copy label | Copies the displayed name, for example Dog. |
| ◎ Center in view | Pans so the node is in the middle, keeping the zoom. |
| ✏ Edit… | Opens the declaration’s source (header and body) in a box. Change it and Save (Ctrl+Enter). An edit that does not parse is refused and the box stays open. |
| 🔤 Rename | Turns the name on the node into a text box. Enter renames, Escape or clicking elsewhere cancels. Renames the concept or property and every reference to it, in every file of the project. Files that do not parse are left as they are, and named in a message. |
| ➕ New sub-concept… | Creates a concept with this one as its parent, in the same file. Concepts only. Typing the name of an existing concept offers Link instead: it adds sub <this concept> to that concept, in whatever file declares it. It is refused when that concept is already a sub-concept of this one, or when linking would make a cycle. |
| ↗ Add property… | Adds a has name: type line inside the concept (cardinality optional: one string). If the concept has no body yet, it gets one. Concepts only. |
| ➕ New sub-property… | Creates a standalone property with a sub line pointing at this one. Properties only. |
| 🗑 Delete… | Removes the declaration, with its body and the # comment just above it. The box says how many references elsewhere will stop resolving. |
A property declared in the same file as its domain and range is drawn like a has of its domain: property owns: Owner -> Dog is an owns arrow from Owner to Dog, and property age: Dog -> int is an age: int row in the Dog box. It keeps a rounded box of its own when its domain or range is in another file, or when the domain already has a has of the same name.
Right-click a property arrow
A has line draws an arrow from the concept to the property’s type. Right-click the arrow or its label for the same menu, acting on that has line: Go to… opens it, Copy id gives animals:owner, Edit… shows the line with its axioms, Rename puts a text box on the label and renames the property everywhere it is used, New sub-property… proposes the arrow’s concept and type as domain and range, Delete… removes the line, and Center in view centres on the arrow.
An arrow or field row drawn from a property declaration has the same menu, acting on that declaration: Go to… opens it, and Edit…, Rename and Delete… change the property itself.
Right-click a file frame
| Item | Action |
|---|---|
| ✏ Rename file… | Opens a box with the file name (the folder is kept). Enter renames, Escape cancels. |
| 🗑 Delete file… | Asks for confirmation, then deletes the file. This cannot be undone. |
| ➕ Add concept… | Creates a concept (name, optional parent) at the end of the file. |
| ↗ Add property… | Creates a standalone property name: Domain -> Range at the end of the file, outside any concept. |
The round + button at the top left of the graph opens a menu with Concept and Property, which do the same in the open file.
Drag to connect two concepts
Point at a concept: a small blue handle shows on its right edge (on a touch screen, tap the concept first). Drag the handle onto another concept, or back onto the same one for a property that points to itself. The concept under the pointer is outlined and the arrow snaps to it. Release, type the property name in the box that opens, and press Enter: a property name: Source -> Target line is added at the end of the source concept’s file.
Release on empty space instead to get a choice: New concept here + property asks for a concept name and a property name, creates the concept at that spot, then the property pointing to it. Cancel drops the gesture.
Escape cancels at any time, during the drag or in the name box. Dragging the box itself still moves it. Concepts outside the project (dashed boxes) have no handle.
Edit a property’s domain or range
Click (or tap) the domain end or the range end of a property arrow, or any small operator square of its type expression (an (A or B) group, a nested group, a not), to open a box with that whole type as it is written in the source. Type a new type expression: names are suggested as you type (Tab takes the first one), and the and, or, not buttons insert the keyword at the cursor; ( ) wraps the selection in parentheses. Press Enter or Apply to rewrite the type in the .dlf file; anything else on the line (cardinality, comments) stays. An expression that does not parse, such as (A or B) and C without the outer parentheses, is refused with the reason shown in the box, which stays open. A has line’s range can be edited this way; its domain is the concept it sits in. A type spread over several lines (a with block) is edited in the editor.
Build a composite class
To give a property a type such as (Dog or Cat) without typing it, build it on the canvas first.
- Select classes. Shift+click a concept, or a small square standing for a type expression, to add it to the selection or take it out. Shift+drag on empty space draws a rectangle that adds every box it touches. On a touch screen, long-press a concept to add it (long-press a selected one to get its menu). Selected boxes get a thick outline. A click on empty space, or Escape, clears the selection.
- Combine. The Combine: buttons under the + button create a draft: and or or with two or more classes selected, not with exactly one. The draft is a dashed square above its classes, linked to them like the other type squares; point at it to read the whole expression. The new draft is selected, so it can be combined again: select it with another class and press or to nest it, as in
(Pet and (Dog or Cat)). Combining the same classes the same way again selects the existing draft. - Use it. A draft has the drag handle of a concept: drag from it, or onto it, to create a property with the draft as its domain or range. The box that edits a domain or range lists the drafts too; a click inserts one at the cursor. Only then is the expression written to the source (
(A and B),(A or B),not A, nested groups in parentheses), in the file of the draft’s first class. The dashed draft then becomes a regular square. - Discard. Discard removes the selected drafts, and the drafts built on them.
A Dolfin file has no place for a class expression nobody uses, so a draft that no property uses stays in your browser only: it disappears when the page reloads, and nobody else sees it. Renaming or deleting one of its classes in the source discards it. Drafts are not offered on a public project, nor to project members who can only view.
Every change is written to the .dlf source, then the graph redraws. People with the file open see the change in their editor right away, and it appears in the file’s history like any other save.
If you have the file open in the editor, Ctrl+Z (⌘+Z on a Mac) there undoes your graph changes, one step per change, like your typing. A drag that creates a concept and a property is two changes, so two steps. Changes made by other people never land on your undo list.
The editing items and buttons are not offered on a public project.
Right-click the Graph tab
When other people have the project open, right-click the Graph tab title to choose what you see of them:
| Item | Action |
|---|---|
| Show / Hide others’ viewports | A labelled frame for the area each person is looking at. |
| Show / Hide others’ mouse | A dot with their name where their pointer is. |
Nodes someone else drags move on your screen too. See Collaboration.
When the graph is empty or dimmed
- Compiling the graph…: the graph is being compiled (on opening the project, and after each save until it lands).
- Graph renders here after save: the project’s file list could not be loaded (reload the page).
- No concepts to draw yet. Write a
conceptand save.: the project has no files, no Dolfin source, or compiles but declares no concept. - The graph needs source that parses.: nothing has compiled yet; the Problems panel says why.
- A dimmed graph under Showing the last valid graph… is the last version that compiled.
Instances
The Instances tab, next to Graph, draws the data of your project rather than its schema: each instance is a circle, and each property linking two instances is an arrow from subject to object.
Picking concepts
Nothing is drawn until you pick at least one concept.
- With nothing picked, the row of suggestions lists every concept of the project.
- Once you pick one, the suggestions narrow to the concepts a property links to what you picked, in either direction (the concept is the property’s domain or its range). Each suggestion names the property, for example
Dog via owns. - Click a suggestion to add it. Click × on a chip to remove it, or Clear to start over. Clear also drops the picked properties.
- On a phone the chips fold into an N selected ▾ button: tap it to show them over the graph, and Done (or Escape) to fold them again.
Picking properties
Once a concept is picked, a Properties: row lists the properties that have a picked concept as domain or range. Each one says which side the picked concept is on: domain, range, or both. The other end of the property does not need to be picked.
- The properties drawn between the picked concepts (those with at least one link between two drawn instances, a link from a concept to itself included) show as property chips, as if you had picked them. At first every link is shown.
- Click × on such a chip to hide its links. The property goes back to the Properties: row; click it there to show its links again. Hiding all of them leaves the instances without links.
- Pick another property from the row to add its links too. The instances drawn do not change: they still come from the picked concepts.
- Removing a concept also drops the picked and hidden properties that no picked concept offers any more. Clear resets them all.
What the data holds
Once a concept is picked, the suggestions are checked against the live data (the same store the arrows are drawn from), counted over all the picked concepts together:
- A count badge on a concept is how many of its instances are linked to an instance of a picked concept, in either direction. On a property, it is how many triples use it with a picked instance as subject or object; hover the badge for the split (
out/in). - A dimmed suggestion is one the schema allows but the data has none of yet. You can still pick it.
- A data only tag marks a concept or property the data links to what you picked although the schema does not offer it, for example a property with no declared domain or range on that concept. It has no
viaor side hint. A picked data-only property narrows links like any other.
While the counts load, or if they cannot be had (a note then says why), the suggestions show as plain schema suggestions. With nothing picked there are no counts: every concept is listed as before.
For what a domain and range are, see the language documentation.
Each concept keeps its colour. The circles of its instances, its chip and its suggestion dot all use it.
What is drawn
- Instances of the picked concepts in the live package (your saved sources, with RDFS reasoning), labelled with their
rdfs:label, else the last part of their IRI. Hover a circle for a card with its IRI, concept and literal values (up to 20, long values shortened; labels are not repeated). Click a circle to pin its card; see Why does a fact hold? for its Why? buttons. - Links only between two drawn instances, through the picked properties if any. Each arrow is labelled with its property name; arrows between the same two instances spread their labels apart. Hover an arrow for the full link.
- At most 200 instances. Past that, a note says the view is truncated.
- With a mouse over the graph, it zooms in so circles keep the same size whatever the graph’s size; the view follows the mouse, reaching the graph’s left edge at the panel’s left edge and its right edge at the right (same top and bottom). Move the mouse out to see the whole graph again. Dragging a circle keeps the zoom where it was. On touch screens the whole graph stays shown.
Merged and hidden links
- Two links of the same property in opposite directions between two instances are drawn as one double-headed arrow.
- When the schema declares two properties inverse of one another (
owl:inverseOf), a link and its inverse between the same two instances are drawn as one double-headed link, labelled with one of the two properties. Hover it to see both triples. - For a transitive property (
owl:TransitiveProperty), a link implied by other links through drawn instances is hidden: only the transitive reduction over the drawn instances is shown. If the middle instance is not drawn, the link stays. Links on a cycle all stay.
Tick Show all links (next to Clear, once a concept is picked) to turn off the last two rules and draw every link: inverse pairs as two links, transitive shortcuts included. It is a debugging aid, off by default and remembered by your browser.
Hierarchy
When a drawn link uses a property whose domain and range are the same concept, or one is a subconcept of the other (partOf: Part -> Part, ancestorOf: Person -> Person), a Hierarchy picker shows above the graph. It lists those properties, transitive ones first. Pick one to draw it as a tree:
- Roots (instances with no incoming link of that property) are drawn biggest. Each level down, circles, names and that property’s links get a quarter smaller. Other links keep their usual length.
- An instance’s level is its longest path from a root, so the two branches of a diamond agree. Instances on a cycle share one level. Instances with no link of that property keep their usual size.
- The ⇅ button flips the direction: roots at the subject end of the links (
ancestorOf), or at the object end (partOf). - Circles stop shrinking at 6 px and names at 9 px. A circle at that floor shows its name only in its hover card.
- none (the default) draws the graph as usual. The pick is remembered per project by your browser. If the property is no longer offered, the graph is drawn with none.
The tab refreshes on every save while it is open. When the project does not compile, it says so instead of drawing anything. The Problems panel tells you why.
SPARQL
The SPARQL tab runs read-only SPARQL 1.1 SELECT and ASK queries, either against your current work or against a deployment, without leaving the editor.
Choosing what to query
The first drop-down picks the data:
| Choice | Queries |
|---|---|
| Live: current package (default) | The project as it is saved right now, compiled on the fly: schema and facts. Nothing needs to be deployed. |
| v3 · 1a2b3c4d · 120 triples | One of the project’s deployments: its schema, facts and all the data written to it through the API. (inactive) marks a deployment that is not active. |
In both cases the project’s rules and its reasoning profile are applied, so inferred triples are part of the answer. A deployment uses the profile it was deployed or last updated with, the live entry the current one.
Writing and running a query
- The
@prefixdeclarations of the Turtle tab are added to your query for you, so you can writeex:Bookwithout aPREFIXline. For a deployment, they use the IRIs that deployment was published with. - Run the query with the button or Ctrl+Enter (⌘+Enter on a Mac).
- A
SELECTshows a table. IRIs are shortened toprefix:nameand quantities shown as value unit; hover a cell for its full value. AnASKshows ASK → true or false. To show aSELECTanother way, see Result views.
Result views
The drop-down left of Download CSV picks how the result is shown. Table is always there. Graph appears for a SELECT with at least one IRI or blank node. Other views appear when the shape of the result fits them (below).
After a run, the panel shows the first view that fits the result, in the order Histogram, KPI, Line chart, Calendar heatmap, Bar chart, then Scatter but only when none of those fits, else the table. Graph, Matrix and Kanban are never picked for you, and Donut only for a COUNT or SUM (see below). A view you pick yourself is kept when you run the query again, including the live re-run on save, as long as the new result offers it; picking Table keeps the table. If the new result doesn’t offer your pick any more (for example Graph and a result with no IRI or blank node, an error or an ASK), the panel forgets it and picks for you again. The drop-down is greyed out while a query runs.
Besides the column types, the panel also reads the query itself: the outer GROUP BY and the aggregate behind each column (COUNT, SUM, AVG, MIN, MAX, SAMPLE, GROUP_CONCAT). This is what picks Donut for a COUNT or SUM, and Histogram for an integer key with a COUNT. Only the outermost SELECT is read: aggregates inside a sub-select, and expressions such as (COUNT(?x) + 1 AS ?n), count as plain columns. The result shows at once; the analysis arrives a moment later and may switch the view then, but never a view you picked yourself. If the query cannot be analysed, or the analysis fails, the view is chosen from the column types alone.
For a column whose cells are all IRIs, the panel also looks up whether they are the variants of an enum (a one of concept), in their declared order; this is what offers the Kanban view.
Choosing the view from the query
A comment line # view: <name> anywhere in the query picks the view the results open in, for example:
# view: bar
SELECT ?status (COUNT(?o) AS ?orders) WHERE { ?o ex:status ?status } GROUP BY ?status
Names: table, graph, kpi, line, calendar, bar, donut, histogram, scatter, matrix, kanban. Case and spaces do not matter (#VIEW:Bar), and text after the name is ignored.
- Only the first
# view:line counts. If its name is unknown, it is ignored. - The line must start with
#: a#inside an IRI or a string, or after other text on the line, is not read. - A view that does not fit the result (for example
kpion several rows, orgraphwith no IRI or blank node) is ignored without a message, and the panel picks for you as above. Graph, Donut, Matrix and Kanban can be asked for this way. - Running a new or edited query opens on its
# view:view, even after you picked another one. Running the same query again keeps a view you picked yourself. - Switching views never edits your query: the line stays as you wrote it, in the editor and in saved queries.
It works the same for saved and pasted queries. Named Dolfin queries will honour it once their generated SPARQL carries the line.
Graph
Graph swaps the table for an instance graph of every IRI in the results (all rows, all columns; literals are left out). Blank nodes are drawn too, dashed, with their links and literal values. It is the same drawing as the Instances tab: drag a node, hover to zoom and see its literal values, concept colours as picked there. Links are the properties between two result nodes. They follow the same merging and hiding rules as the Instances tab; Show all links, under the graph, turns them off (the choice is shared with the Instances tab). The Hierarchy picker shows above the graph too; its pick is shared with the Instances tab. Pick Table to go back. The graph follows a re-run, including the live re-run on save; if the new result has no IRI or blank node, the panel picks for you again. The download buttons still save the table. Large results (hundreds of nodes) lay out slowly.
Blank nodes are fetched by running the query again in the same request. If it uses LIMIT without ORDER BY, or sorts on a blank-node column, the graph may show other blank nodes than the table on the live package. A query with FROM, or a blank node bound inside GRAPH ?g, shows blank nodes without their links.
KPI
KPI appears when the result is exactly one row and every column is a number (xsd:integer, decimal, double, float and the derived integer types). One column shows as a big tile with the value over its ?name; several columns show as a strip of tiles. Values are shown as in the table; hover a tile for the raw value. An unbound cell doesn’t count against its column, but a column with no value, a text or IRI value, or a unit-bearing quantity ("42"^^unit:km) gives no KPI. The download buttons still save the table.
SELECT (COUNT(?b) AS ?books) WHERE { ?b a ex:Book }
Line chart
Line chart appears for a SELECT of 2 to 2000 rows with a column of dates (xsd:date, xsd:dateTime, xsd:gYear or xsd:gYearMonth; dates and date-times may be mixed in one column) and at least one numeric column (numbers as for KPI). If several columns hold dates, the first one is the time axis, and only that one has to be readable: if one of its values cannot be read as a date ("2024-13-45"^^xsd:date), the line chart is not offered for that result.
Each point is placed at its date: a gYear at 1 January of that year, a gYearMonth at the 1st of the month. A date’s timezone (2024-03-01Z, 2024-03-01+01:00) is accepted but not applied, so the point stays on the day as written; a date-time is placed at its UTC instant, and a date-time without a timezone is read as UTC.
Points are drawn in time order. Missing dates are not filled in: the line joins the points that exist. Each numeric column is its own line, in its own colour, named in the legend below the chart. An empty cell (or one that is not a number) is skipped for that line only; a row with no date is left out. The y axis always includes 0, so negative values go below the zero line. The x axis shows the first and last date and a few in between, as precise as the data: years only when every value is a year, months for year-months, hours and minutes when there is a date-time. Hover a point for its date as written and its value, with units as in the table. The footer counts the points drawn. The download buttons still save the table.
SELECT ?day (COUNT(?o) AS ?orders) WHERE { ?o ex:orderedOn ?day } GROUP BY ?day ORDER BY ?day
Calendar heatmap
Calendar heatmap appears next to Line chart (right after it; the line chart stays the one shown by default) when the result has exactly one numeric column besides its date column, and that column holds days:
- every value is an
xsd:date, or anxsd:dateTimeexactly at midnight (T00:00:00;T00:00:00.000counts too). A date-time likeT00:00:01orT12:00:00means no calendar for that result. Dates and midnight date-times may be mixed; - no day appears twice (a date and a midnight date-time of the same day count as twice);
- the last day minus the first day is 60 to 800 days (2024-01-01 to 2024-03-01 is 60).
A year (xsd:gYear), a year-month (xsd:gYearMonth) or any value that cannot be read as a date rules it out. The timezone is ignored: the day is the one written, so 2024-03-01T00:00:00+01:00 is 1 March and 2024-03-01Z too. A row with no date is left out. The view is offered on the span alone, so a few rows over a long span still get one, mostly grey.
Each week is a column, Monday at the top, with Mon, Wed and Fri on the left and the month names above the week where each month starts. Each day is a square in one of five shades of green by quintile of the values: the largest values are the darkest, values that are all equal are all the darkest, and 0 or negative values are shaded like any other. A day of the span with no row, or no value, is grey. Days before the first date and after the last one are not drawn. The legend below goes from Less to More, then No data. Hover a square for its date and value, with units as in the table. The footer counts the days with a row. A long span makes a wide grid: the results area scrolls. The download buttons still save the table.
# view: calendar
SELECT ?day (COUNT(?o) AS ?orders) WHERE { ?o ex:orderedOn ?day } GROUP BY ?day
Bar chart
Bar chart appears for a SELECT of 2 to 50 rows with exactly one column of IRIs, text or booleans (the key) and at least one numeric column (numbers as for KPI). A key column mixing IRIs and text counts as text. It is not offered for a date or dateTime key, two text or IRI columns, only numbers, or fewer than 2 or more than 50 rows. A column that is never bound (an OPTIONAL that never matches) counts as text: next to another key it rules the chart out; alone, every bar is (none).
Each row is one bar (rows are not added together), sorted from the largest value to the smallest, so it doubles as a leaderboard. Keys are shortened to prefix:name as in the table; an unbound key shows (none). The value is shown as in the table. Long labels are cut with …: hover a bar for its full key and value. Negative values go left of the zero line, in red; positive ones right, in blue. Rows with no value in the measure are left out and counted in the footer (N bar(s) · M skipped (no value)).
With several numeric columns, a drop-down above the chart picks the one the bars measure. It starts on the first numeric column for each new result. Many rows make a tall chart: the results area scrolls. The download buttons still save the table.
SELECT ?author (COUNT(?b) AS ?books) WHERE { ?b ex:author ?author } GROUP BY ?author
Donut
Donut appears for a result that has the bar chart’s shape (one key column of IRIs, text or booleans; an unbound key counts as (none)) with 2 to 7 rows, when a numeric column holds whole numbers (xsd:integer or a derived type: int, long, nonNegativeInteger…) in every row, all 0 or more and not all 0. A decimal, a negative value, an empty cell or more than 7 rows in that column rule it out for that column.
It is picked for you, instead of the bar chart, only when the query says that column is a COUNT or SUM (parts of a whole). With MIN, MAX or AVG, a column computed by an expression, or when the query cannot be analysed, it stays in the drop-down only: MIN and MAX give whole numbers too, and a donut of maxima is misleading.
Each row is one slice, largest first as in the bars, with the total in the middle (shown as in the table). The legend gives each key and its share of the total, for example Alice 42%: a tiny slice shows <1%, and shares are rounded, so they may not add up to 100. A row at 0 is listed in the legend without a slice. Hover a slice or a legend entry for its full key and value. Colours follow the theme.
With several whole-number columns that qualify, a drop-down above the donut picks the one it measures; columns that do not qualify are not listed. The download buttons still save the table.
SELECT ?status (COUNT(?o) AS ?orders) WHERE { ?o ex:status ?status } GROUP BY ?status
Histogram
Histogram appears when the query groups by exactly one variable (GROUP BY ?age), that column holds whole numbers (xsd:integer or a derived type) and another column is a COUNT, with 2 to 50 rows. Each key value is one bar, in ascending key order (1, 2, 10, not by count); an unbound key is (none), last. Hover a bar for its key and count. It is picked for you, before a scatter, the line chart or any other chart. It needs the query’s analysis (see Result views): without it, or with a SUM, a decimal key, a GROUP BY on more variables than one (even ones not selected), or a key value that repeats, it is not offered. The download buttons still save the table.
SELECT ?age (COUNT(?p) AS ?people) WHERE { ?p ex:age ?age } GROUP BY ?age
Scatter
Scatter appears for a SELECT of 2 to 2000 rows with 2 or 3 numeric columns (numbers as for KPI). The first numeric column is the x axis, the second the y axis, and a third, if any, sizes the bubbles: the smallest value gets the smallest bubble, the largest the biggest. Other columns (keys, dates) are ignored. With 4 or more numeric columns, fewer than 2 rows or more than 2000, it is not offered: rows are never cut to fit.
Each row is one point. A row with an empty cell, or a value that is not a number, in one of the plotted columns is left out and counted in the footer (N point(s) · M row(s) skipped (unbound or non-numeric)). Each axis goes from the smallest to the largest value, with a tick at both ends, so negative and decimal values need nothing special; when every value is the same, the points sit in the middle with one tick. Hover a point for its values, with units as in the table.
It is picked for you only when no other chart fits, for example two numeric columns and no key. With a key column the bar chart is picked and Scatter stays in the drop-down; with a date column the line chart is. The download buttons still save the table.
SELECT ?height ?weight ?age WHERE { ?p ex:height ?height ; ex:weight ?weight ; ex:age ?age }
Matrix
Matrix appears for a SELECT of at least 2 rows with exactly 2 key columns (IRIs, text or booleans, as for the bar chart) and exactly 1 numeric column, when each key column has at most 30 different values. An unbound key shows as (none) and counts as one value; an IRI and a text with the same spelling are two values. Three key columns, two numeric columns, or a key with 31 values or more: not offered. A date column is ignored.
The first key gives the rows, the second the columns, in the order they first appear in the result (so ORDER BY holds). Each cell is shaded in one of five shades of green, in equal steps from the smallest to the largest value (not from 0, so negative values are shaded like any other); if every value is the same, every cell is the darkest. A pair with no row, or only rows with no value, is grey. Several rows for the same pair are added together. Keys are shortened to prefix:name as in the table; long ones are cut with … and column names are slanted so 30 fit: hover a name for the full key, a cell for A × B: value. The legend under the grid shows the value range of each shade. A big grid scrolls.
It is never picked for you: choose it in the drop-down (or # view: matrix); the table stays the default. The download buttons still save the table.
SELECT ?author ?genre (COUNT(?b) AS ?books) WHERE { ?b ex:author ?author ; ex:genre ?genre } GROUP BY ?author ?genre
Kanban
Kanban shows the rows as cards on a board, one column per variant of an enum (a one of concept). It is offered for a SELECT with exactly one column whose values are all variants of one enum (the enum lookup of Result views), plus at least one other column. It appears in the drop-down a moment after the result, once both the query analysis and the enum lookup have answered; a pick made before that is kept until they have.
It is not offered when:
- the enum has more than 12 variants, or the result more than 500 rows;
- the outer
SELECThas aCOUNT,SUM,AVG,MINorMAX, even inside an expression such as(COUNT(?x) + 1 AS ?n), or only inHAVING.GROUP_CONCAT,SAMPLEand aggregates in a sub-select are fine; - the enum lookup failed or found no enum, or the query could not be analysed.
The columns follow the enum’s declared order, and a variant with no row is an empty column. When a row has no value in the enum column, a last (none) column holds it. Each card is titled by the first other column, in SELECT order; the remaining columns show below it as name: value. IRIs are shortened and quantities shown as in the table. Long text is cut with …: hover a card for every full value, a column header for the variant’s full IRI.
The board is read-only: no drag and drop. It is never picked for you, so pick it in the drop-down or ask for it in the query. The download buttons still save the table.
# view: kanban
SELECT ?room ?kind WHERE { ?r a hs:Room ; hs:name ?room ; hs:kind ?kind }
To see why a row of a query made only of triple patterns holds, use its Why? button. See Why does a fact hold?.
Downloading the results
Download CSV and Download XLSX, above the results, save the table of the last SELECT you ran as a file: the same query (with its added prefixes), the same columns in the same order, all rows. IRIs are prefix:name as in the table; in the XLSX file numbers, booleans and dates are real Excel cells. The file is named after the query picked in Saved queries…, else results. The buttons are greyed out until a SELECT succeeds; an ASK has no table to download.
It works for the live package and for a deployment, also in a public project’s read-only view. From your own code, use format=csv or format=xlsx on the deployment endpoint, see Deployments.
Saved queries
The second drop-down, Saved queries…, has two groups:
| Group | Where it comes from |
|---|---|
| ◈ name | Queries declared in the project’s Dolfin source. They follow the source, unsaved edits included, and cannot be deleted from here. The server compiles the project for them when you open the tab and again after each edit; meanwhile compiling project queries… shows next to the list, and the page stays usable. When the project does not compile, a ⚠ project queries unavailable note appears; hover it for the compile error. |
| Plain names | Queries you saved with the save button. They are stored in this browser only. The delete button next to the list removes the selected one. |
Pick a query to load it in the editor box.
Pinning the clock
A deployment’s SPARQL endpoints (/api/data/<id>/sparql/public, see Deployments) take an optional now=<dateTime> in the URL query string, for example ?now=2026-06-15T12:00:00Z, also when the query itself is sent as the request body. It pins the clock of the package’s rules: an inferred class that uses now() (someone becoming able to vote at 18) is computed as of that instant. It is the same parameter as on the validate endpoint, so a query can reproduce a validation run. Default: the time of the request. An invalid value answers 400.
SPARQL’s own NOW() function, written in the query text, is not pinned: it is still the time of the request.
To query deployments from your own code, see the deployment’s API section in Deployments. To query them from an AI assistant, see Connecting AI assistants (MCP).
Why does a fact hold?
In the SPARQL tab, the result of a query whose WHERE is only triple patterns gets a Why? button on each row. It opens a panel next to the table that shows one proof of each fact of the row: the stored facts and the rules the reasoner used to reach it.
Where the button appears
Every row gets a Why? button when the query’s WHERE is a plain conjunction of triple patterns, whatever the variable names and however many there are, and the selected variables are exactly the variables of the patterns (SELECT * is fine). DISTINCT, ORDER BY, LIMIT and OFFSET are allowed. The simplest case:
SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 100
A query with several patterns works too:
SELECT ?who ?friend ?age WHERE { ?who ex:knows ?friend . ?friend ex:age ?age }
The row’s facts are the query’s patterns with the row’s values put in place of the variables. Here each row has two facts, who ex:knows friend and friend ex:age age. The panel shows one proof per fact, one under the other, each with its own Next proof. A query with one pattern shows one proof, as before.
There is no Why? column for a query with FILTER, OPTIONAL, UNION, MINUS, VALUES, BIND or (… AS ?x), a property path (ex:p/ex:q, ex:p*), a sub-query, GRAPH, SERVICE, FROM, GROUP BY or an aggregate, a blank node ([], _:b) in a pattern, a pattern variable that is not selected, or a selected variable that appears in no pattern (?x in SELECT ?s ?p ?o ?x WHERE { ?s ?p ?o }). The column names do not matter: ?s ?p ?o with a FILTER has no button, and ?Subject is not ?subject. A row with an unbound or blank-node value has no button. The public viewer of a public project has no Why? buttons.
In the Instances tab, click a circle (without dragging it) to pin its card. A pinned card lists the instance’s literal values and its outgoing links (property → target), each with a Why? button. Close it with ✕ or Esc. Long values that the card shortens, values shown with a unit (50 g), blank nodes and links to a blank node have no button. While a card is pinned it covers part of the graph: close it to reach the circles under it. The pin is also dropped when the graph is redrawn (new data, a refresh, a change of focus or of display options). The proof is computed on the live package. The SPARQL tab’s graph view has no pinned card and no Why? buttons: use the result table there.
The proof is computed on the data the result came from: the live package, or the deployment the query ran against. If you switch deployments and run again, the panel closes.
Reading the proof tree
Each line is one fact, with short IRIs. Hover a line to see the full IRIs. The fact you asked about is the top line. Under it are the facts it was proved from, and so on down to stored facts. The first two levels start open. Click a line, or its ▸ / ▾ arrow, to open or close it.
Each line has a chip that says why the fact holds:
| Chip | Meaning |
|---|---|
| file | A hand-written fact. In a deployment it reads “hand-written (snapshot)”. |
| mapping | A row of a mapped data file. Click the chip to open the file. |
| data | Data written at runtime through the data API. |
| source | A stored fact whose origin is not known: the live package, or a graph the deployment does not label. The tooltip names the graph. |
| rule | Derived by a rule. The rule’s name follows the fact. Click it to jump to the rule in the editor. Built-in RDFS and OWL rules (rdfs9, …) have no link. |
| closure | A subClassOf, subPropertyOf, sameAs or inverseOf chain, or a property path. Every step of the chain is its own line. |
| builtin | A built-in check or computation, such as a comparison. Its outcome follows it. |
| not | A negation (none / all) that held. |
| aggregate | A sum, count, min, max or average, with the values it used. |
A rule line also lists the variable bindings the rule used, such as ?x = alice. A rule that reads the current time (now()), directly or through a rule it uses, shows [clock] after its name: its conclusions can change as time passes.
A very deep or very large proof is cut. A cut line ends with ….
Other proofs
A fact can often be proved in more than one way. The panel shows Proof 1 first, which is the shortest one. Next proof shows the next one. When there are no others, the panel says No more proofs and gives how many there were.
When the reasoner finds no proof at all, the panel shows the Why not? tree instead.
Clicking Why? on another row shows that row’s first proofs.
Why not?
The Why not? tree explains a fact that is not derivable from current data and rules: where every way of deriving it stops. It never says the fact is false: only that the current data and rules do not produce it.
Asking
- Why? on a fact with no proof shows its why-not tree.
- Why not…? above the SPARQL results opens a small form. Type the subject, predicate and object (full IRIs, bare or in
<…>, or prefixed names such asex:Thingor:Thingusing the Turtle tab’s prefixes and the well-knownrdf:,rdfs:,owl:,xsd:,skos:;<ex:Thing>stays literal; a literal object in double quotes, matched by its text, never expanded) and press Ask. On a public project page only the well-known prefixes are read. A derivable fact shows its proof; an invalid term shows an error naming its position and quoting the term as typed (for exampleInvalid subject `not an iri`: …).
Reading the tree
Only the top line is open. Each line you open is computed when you open it, so a large or circular tree stays fast; a line shows Loading… meanwhile, and an error with Retry if it fails. Failed lines carry ✗, conditions that held carry ✓ (screen readers read “failed” / “succeeded”).
| Line | Meaning |
|---|---|
| goal | A fact or sub-goal to derive. Under it: the stored facts, then one line per rule that could conclude it. |
| no stored fact | No stored fact matches. Its near misses follow (see below). |
| no rule | No rule concludes this predicate: it only comes from data. |
| rule failed | The rule’s conditions have no solution. Conditions that held show ✓, the one where every attempt stopped shows ✗ and is highlighted. Click the rule name to open it in the editor. |
| group | Attempts that stopped at the same condition, with the values tried. +k more opens the full list (at most 200 lines are shown). |
| N rules not applicable | Rules whose conclusion cannot match this fact (a different constant). Closed by default; open it to list them. |
| builtin false | A check that does not hold, with its values (15 > 18). |
| negation blocked | A none condition failed because the formula has a solution; its proof is shown under it. |
| aggregate | A count, sum… whose value does not meet the requirement, or an empty set. |
| circular | The goal only depends on itself: there is no base case. |
| closure | A subClassOf, subPropertyOf, sameAs or type chain that never reaches the target. |
| untestable | In all-failing mode: a condition that needs values only other conditions bind, so it cannot be tested alone. |
Rules are described in the language docs.
All failing conditions
By default a rule line blames the condition where the reasoner stopped. Show all failing conditions tests each condition alone instead, and marks every one that fails (the button stays pressed). Switching it on or off closes the switches below that rule.
Near misses
Under no stored fact, the near misses are stored facts that share two of the three positions with the one you asked about: they often reveal a typo in an IRI or a value. Each has its origin chip; click the fact to see its own Why? proof. This replaces the whole panel with that one fact, even when it showed several facts of a row.
Errors and staleness
An engine error (such as rules that never reach a fixpoint) shows as an error, not as “not derivable”. The tree is recomputed on every opened line: after editing the project, ask again.
Keyboard
Both trees follow the same keys as the file tree:
| Key | Action |
|---|---|
| ↑ / ↓ | Previous / next line |
| Home / End | First / last line |
| → | Open a closed line, or go to its first child |
| ← | Close an open line, or go to its parent |
| Enter / Space | Open or close the line |
| Esc | Close the panel |
Limits
- Hand-written facts name no file. A deployment stores all hand-written facts together, so a deployment’s file chip cannot tell which
.dlfa fact came from, and it does not open anything. - Live origins are not known. On the live package, every stored fact shows the source chip (“graph default”).
- Rule links follow the current sources. On an older deployment, a rule that has since been renamed or removed cannot be opened. A message says “Rule not found in the current sources”.
- At most 201 proofs of one fact can be listed.
Deployments
Deploying compiles the project and publishes it behind a live write API: programs holding a token can then add triples that follow your schema, and query them with SPARQL.
Deploying
Press Deploy in the header of the Deployments tab, next to its title. The button is shown to the owner and editors only.
The first time for a project, Agrafe asks Publish this project? and shows what will go out: the package name and version, the number of files, and the endpoint POST /api/data/<deployment-id>/triples. Deploying uses the files as they are saved right now. Later deploys go straight through.
Then a dialog shows:
| Field | Notes |
|---|---|
| Deployment ID | Identifies the deployment in every URL. |
| Bearer token | Needed to call the API. Copy it now: it is not shown again. You can issue another one later. Shown to the project owner only: an Editor who deploys is told to ask the owner for a token. |
| POST endpoint | The URL to write triples to. |
| Try it | A ready-made curl command that writes one triple. |
Full API reference → opens the API section of the new deployment.
Each Deploy creates a new deployment with its own id and tokens. To publish changes under the same id, use Update instead. A deployment keeps the package’s reasoning profile as of its deploy or last update: its queries and validation do not change when the package’s reasoning line changes later. Deployments made before Agrafe stored the profile keep RDFS without OWL until they are updated. The number of active deployments depends on your plan.
Deploy and Update are refused with Deployment refused: … when the package’s rules cannot be materialized: a rule, key or equivalent to concept depends on itself through an aggregate (sum, min, max, average, count) or a negation (none, all), so every query on the deployment would fail. The message names the rules, keys or concepts involved. The same error shows in the Problems panel as S040. Releases are not checked.
The Deployments tab
Only people who can edit the project see Update; only the owner sees Tokens, + Token and the trash button (see Collaboration). Each deployment is listed with its date, its status (active or not), its version and its size, for example v2 · 184 triples (58 schema · 11 fact · 115 data).
| Button | Action |
|---|---|
| API | Shows the endpoints, the compiled schema and a tester. See below. |
| Tokens | Owner only. Lists the deployment’s tokens. + Token issues a new one, shown once. Revoke disables one for good. |
| Update | Recompiles the deployment from the current files and bumps its version, replacing its schema, rules, shapes and facts. The id, the tokens and the data already written are kept. A deployment is a frozen snapshot: editing the files changes nothing in it until you press Update (the MCP tool get_deployment tells whether it still matches the files). |
| Trash | Owner, or Editor with a Pro plan. Hold to delete the deployment, its tokens included. |
When the deployed package declares exports, the API section ends with an Exports list: one row per file (the sheets of a workbook are one file), with its format and a Download button. Download builds the file from the deployment’s current data, as GET …/exports/<file> does, and is recorded in the audit log under your account. Whoever can open the API section sees the list.
The API
The API section of a deployment lists its endpoints:
| Method | Endpoint | Use |
|---|---|---|
POST | /api/data/<id>/triples | Write triples. |
GET | /api/data/<id>/dolfin-file | Get the deployed schema compiled to JSON: base_iri, concepts (with their properties and types) and inverses, and nothing else. Derived forms are served by /api/data/<id>/form-specs. Needs a token. |
GET | /api/data/<id>/form-specs | Get the deployment’s derived forms as {"specs": [...]}, one per class: the class IRI as target_class, the form’s fields, and capabilities, its capability report. A spec with no unsupported constraint omits the capabilities key. {"specs": []} when the deployment has no shapes. Needs a token. |
GET | /api/data/<id>/client-validation | {"profile", "rules_n3", "shapes_ttl", "tbox_nt"}: what a form needs to apply the package’s rules and checks in the browser before saving: the reasoning profile, the rules (N3), the shapes (Turtle; without the generated rule shapes, whose rules are in rules_n3) and the schema triples (subclass, subproperty, domain, range, inverse, symmetric/transitive) as N-Triples. Needs a deployment token; share links cannot use it. |
GET | /api/data/<id>/graph-origins | {"snapshot_graph": …, "mapped_graphs": [...], "inferred_graph": "urn:agrafe:inferred"}: the graph holding the values declared in the package, and the source graphs built from its mapped data files. Values in those graphs cannot be changed through replace; see below. Values a rule derives appear under inferred_graph in GRAPH ?g and cannot be written. Needs a token. |
POST | /api/data/<id>/explain | {"triple": {"s", "p", "o"}, "k": 0}: proof k (an index, 0 = first, at most 200) of a fact, as on the Why? panel. Answers {"Proof": {…}}, "NotDerivable" or "NoMore". o is {"Iri": …} or {"Literal": {"value", "datatype", "lang"}}; a literal with neither datatype nor lang is matched by its text. 400 for k over 200, 422 for an invalid triple. Needs a token. |
GET | /api/data/<id>/sparql/public?query=… | Run a SPARQL SELECT or ASK query (URL-encoded). Needs a token. |
POST | /api/data/<id>/sparql/public | The same, with the query as the request body. Needs a token. Both take an optional now=<dateTime> in the URL; see SPARQL, and format= / name=, see below. |
GET | /api/data/<id>/validate | Check the data against the package’s conditions; see Validating data. Needs a token. |
POST | /api/data/<id>/validate/triples | Dry run: check the data plus a triples body, writing nothing; see below. Needs a token. |
POST | /api/data/<id>/derive/triples?concept=<class IRI> | The values the package’s rules derive for a form’s computed fields, from the data plus a triples body, writing nothing; see below. Needs a token. |
POST | /api/data/<id>/delta | Edit stored values: remove some triples and add others in one step, checked against the data version you read; see below. Needs a token. |
GET | /api/data/<id>/version | {"version": n}: the current data version, the base_version of a later delta. Needs a token. |
GET | /api/data/<id>/exports | List the package’s declared exports; see below. Needs a token. |
GET | /api/data/<id>/exports/<file> | Build one export file and download it. Optional now=<dateTime>. Needs a token. |
Three routes serve query builders such as Eqlat: GET /api/data/<id>/sparnatural-config.ttl gives the Sparnatural SHACL config, GET /api/data/<id>/prefixes gives the deployment’s namespace prefixes as {name: namespace} JSON, and GET /api/data/<id>/sparnatural-presets lists, for each field whose type is (C with p: = V), the p = V criterion Eqlat pre-fills once C is picked ([{field, end_class, restriction, value, value_class}], full IRIs). They need the deployment token, or no token when the deployment’s project is public. Without either the answer is 401, the same as for an unknown id; 403 comes with another deployment’s token, and 404 for an unknown id only with a valid token.
Every call needs the header Authorization: Bearer <token>. Public in sparql/public means any web origin may call it (CORS *), not that it works without a token. A call answers 401 without a valid one, 403 with another deployment’s token, and 404 for an unknown deployment id (with a valid token; without one it is still 401). SPARQL answers are application/sparql-results+json by default and only see this deployment.
SPARQL results as CSV or XLSX
A SELECT on sparql/public can come back as a file instead of JSON. Set format= in the URL, or send an Accept header; format= wins when both are given.
format= | Accept | Answer |
|---|---|---|
(none) or json | anything else | application/sparql-results+json, unchanged |
csv | text/csv | text/csv; charset=utf-8, UTF-8 with a BOM so Excel reads accents |
xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | an Excel workbook, one sheet results, header row in bold |
One column per projected variable, in the order of the SELECT (for SELECT *, the order the store reports). The header is the variable name, without ?. IRIs are written prefix:name with the query’s own PREFIX lines, then the deployment’s prefixes (those of GET /api/data/<id>/prefixes), else in full; numbers, booleans and dates are typed cells in XLSX; an unbound variable is an empty cell; a blank node is written _:id. All rows are returned.
The answer carries Content-Disposition: attachment; filename="<name>.<ext>": <name> is the name= URL parameter cut to letters, digits, _ and -, or results. For example:
curl -H "Authorization: Bearer $TOKEN" -o books.csv \
"$AGRAFE/api/data/$ID/sparql/public?format=csv&name=books&query=SELECT%20*%20WHERE%20%7B%3Fs%20%3Fp%20%3Fo%7D"
400 for an ASK query with format=csv or xlsx (there is no table), and for any other format= value. A CONSTRUCT stays an error as with JSON.
POST …/triples takes a JSON array of {"s": …, "p": …, "o": …} and writes all of them or none (422 with one error per rejected triple). It accepts a property of one of the package’s concepts with a value of its type, rdf:type of a concept, and rdfs:subClassOf declaring your own subclass (IRI subject, IRI object) of a concept or of another such subclass, declared in the same request or earlier; rdf:type of that subclass is then accepted too, and validation treats its instances as instances of the concept.
An int field takes a JSON integer from −2⁶³ to 2⁶³−1 and stores it as xsd:integer (42 → "42"^^xsd:integer, as the compiled package writes int). A float field takes a JSON integer or a number with a fraction or exponent, and stores it as xsd:double (3 → "3"^^xsd:double, 1.5 → "1.5"^^xsd:double); facts in the package’s .dlf files are xsd:float, and validation accepts both. Nothing is coerced: on an int field, 1.5, 1.0 (JSON keeps the fraction), a numeric string such as "42" and an integer beyond 2⁶³−1 are rejected with 422 (object value for <…> has wrong type (expected Int)), and a numeric string on a float field is rejected the same way. There is no decimal field type. The same rules apply to each member of a list of int or list of float.
A date, time, date_time or duration field takes a JSON string in the lexical form of xsd:date ("2024-05-01"), xsd:time ("13:45:00"), xsd:dateTime ("2024-05-01T13:45:00") or xsd:duration ("P1DT2H"); a timezone (Z, +02:00) and fractional seconds are accepted. Agrafe stores it as that typed literal ("2024-05-01"^^xsd:date). A malformed string is rejected. The seconds are required: "13:45" is not an xsd:time.
A quantity field (has weight: mass, see quantity types) takes {"value": <number>, "unit": "<unit IRI>"}, where the unit is a QUDT unit IRI of the field’s dimension, any unit of it, compound ones included:
[
{"s": "https://example.org/main#rex", "p": "https://example.org/main#weight",
"o": {"value": "3", "unit": "http://qudt.org/vocab/unit/KiloGM"}}
]
value is a JSON number or a numeric string. Agrafe stores "3"^^<http://qudt.org/vocab/unit/KiloGM>, keeping the value and the unit as sent (no conversion), and adds the unit’s QUDT description once (a qudt:Unit, rdfs:Datatype, qudt:conversionMultiplier, qudt:hasDimensionVector, qudt:symbol, qudt:hasQuantityKind) so that SPARQL filters and validation can compare values written in different units. A unit QUDT does not have (such as km/min) is named by an IRI under the project’s base IRI ending in unit/<unit>, as the compiled Turtle of the package writes it; those are accepted too. Units declared with unitdef in the package are not accepted yet. Old https://dolfin.dev/unit/… IRIs (https://dolfin.dev/unit/kg) are still accepted and rewritten to their QUDT IRI. A unit of the wrong dimension, an unknown unit, or another IRI is rejected.
A duration field, and any field of the time dimension, is stored as an xsd:dayTimeDuration: send an xsd:duration string ("PT20M") or a quantity with a time unit ({"value": 20, "unit": "http://qudt.org/vocab/unit/MIN"}), both stored as "PT20M"^^xsd:dayTimeDuration. Months and years ("P1Y") have no fixed length and are rejected.
A field whose range mixes literals and concepts (has x: string or Person, an sh:or / sh:xone in the deployment’s shapes) takes either an IRI string, for a concept member, or {"value": "<lexical form>", "datatype": "<xsd datatype IRI>"} for a literal member, stored as "<lexical form>"^^<datatype>:
[
{"s": "https://example.org/main#rex", "p": "https://example.org/main#x",
"o": {"value": "hello", "datatype": "http://www.w3.org/2001/XMLSchema#string"}}
]
The datatype must be one of the field’s literal members, and the lexical form must be valid for it ("abc" is no xsd:integer). Anything else is rejected with a 422. A plain string on such a field is always an IRI.
Data written before QUDT (literals typed https://dolfin.dev/unit/… and their dq: unit triples) is migrated by the migrate_quantities admin tool, which rewrites them to the QUDT form above and time values to xsd:dayTimeDuration. It is run by the Agrafe operators during maintenance; nothing is needed on your side.
A list of T field (see the grammar reference) takes its members as a JSON array, in order, each of type T:
[
{"s": "https://example.org/main#r1", "p": "https://example.org/main#stops", "o": ["a", "b"]},
{"s": "https://example.org/main#r2", "p": "https://example.org/main#stops", "o": ["a", "b"]}
]
Agrafe stores it as an rdf:List (rdf:first / rdf:rest, ending in rdf:nil; [] is rdf:nil), as a list written in .dlf facts, so two instances whose list keys hold the same members in the same order are owl:sameAs in SPARQL and in validation. The list cells are named urn:dolfin:list:… after the subject, the property and the members, so sending the same list again adds nothing. The value may also be the IRI of a list node the deployment already has (rdf:nil, or a node with rdf:first, such as cells written as .dlf facts); any other string, or an array member of the wrong type, is rejected.
A successful write answers 201 with {"written": n, "graph": "<IRI>"}: n counts the triples you sent, and graph is the named graph they went to, by default the deployment’s data graph urn:graph:deployment:<id>:data.
Writing a batch as its own source
To keep track of where a batch came from (a file, an import, another system), send the triples with a source object:
{
"triples": [
{"s": "https://example.org/data/book1", "p": "https://example.org/main#title", "o": "Dune"}
],
"source": {
"derived_from": "https://example.org/exports/books.csv",
"label": "Books export",
"agent": "https://example.org/people/alice"
}
}
The triples are then written to a new graph of their own, urn:deployment:<id>/source/<uuid>, returned as graph. Agrafe names it; you cannot choose it. derived_from is required and agent is optional; both must be IRIs. label is optional text of at most 500 characters, and a blank one is ignored. A source with an invalid IRI or too long a label answers 400 and writes nothing.
The new graph is part of the deployment’s data from then on: SPARQL and validation see its triples like any other, and GRAPH <its IRI> { … } reads it alone. Agrafe also records its provenance with PROV-O: prov:wasDerivedFrom the derived_from IRI, prov:generatedAtTime the time of the write (xsd:dateTime), prov:wasAttributedTo the agent if given, and rdfs:label the label if given. These are kept in the deployment’s internal manifest, not in its data, so SPARQL queries do not see them. The triples, the graph and its provenance are written together or not at all.
The plain array form keeps writing to the data graph.
Replacing stored values
To edit an existing instance, add replace, a list of {"s": …, "p": …} pairs, to the {"triples": …} body (with or without source):
{
"triples": [
{"s": "https://example.org/data/book1", "p": "https://example.org/main#title", "o": "Dune Messiah"}
],
"replace": [{"s": "https://example.org/data/book1", "p": "https://example.org/main#title"}]
}
Before the triples are written, every stored value of each pair is removed, in the same step: from the data graph and from the source graphs written through the API. Pending submissions are not touched. A pair with no new triple removes its values. A list value goes with the cells only it uses; a cell that another value also reaches (a shared list tail) stays.
Each s must be a subject of the batch, s and p must be IRIs, p must not be the inverse direction of a property (name the attached one), and there are at most 1000 pairs; otherwise the answer is 400 and nothing is written. When a pair has a value declared in the package (.dlf facts) or built from a mapped data file, the answer is 409 and nothing is written: change it there instead. GET …/graph-origins names those graphs. POST …/validate/triples takes the same replace, so the dry run checks the data as it would be after the edit, with the same 400 and 409.
Listing and deleting source graphs
GET /api/data/<id>/sources lists the deployment’s source graphs with their provenance, oldest first (by generated_at):
{
"sources": [
{
"graph": "urn:deployment:<id>/source/3f2c…",
"derived_from": "https://example.org/exports/books.csv",
"generated_at": "2026-11-01T09:30:00.000Z",
"agent": "https://example.org/people/alice",
"label": "Books export",
"triples": 42
}
]
}
agent and label appear only when the batch gave them. triples counts the quads of the graph, so a list of T value counts its list cells too, as written does.
DELETE /api/data/<id>/sources/<uuid> deletes one, naming it by the last part of its graph IRI (the uuid after /source/), to undo a bad import:
{"deleted": "urn:deployment:<id>/source/3f2c…", "removed": 42}
removed is the number of quads that were in the graph. The graph’s triples, the graph itself, its provenance and its entry in the deployment’s manifest are deleted together or not at all, and SPARQL and validation stop seeing them at once. A uuid that is not one of this deployment’s source graphs (already deleted, or another deployment’s) answers 404; something that is not a uuid answers 400. Only source graphs can be deleted this way: the deployment’s snapshot and data graphs cannot. Both calls take the deployment token, like the other calls; the token is issued to the deployment’s owner and has no narrower scope, so whoever holds it can delete sources. Each delete is recorded in the audit log.
Reviewing pending submissions
Submissions through a share link with quarantine on are stored as pending graphs (see Submitting a form). They are not queried until the owner reviews them. These calls take the deployment token, like /sources:
GET /api/data/<id>/pendinglists them as{"pending": [...]}, oldest first. Each entry has the same fields as a/sourcesentry, plus a content summary:subjects(distinct subjects) andtypes(distinctrdf:typeIRIs, sorted, at most 20). SPARQL cannot read pending graphs, so each entry also carries the submitted values indata: an array of{"subject", "predicate", "object"}, sorted by subject then predicate, at most 200 per graph. When a graph has more,truncatedistrueand the rest is still stored and approved with it.objectis one of{"Iri": "…"},{"StringLiteral": "…"},{"IntLiteral": 3},{"FloatLiteral": 1.5},{"BoolLiteral": true},{"TypedLiteral": ["<lexical>", "<datatype IRI>"]}(dates, times, durations, and quantities, whose datatype is the unit IRI) or{"List": [...]}: alist ofvalue comes back as its members in order, and therdf:Listcells themselves are not listed. The server-generatedqudt:triples describing a quantity’s unit are listed too.POST /api/data/<id>/pending/<uuid>/approveapproves one. Its graph becomes a source graph, listed by/sourcesand seen by SPARQL and validation at once. Its triples and provenance are kept as they are:generated_atstays the submission time. Answers{"approved": 1}.DELETE /api/data/<id>/pending/<uuid>rejects one. Its graph, its triples and its provenance are deleted, asDELETE /sources/<uuid>deletes a source. Answers{"rejected": 1, "removed": <quads>}.POST /api/data/<id>/pending/approveandPOST /api/data/<id>/pending/rejectdo the same for many, with body{"ids": ["<uuid>", ...]}(at most 500 ids). A batch is all or nothing: if one id is not pending, nothing is approved or rejected and the call answers404naming that graph.
The <uuid> is the last part of the graph IRI. An id that is not pending in this deployment answers 404. That includes an approved source, so these calls never delete live data. Something that is not a uuid answers 400. Each approval and rejection is recorded in the audit log.
Mapped data files
The output of each mapping block is a source graph too, one per mapped data file, not part of the snapshot graph. Its derived_from is the file, urn:dolfin:project:<project id>/file/<path> with ?version=<version> when package.dlf has a version (for example urn:dolfin:project:…/file/data/Airport.csv?version=0.1.0), and its label is the file’s path. These graphs are listed by GET /sources with the others. Every deploy and Update replaces them in one step: a re-mapped file’s graph is swapped for a new one (new uuid, no window without its data, no duplicates), and a file that is no longer mapped loses its graph. Sources written through POST /triples are never touched. Deleting a mapped file’s graph by hand only lasts until the next Update.
It also shows each concept with its properties, their type and whether they are required, an example request, and a Try it form: paste a token, fill in a subject, a predicate and a value, and Send writes that triple.
To explore the deployed data interactively, use the SPARQL tab.
Exports
A package can declare files to export with export (see the syntax reference). The declarations are taken from the deployed package: editing the project changes nothing until you press Update, which picks up new, changed and removed exports.
GET …/exports lists them, one entry per declaration (each sheet of a workbook is its own entry):
[
{"file": "out/people.csv", "sheet": null, "format": "CSV", "query": "people"},
{"file": "book.xlsx", "sheet": "People", "format": "XLSX", "query": "inline"}
]
query is the name of the query the export reads, or "inline" for a from: block. A deployment made before exports existed lists []; update it to get its exports.
GET …/exports/<file> builds <file> (as listed, slashes included) on the spot, against everything SPARQL sees: facts, mapped files, data written through the API and the rules. now=<dateTime> pins the clock of the rules, as on SPARQL and …/validate; a malformed value answers 400. The answer has the file’s Content-Type (text/csv; charset=utf-8, the XLSX type or application/json) and Content-Disposition: attachment; filename="<last part of the path>". A path the deployment does not declare answers 404; an export that cannot be built (a value its cast refuses, for instance) answers 422 with the reason. Tokens work as for the other calls (401, 403, 404).
curl -H "Authorization: Bearer $TOKEN" -OJ "$AGRAFE/api/data/$ID/exports/out/people.csv?now=2026-01-01T00:00:00Z"
Audit log. An export usually carries personal data out of Agrafe, so every successful download is recorded in the audit log (ExportDownloaded) with the deployment, the file path and the id of the token used (or, from the Deployments tab, the user). Neither the token nor its hash is recorded. Refused calls (401, 403, 404) and failed builds are not recorded. Keep this log in mind for your GDPR records: it tells who took which file and when.
Dry-run validation
POST …/validate/triples takes the same body as POST …/triples and answers the validation report of the stored data plus those triples, as if they had been written. Nothing is written: no triple, no count, no audit entry. Use it to check a form before submitting it.
The body is read exactly as …/triples reads it, so a request accepted there is accepted here. A source object is accepted and ignored. A triple that …/triples would reject gives the same 422 with one error per rejected triple, and no report. now= and format=turtle (or Accept: text/turtle) work as on …/validate.
The answer is the …/validate JSON, {conforms, results, skipped, warnings}. Each result has focus_node, the instance at fault, and path, its property, so a client can attach the message to the matching field. Both are in N-Triples form: an IRI is written <…>, so strip the brackets to compare it with your subject and predicate. For a Book whose title is one string, sending only its rdf:type:
{
"conforms": false,
"results": [{
"focus_node": "<https://example.org/data/book1>",
"path": "<https://example.org/main#title>",
"component": "MinCountConstraintComponent",
"severity": "Violation",
"message": "…",
"concept": "Book",
…
}],
"skipped": [],
"warnings": []
}
Adding {"s": "https://example.org/data/book1", "p": "https://example.org/main#title", "o": "Dune"} to the same request gives "conforms": true. The cardinality rules themselves are in the language reference.
Computed fields
A form field whose property a rule concludes is a computed field: at deploy, its entry in GET …/form-specs gets "editable": "computed". Formol shows it read-only and fills it in from the rules while the form is being filled in. Deployments made before this change get the marker when they are deployed again.
POST …/derive/triples?concept=<class IRI> takes the same body as …/validate/triples (source ignored, replace honoured) and answers, for the subject of the body’s first rdf:type triple, the values the rules derive for that concept’s computed fields: a JSON array of {s, p, o}, at most 200, the same shape as the triple of …/explain. Nothing is written. A body without an rdf:type triple answers 422; a concept with no computed field answers [].
POST …/explain also takes the draft: its body may carry triples and replace as …/validate/triples does, and the proof is then built over the stored data plus those triples. This is how a form explains a computed value that only exists in the draft.
Editing with a delta
POST …/delta changes stored data in one step:
{
"base_version": 4,
"delete": [{"s": "https://example.org/data/book1", "p": "https://example.org/main#title", "o": "Dune"}],
"insert": [{"s": "https://example.org/data/book1", "p": "https://example.org/main#title", "o": "Emma"}]
}
Both arrays take the triples of a …/triples body and are checked the same way. Either may be empty or left out. version is accepted in place of base_version. A source field is refused with 400: a delta’s inserts always go to the data graph. A third array, delete_subjects, lists instance IRIs to delete whole: every value they have in the data graph and in source batches, with their list cells. Triples where the instance is the object (references to it from other instances) are kept. If the package requires that reference (a one/some field, or any typed reference: the target must keep its type), the check below refuses the delete with 422, naming the referring instance; delete or change the reference in the same delta’s delete/insert.
- Version. Every write to the deployment’s data adds 1 to its data version:
…/triples, a delta, deleting or approving a source, a reload of the mapped data files, and a redeploy.…/triplesanswers it asversion, andGET …/versiongives it. Send the version you read the values at asbase_version. If the data changed since, the answer is409{"conflict": true, "current_version": 5, "base_version": 4, "conflicts": [{"subject": "…", "predicate": "…"}]}and nothing is written: read the values again and retry.conflictsnames each subject and predicate the delta touches whose stored values are no longer exactly the ones it deletes (an insert-only predicate: no longer empty). Send every stored value of a predicate you change indeleteso this test is exact. Eachdelete_subjectsentry is always listed, with"predicate": null. An empty list means only other data changed. - What a delete removes. Exactly the stored triple, in the data graph or in a source batch written through the API (with
source). A triple that is not stored is ignored. A value declared in the package, coming from a mapped data file or waiting in a pending batch of a share link cannot be deleted: that triple gets a per-triple error (below), even when a copy of it is also in the data graph, and even whenbase_versionis stale. An instance indelete_subjectswith any such value is refused whole ("set": "delete_subjects"): approve or reject the pending batch first. A deleted list value also removes its list cells. Inserts always go to the deployment’s data graph. - Check. The data as it would be after the delta is validated with the package’s rules. A delta that adds a
Violationis refused with422{"report": {…}}, the…/validatebody with only the new violations inresults. Violations already in the data, warnings and infos do not block. This is the rule of every API write gate, stricter than the plain…/validateconforms, which also counts violations already stored. Deleting a required value is such a violation. - Per-triple errors. A malformed triple is
422{"errors": [{"index": 0, "message": "…"}], "set": "insert"}, wheresetnames the array (delete,insertordelete_subjects) thatindexpoints into. Tell the two422answers apart by their key:errorsorreport. - Success is
200{"version": 5, "deleted": 1, "inserted": 1, "graph": "…"}. A delta that changes nothing answers the current version with0and0, and does not change it.
Form share links
A share link lets a Formol form be opened without an Agrafe account. Creating one does not open anything yet: the public form pages that accept a share link come later, and the link grants nothing else. It is a different credential from the deployment token: a share token starts with dls_, a deployment token with dlf_live_, and neither is accepted where the other is expected.
These calls are made as yourself, with an OAuth access token carrying the forms:share scope, not with the deployment token. Only the project’s owner and its Editors with a Pro plan (those who may edit the project) can use them. For an Editor without Pro, a Viewer, someone the project is not shared with, or a deployment that does not exist, they answer 404.
POST /api/deployments/<id>/share-links creates a link:
{
"allowed_concepts": ["Answer"],
"expires_at": "2026-12-31T23:59:59Z",
"max_submissions": 100,
"quarantine": true,
"public_reference_concepts": ["Country"]
}
allowed_concepts lists the concepts the form may create, by name or IRI, and must not be empty. expires_at (in the future) and max_submissions (at least 1) are optional. quarantine defaults to false. public_reference_concepts lists the concepts whose instances the form may show in its reference fields. It defaults to empty, and then those fields are hidden. For a Dolfin deployment, every concept must exist in the deployed schema. A bad body answers 400. The 201 answer is {"token": "dls_…", "link": {…}}. The token is shown only this once: Agrafe keeps only its SHA-256 hash.
GET /api/deployments/<id>/share-links lists the deployment’s links, newest first, revoked ones included. A link has id, deployment_id, allowed_concepts, expires_at, max_submissions, submission_count, quarantine, public_reference_concepts, revoked_at, created_by and created_at. The list never includes the token or its hash.
DELETE /api/deployments/<id>/share-links/<link id> revokes a link and answers 204. Revoking a link that is already revoked also answers 204, and its first revoked_at is kept. A link id that does not belong to this deployment answers 404. Each create and each revoke is recorded in the audit log, with the link id but never the token.
GET /api/forms/<share token> is the public side of a link: it needs no login and no Authorization header, and any web page may call it (CORS is open). It answers 200 with the form layout of the link’s allowed concepts only: for each one its name, iri, form (title, display property, fields), the properties those fields use, and its variants if it is a one of: concept. A reference field is kept only if its target is an allowed concept or in public_reference_concepts; such targets that are not allowed are listed under references with just their name, iri and variants. The answer also carries quarantine, and nothing about the project, the deployment or any other concept. A token that is malformed, unknown, revoked, expired or at its max_submissions, or whose deployment no longer exists, always gets the same 404, so tokens can’t be probed.
GET /api/forms/<share token>/instances/<concept> lists the instances a reference field can pick from. <concept> is a name or IRI (URL-encoded) of a concept in the link’s public_reference_concepts; being in allowed_concepts is not enough. It needs no login and answers 200 with up to 200 entries {"iri": …, "label": …}, sorted by label, and nothing else about the instances. The label is the value of the concept’s display property (see Forms in the language reference), or the last segment of the IRI when there is none. Any other concept, and every refusal of the token above, gets the same 404.
Submitting a form
POST /api/forms/<share token>/submit adds one form submission. Like the two calls above, it needs no login and any web page may call it. The body holds form values, not triples:
{
"concept": "Book",
"values": {
"title": "Dune",
"author": ["https://example.org/people/ann", {"nested": 1}],
"genre": "https://example.org/schema#Genre_Fiction"
},
"nested": [
{"concept": "Person", "values": {"name": "Frank"}}
]
}
concept is one of the link’s allowed_concepts, by name or IRI. values maps a field’s property name to its value, written as /triples takes it: a string, number or boolean, {"value", "unit"} for a quantity, {"value", "datatype"} for a literal member of a mixed union, or an array for a list of field. An array on any other field gives one value per member. nested holds “create new” instances, each of an allowed concept. A reference value is one of these:
- the IRI of an existing instance of an allowed concept or of a
public_reference_conceptsconcept; - a variant IRI of a
one of:concept; {"nested": i}, thei-th instance minted in this submission:0is the submitted instance itself, thek-th block ofnested(from 0) isk + 1.
A value for a computed field is never stored: the rules derive it. A submission that carries one is still accepted, without that value (older Formol versions may send it).
POST /api/forms/<share token>/derive takes a submit body and answers what the rules derive for the submitted instance’s computed fields that the public form shows, as …/derive/triples does. Nothing is written or counted, and _hp is ignored. A value for a computed field in the body answers 422. The work shares the server’s budget for anonymous live queries (PUBLIC_LIVE_MAX_CONCURRENT; over it, 503). A derived value can depend on stored data the form does not show (a rule may read referenced instances), so treat the computed fields of a publicly shared form as public.
Agrafe mints the IRI of every new instance (<base>/i/<uuid>) and adds its rdf:type. The client never names a subject, so a submission only ever adds new instances: it never changes an existing one. Only the properties of fields the public form shows are accepted. Any other key gets 422: a property of another concept, rdf:type, or a field hidden because its target is not shared. A reference to any other IRI also gets 422. The submission is then validated like /triples and checked against the SHACL shapes together with the stored data, as the dry run does. A violation on one of the new instances answers 422 with the same report as /validate, plus minted: the IRIs Agrafe minted for this submission, the submitted instance first, then each nested block in order (minted[i] is the instance {"nested": i} names). A client can so tell which block a result’s focus_node is. Problems already in the stored data do not block a submission.
An accepted submission answers 201 with {"instance": "<IRI of the submitted instance>"}. It goes to a new source graph whose only provenance is prov:wasDerivedFrom <urn:share_link:<link id>>. Agrafe records no IP address, account or browser. With quarantine on, the graph is stored as pending: it is listed under neither /sources nor in the SPARQL dataset, so no query sees it until it is reviewed. Each accepted submission counts toward max_submissions. A refused one does not. Once the link is at its cap, the next submission gets the same 404 as a revoked, expired or unknown token. Bodies over 64 KiB answer 413, and more than 50 nested blocks answer 422.
A form may carry a hidden decoy input named _hp (a honeypot) at the top level of the body. People never see it, so they leave it empty; spam bots fill it in. When _hp is a non-empty string, the submission answers 201 with a freshly minted {"instance": …}, exactly like an accepted one, but nothing is stored, it does not count toward max_submissions and it is not in the audit log. An empty _hp is ignored. A dead token still answers 404.
Rate limits
The /api/forms/<share token> calls are rate limited, before the token is even looked up, so a limit tells nothing about whether a token is valid. Over a limit, the answer is 429 with a Retry-After header and the same CORS headers as the other answers, so a browser form can read it. OPTIONS preflights are not counted. The limits are per minute, with bursts up to the same number:
| Limit | Default | Environment variable |
|---|---|---|
All GET and POST from one client IP | 30 | FORMS_RATE_LIMIT_IP_RPM |
All GET and POST on one share token, from any IP | 120 | FORMS_RATE_LIMIT_TOKEN_RPM |
submit from one client IP | 10 | FORMS_RATE_LIMIT_SUBMIT_RPM |
derive from one client IP | 60 | FORMS_RATE_LIMIT_DERIVE_RPM |
derive on one share token, from any IP | 600 | FORMS_RATE_LIMIT_DERIVE_TOKEN_RPM |
derive counts only against its own two limits, never against the other three, so a form that re-derives on every keystroke cannot use up the budget of its reads and submissions.
The client IP is the X-Real-IP header set by the reverse proxy, else the first X-Forwarded-For entry. When Formol shows a share-link form, its server makes these calls and passes the visitor’s IP in X-Real-IP. The Agrafe nginx config trusts that header only on /api/forms/ and only from the Formol server’s own addresses (set_real_ip_from: the host’s public IPv4 and IPv6, and loopback), so the limits count the visitor, not Formol. Any other caller’s X-Real-IP is replaced with its real address. Counters live in the server’s memory: they reset when it restarts, and are not shared between instances.
Validating deployment data (SHACL)
A deployment can check its data against the conditions of its Dolfin package: concept conditions (equivalent to … [ … ]), field value constraints, keys, derived fields and one of:. Agrafe compiles them to SHACL shapes when you deploy, then validates on request. For what each construct means, see the grammar reference.
The data checked is everything a SPARQL query of the deployment sees: the deployed facts, the triples written through the API, and what the package’s rules and its reasoning profile infer from them (without domain and range typing). Validation never changes the data.
Inferences are recomputed for every validation and every query, never stored. A condition that depends on now() (someone turning 18) is therefore always up to date: there is nothing to redeploy or refresh when time passes.
The endpoint
| Method | Endpoint |
|---|---|
GET or POST | /api/data/<id>/validate |
It needs the header Authorization: Bearer <token> with a token of this deployment, as for triples (see Deployments). Without a token the answer is 401, with another deployment’s token 403, and an unknown deployment 404.
Optional parameters, in the query string:
| Parameter | Effect |
|---|---|
format=turtle | Answer with the report as RDF (sh:ValidationReport, written as N-Triples, which any Turtle parser reads) instead of JSON. The header Accept: text/turtle does the same. |
now=<dateTime> | The time now() stands for, for example now=2026-06-15T12:00:00Z: in the date conditions and in the package’s rules alike, so one run sees one instant. Default: the time of the request. Use it to get the same answer every time. |
curl -H "Authorization: Bearer dlf_live_…" \
"https://agrafe.dolfin.fr/api/data/<id>/validate"
The answer
{
"conforms": false,
"results": [{
"focus_node": "<https://…/people/main#bob>",
"path": null,
"value": "<https://…/people/main#bob>",
"component": "SPARQLConstraintComponent",
"severity": "Violation",
"message": "CanVote: condition not met",
"messages": [{"lang": null, "text": "CanVote: condition not met"}],
"concept": "CanVote",
"source_shape": "<https://…/people/main#CanVoteShape>"
}],
"skipped": [],
"warnings": []
}
| Field | Meaning |
|---|---|
conforms | true when there is no result at all. |
results | One entry per failed check. focus_node is the checked node, path the property path of the check in SPARQL path syntax (null for a check on the node itself), value the offending value, component the SHACL constraint that failed (e.g. MinCountConstraintComponent), severity Violation, Warning or Info, message a readable explanation (the shape’s own or a generated English default), messages only the shape’s own sh:message literals with their language (lang null when untagged; messages of sh:sparql constraints are generated by the Dolfin compiler and are English only), source_shape the shape that failed, and concept the concept of that shape (null for a field’s check). Nodes are written as <iri>, _:blank or a literal. |
skipped | The constructs of the package that could not be turned into shapes, as {concept, reason, file, span, concept_span} (file and the spans, with 1-based start_line, start_col, end_line, end_col, are missing for deployments made before they were recorded). They were not checked, so conforms: true says nothing about them. |
warnings | Shapes the validator ignored, as text. Also not checked. |
Deployments made before validation
Shapes are compiled at deploy time. A deployment created before validation existed has none, and the endpoint answers 409 with “redeploy it to enable validation” rather than reporting that the data conforms. Update the deployment (or deploy again) to fix it.
If the package’s conditions cannot be compiled to shapes at all (for example a cycle of negated conditions), the deployment still works but the endpoint answers 422 with the reason.
From the interface
Open the project and choose the Validation tab of the output pane. Pick what to validate: Live: current package (selected by default, and available before any deploy) or one of the deployments. Optionally set now = to the time now() stands for (read as UTC; empty means the time of the request), and press Validate.
Live: current package checks the facts of your saved files against shapes compiled from them right now, like the SPARQL tab’s live entry: no deployment, and nothing is written. The data includes the instances and facts of your locked imports, as a deployment does. With it selected, validation runs again by itself each time the tab is shown and each time you save a file while the tab is open. A deployment is only validated when you press Validate.
A green Conforms badge means no check failed. Otherwise the badge counts the violations, and the warnings and infos if there are any. The table below lists one row per failed check, sorted by focus node: Severity, Focus node, Path (“(node itself)” for a check on the node), Value, Message and Component. IRIs are shortened with the package’s prefixes. Click a focus node to open it, ringed, in the Instances tab (when it is in the project’s live data), a condition’s message to open that condition in the editor, and a Not checked concept to open the skipped construct (or, for older deployments, the concept) in the editor.
A Not checked list appears when some constructs could not be turned into shapes, and an Ignored shapes list for the validator’s warnings, even when the badge is green: those parts were not validated, so “Conforms” says nothing about them.
You learn this before running anything: right after a deploy, and on each row of the Deployments tab, a line reads N constructs not checked by validation (with a link to this tab), Validation unavailable: shapes could not be generated (reason) when the conditions could not be compiled (the deployment still works), or Validation not available, redeploy for a deployment made before validation existed. Nothing is shown when every construct is checked. These lines come from what was recorded at deploy time; no validation runs to display them.
For a deployment made before validation existed, the tab says to redeploy it and offers a button to the Deployments tab (see Deployments). When the conditions cannot be compiled to shapes, it shows the reason instead of a badge.
Checking the project’s own facts in the editor
The facts you write in the project can be checked before any deploy. Tick Validation in the header of the Problems panel: Agrafe checks the facts of the files as they are in the editor (unsaved edits included) against the package’s shapes (with your locked imports’ instances and facts as data), and lists each failed check as a problem with code S017, underlined on the fact it is about (or on the concept’s name when it is about no fact of yours, such as a fact generated by a mapping). A Violation is an error, a Warning a warning, an Info an info. While Validation is ticked, the same check also runs by itself a moment after each save. Unticked (the default), no fact check runs and no S017 / S041 problem is listed or counted. The checkbox gates S017 and S041 (a fact that fails an equivalent to concept it is asserted to be, see Problems): the rules check (S040, see Problems) runs after each save either way. The choice is remembered per project in this browser.
Only the project’s own facts are checked here, not a deployment’s data (use the Validation tab for that). Editing a file removes its S017 problems until the next check, since they may no longer point at the right line.
From an AI assistant
The MCP tool validate_deployment runs the same validation and returns the same JSON.
Live view and deployments
An app needs a schema to query and a place to write its data. Agrafe gives it two:
| Deployment | Live view | |
|---|---|---|
| Schema | Frozen: the files as they were at Deploy (or the last Update) | Always the project’s current saved files, compiled on the fly |
| Data | The deployment’s data graph | The project’s live dev dataset, one per project |
| Id in URLs | deployment_id: /api/data/<deployment_id>/… | project_id: /api/projects/<project_id>/live/… |
| Token | Deployment token, dlf_live_… | Dev token, dlf_dev_… |
| Use it for | Production | Developing the app while the schema still changes |
A schema change never reaches a deployment until someone presses Update or deploys again (a new deployment has a new id and needs a new token). The live view sees it at once, so an app under development can keep the same URL and token through every edit of the schema.
Turning it on
The live view is off by default. Only the project owner can turn it on, with the Live view switch in the header of the Deployments panel, next to Deploy. While it is off, every live endpoint and tool refuses with the live_view_disabled error (MCP) or a 403 carrying the same JSON body (HTTP). Turning it off deletes nothing: the dev dataset and the dev tokens work again when it is turned back on, unless a token was revoked meanwhile.
Dev tokens
A dev token works for one project’s live view only. It is never accepted by a deployment endpoint (/api/data/…), and a deployment token is never accepted by a live endpoint. Each token is shown once when it is issued, and stored hashed, like a deployment token.
Issue and revoke dev tokens in the Deployments tab, under Live view dev tokens (+ Dev token, then Tokens to list and revoke them), or with the MCP tools issue_dev_token, list_dev_tokens and revoke_dev_token. Issuing one needs Live view on and the owner; other members do not see the section.
HTTP endpoints
All take Authorization: Bearer dlf_dev_…. Requests and responses are those of the deployment API:
| Endpoint | Like | Does |
|---|---|---|
GET/POST /api/projects/<id>/live/sparql | …/sparql | SPARQL over the current schema, its facts and mapped data, and the dev dataset. ?now= pins the rules’ clock. |
POST /api/projects/<id>/live/triples | …/triples | Writes a /triples body to the dev dataset: 201 {written, basis}. No source: one dataset per project. |
POST /api/projects/<id>/live/validate/triples | …/validate/triples | Dry run of the write: the report with the batch, would_write and new_violations. Nothing written. |
GET/POST /api/projects/<id>/live/validate | …/validate | The SHACL report (JSON) of the current shapes on the project’s facts, mapped data and dev dataset, with basis. ?now= as /validate. |
basis names the files compiled, each with its version. Errors: 401 (no token, a revoked one, or a token that is not a dev token), 403 (a dev token of another project, or Live view off), 422 (the project’s files do not compile, or a rejected write). Queries time out after 10 seconds and …/live/validate after 60; a write or its dry run (…/live/validate/triples) runs two validations and gets 20.
Writes are checked against the current shapes
A write gets the per-triple checks of /triples against the current files, then the SHACL shapes of the current files run on the dev dataset with and without the batch. A batch that adds a Violation is refused with 422 {error, new_violations}, and nothing is written. Violations already in the dataset do not block a write: after a schema change, the data it made invalid stays as it is and shows up in …/live/validate and the MCP validate_project. Nothing is migrated or deleted for you; fix the data with new writes, or start again with clear_live_data.
Going to production
The app reads its endpoint from its configuration, for example a .env file:
# development: the live view, survives schema changes
AGRAFE_API=https://agrafe.dolfin.fr/api/projects/<project_id>/live
AGRAFE_TOKEN=dlf_dev_…
# production: a deployment, a frozen release
AGRAFE_API=https://agrafe.dolfin.fr/api/data/<deployment_id>
AGRAFE_TOKEN=dlf_live_…
Only production switches to a deployment id. To release, deploy the project (the Deploy button or the MCP deploy_project); the deployment freezes the current files. The dev dataset is not part of it: deployments never contain dev data, and the dev data is never written to the project’s files. To seed a deployment with it, use the MCP copy_live_data_to(deployment_id): it adds the dev triples to the deployment’s data graph (a deployment’s schema is frozen, its data is writable through the same graph /triples uses), checked against that deployment’s own shapes, and refuses a copy that adds a Violation.
How to write the schema itself is in the Dolfin language book.
History
Agrafe keeps versions of your files as you save them; small edits saved within about 15 seconds of each other are merged into one version. The History tab lists them, lets you compare any version with the current file and bring an old one back.
The timeline
Versions of all files are listed newest first, each with its file, its date and, for a grouped version, its group name. File: narrows the list to one file; All files shows them all again.
The newest version of each file is marked HEAD: it is the file as it is now. Older versions may show as (pruned): they fell outside what your plan keeps.
| Plan | Versions kept per file |
|---|---|
| Free | The latest two. |
| Pro | The latest two, plus everything saved in the last 7 days. |
Versions in a group are always kept.
Versions saved by an AI assistant through MCP show an mcp badge; hover it to see the client, the user and the message.
With one file selected, Graph view draws its history as a branch graph; List view goes back to the list.
Comparing and restoring
Click a version to open it next to the current file: a purple Diff: file @ version tab replaces the editor, with the differences highlighted. Close the tab (or click HEAD) to return to the editor.
On the selected version, press and hold Restore. Its content is saved as a new version on top of the current one: nothing in the history is lost, and you can restore the newer version again. If the version’s text is already the current text, nothing is saved and a message says so.
Grouping versions
Tick the boxes of several versions to act on them together:
| Button | Action |
|---|---|
| Group… | Names the selection as a checkpoint, for example Before the big rename. A group may include several files. Its versions are never pruned. |
| Squash… | Only when the ticked versions are the latest ones of a single file. Merges them into one version with the message you give. |
| Clear | Unticks everything. |
Groups are listed at the top of the timeline. Rename one with its pencil or delete it with its trash; deleting a group keeps its versions.
With git sync
When the project is connected to a repository with git sync, the History tab is split in two:
- Since last commit, at the top, lists what changed since the last commit pushed to the followed branch. Autosaves (WIP commits) do not count as commits.
- Followed branch, at the bottom, shows the commits of the followed branch.
After an automatic merge of remote commits, Since last commit first shows the notice “Merged at least N remote commits (range): files” with Undo auto-merge, as in the Git sync section (see Undo auto-merge).
Since last commit opens with a commit box: type a message, check the list of changed files, then press Commit. It does what Checkpoint… does in the Git sync section: one commit on the branch, then a push. The result of the push is shown under the box. Once the commit is pushed, the list empties: older versions are only hidden, never deleted, and the versions saved from then on fill it again.
Below the box, each changed file is a group you can fold, with an added, modified or deleted badge. A group lists the current version (HEAD) first, then the versions saved since the last commit, newest first. Click a version to compare it with the current file, hold Restore to bring it back, and tick its latest versions to Squash… them, as in the timeline. A deleted file has no current version. A renamed file shows as one deleted and one added file.
With nothing changed, the part reads No changes since last commit. The File: filter and the Group… button are not shown in this view.
Git commits replace groups while the project is connected: the Group… button, the group list and the rename and delete actions are hidden, and no group can be created. Existing groups are kept and show again if you disconnect git sync, along with the full timeline of every file.
Since last commit starts over each time the last commit moves:
- a commit, from its commit box or from Checkpoint… in the Git sync section;
- Import, Take remote or Overwrite remote in the Git sync section;
- a switch to another branch;
- a commit pushed by a collaborator. Agrafe has no live notice for it: the tab picks it up within a minute, or as soon as you come back to the browser window.
Starting over only hides the older versions. They stay in the history: the full timeline shows them again once git sync is disconnected, and Followed branch gives back each committed state of a file.
Followed branch
The lower half lists the followed branch’s commits, newest first, drawn as a graph like a file’s history: one dot per commit, lines to its parents, the tip at the top. Autosaves (WIP commits) are not on the branch and never show. Each row has the short commit id, the commit message’s first line and the date; hover it for the full id and the author. Badges mark:
- a release tag (for example v1.2.0);
- remote: the remote branch’s tip at the last fetch;
- not pushed: a commit the remote does not have yet.
The list shows 50 commits at a time; press Load more for older ones. It reloads after a commit or a push.
Click a commit to list the files it changed compared with its parent (for a merge, its first parent; the first commit lists every file as added). Project files under the connection’s path prefix get actions:
- View opens the file as it was at that commit, read-only.
- Diff compares that version with the current file.
- Hold Restore to save that version of the file as a new version. It shows at the top, under Since last commit, and you can undo it from there like any other save.
Other paths (import locks, files outside the path prefix) are listed without actions. A deleted file has no View, and a file that is no longer in the project has no Diff or Restore.
Collaboration
Sharing a project
On the Projects page, the owner opens Share on a project card, types an email address, picks a role and presses Send invite. The person receives an email; its link opens a confirmation page (sign in or sign up first if needed), and Accept invitation adds the project. Once they accept, the project appears under Shared with you on their Projects page. The same dialog lists People with access; the ✕ next to a name removes that person.
An account whose email is not verified must verify it before accepting an invitation; the Projects page offers to resend the link.
Roles
| Owner | Editor | Viewer | |
|---|---|---|---|
| Open the project, the graph, the outputs, SPARQL | ✓ | ✓ | ✓ |
| Edit, create, rename, delete and import files | ✓ | ✓ with a Pro plan | |
| Deploy, update and delete deployments | ✓ | ✓ with a Pro plan | |
| Issue and revoke API and dev tokens | ✓ | ||
| Share, rename, delete the project, make it public | ✓ |
“With a Pro plan” refers to the editor’s own plan. Without it, an Editor works as a Viewer. A badge at the top of the sidebar reminds you of your role on a shared project.
When you cannot edit a project, the controls that would change it are hidden: Deploy, New file and Import, the file tree’s rename and delete actions and right-click menus, the graph’s file menu, quick fixes, token management, and Update and delete on deployments. Save package settings stays visible but disabled.
The owner’s plan still sets the project’s limits (number of files, of deployments).
To leave a project shared with you, use Settings → Shared.
A token is owner-level access to a deployment’s data API, so only the owner manages tokens. When an Editor deploys, the deployment gets its token as usual, but its value is shown to the owner only: the Editor’s dialog says to ask the owner for one. When a member is removed, leaves, or is changed from Editor to Viewer, or deletes their account, the deployment and dev tokens they issued on the project are revoked. Older tokens that do not record who issued them are not: review them under Tokens.
Working at the same time
Several people can have the same project open. Everything is live:
- Who is here: the avatars of the other people who have the project open appear in the top bar. Hover one for the name.
- Editing: when two people open the same file, each sees the other’s cursor and selection, labelled with a name and a colour, and the text changes as they type. Ctrl+Z undoes only your own edits.
- Connection lost: if the server drops the live connection, the file’s status shows Disconnected, or Save error if you had unsaved edits, and the others’ cursors disappear. Reload the page to reconnect.
- Graph: nodes someone drags move on your screen too.
- Where the others look: right-click the Graph or SVG tab title to show or hide the others’ visible area (Show others’ viewports) and, on the graph, their pointer (Show others’ mouse).
Public projects
The owner can make a project public with the Public switch, on the project card or in the sidebar. Anyone, signed in or not, can then open it read-only at /public/<project id>, and it is listed on the Public projects page (/public).
A visitor sees the file tree, the source, the outputs, the graph, the SPARQL console, the deployments and their API documentation. They cannot edit, deploy, share, open the package settings or the history, and their graph moves are not saved.
The number of public projects you can have depends on your plan.
Import locks on disk
A project that imports other ontologies keeps one lock per import: the exact content Agrafe resolved for it. Export as zip (in the file tree) writes these locks to disk, so radeau and dolfin-lsp can use the same imports without network access.
What the zip contains
- Every project file,
package.dlfincluded. - One folder
.dolfin/imports/<import>/per locked import, named after the import’s IRI and version. Each holds four files:lock.json,interface.json,turtle.ttlandclosure.ttl.
The unzipped folder passes radeau check offline. If the locks cannot be fetched, a notice says so and the zip holds the project files only.
Releases
A release is a frozen copy of a project, cut under the version of its package.dlf (Create release in the Package pane, or the MCP create_release). Releases exist only so that another project can import this one: the Imports picker lists them, and an import <package-iri> "version" line locks one. A deployment does not need a release: its store is reached over the API with its deployment id and a token alone (see Deployments).
The lock files
| File | Content |
|---|---|
lock.json | The lock itself: iri (the imported ontology), artifact_hash, requested_version (the version package.dlf asks for, if any), version (the artifact’s own version, for a release the release version) and source (the release or URL it came from). |
interface.json | The import’s glossary interface: the names that prefixed refs into the import resolve against. |
turtle.ttl | The imported ontology’s Turtle. |
closure.ttl | The Turtle of the import’s own locked imports. It may be empty. |
artifact_hash is a SHA-256 over the IRI, version, turtle.ttl, interface.json and closure.ttl, byte for byte. It is how a reader tells the files were edited by hand. Do not edit them: re-export the lock from Agrafe instead.
How radeau uses the locks
radeau check, build, fmt and metadata read .dolfin/imports/ in the package folder and match each import line of package.dlf with a lock: same IRI, and same version when the line asks for one (either the lock’s requested_version or its version). radeau serve does the same for the imports it sends to the page, and dolfin-lsp reads the locks too, re-reading them when a file under .dolfin/imports/ changes.
A missing or stale lock never aborts. It becomes a warning on stderr and the import is left out, so its prefixes fail to resolve exactly as they would with no lock at all:
| Case | Result |
|---|---|
No .dolfin/imports/ folder | Nothing, silently. |
| A lock folder with a missing or unreadable file | Warning; that lock is skipped. |
artifact_hash does not match the files | Warning; the lock is still used. |
An import line with no lock for its IRI | Warning; the import is left out. |
| A lock for the IRI, but for another version | Warning naming both versions; the import is left out. |
A lock with no matching import line | Warning; the lock is ignored. |
radeau build --with-imports
radeau build --output dist/app.ttl --with-imports
Besides the output, writes each lock’s closure.ttl, copied verbatim, to <output-stem>.<slug>.closure.ttl beside it: here dist/app.acme.com_hr-1.0.0.closure.ttl for http://acme.com/hr at version 1.0.0.
- The slug is the lock’s IRI minus its scheme and trailing
/or#, then-<version>when the lock has one, with every character outside[A-Za-z0-9._-]turned into_. --with-importsrequires--outputand Turtle output (the default--emit turtle); it is refused with--emit n3-rules.- With no lock, the build succeeds and says there is nothing more to write.
- If two locks map to the same slug, the build fails: remove one of them from
.dolfin/imports/.
Importing a zip
Importing a zip that holds .dolfin/imports/** restores those locks as the project’s import locks. See the Import row in Files.
Git sync
Git sync exports a project’s files to a branch of a git repository on GitHub, GitLab or any host that accepts SSH deploy keys or HTTPS access tokens. Agrafe pushes to the repository; it reads from it only when you import its files, on connecting or to resolve a divergence.
The settings are at the bottom of the Package pane (the Package button at the bottom of the sidebar), in the Git sync section. The server must have git sync enabled; if it is not, connecting answers “git sync is not available on this server”, followed by the reason in brackets (for example git: spawn failed: No such file or directory (os error 2); ssh: ok when the host has no git package).
Git sync requires the project owner’s plan to be Pro or Enterprise (a collaborator’s plan does not count). After a downgrade the sync is paused, with the connection and its history kept; it resumes on its own once the owner upgrades again.
How it works
- A branch owned by Agrafe. Agrafe pushes to one branch,
agrafeby default. Others should not commit to it: people merge it into their own branches through pull or merge requests. Commits by others that touch only files Agrafe does not hold (aREADME.md, CI files), or.dlffiles Agrafe left unchanged, are merged automatically; overlapping changes stop the sync as Diverged. - Autosaves. While you edit, Agrafe records snapshots of the project locally, after 30 seconds without a save or at the latest 5 minutes after the first unsaved change. Autosaves are never pushed.
- Checkpoints. A checkpoint squashes the autosaves into one commit with your message and pushes it. The branch history is one commit per checkpoint.
- Releases. Creating a release adds an annotated tag
v<version>and pushes it when the sync can push. A failed tag never fails the release; the reason shows as the last error.
What the repository contains
Under the connection’s path prefix (the repository root by default):
- every project file at its path, folders included (
models/person.dlfis in amodelsfolder),package.dlfincluded, except the files.syncignorelists; - the import locks, one folder
.dolfin/imports/<import>/per locked import, the same files as Export as zip writes (see Import locks on disk).
Every other file stays as it is: everything outside the path prefix, and under it everything Agrafe neither imports nor holds as a project file (a LICENSE, CI files, a .dlf the import skipped), and every file .syncignore lists. Deleting a project file other than .dlf, .md or Turtle in Agrafe does not delete it from the repository.
Keeping files out of the repository (.syncignore)
A file .syncignore at the project root lists the project files git sync leaves out, for example the graph layout .dolfin-layout.json. One pattern per line, with the .gitignore syntax: blank lines and lines starting with # are skipped, * and ? stay within a folder, ** crosses folders, a trailing / means a folder, a leading / anchors the pattern to the root, and ! takes a file back. A pattern without / matches the file name in any folder. Paths are relative to the path prefix.
# Agrafe-only files
.dolfin-layout.json
drafts/
- Never committed. Checkpoints, autosaves, releases and auto-merges leave the matching files out. A copy already in the repository stays as it is: it is not deleted, nor updated. Delete it with git if it must go.
- Never pulled. An import, Take remote version and an auto-merge never overwrite nor delete the Agrafe copy of a matching file, and do not list it as skipped. The project’s own
.syncignorealways applies: the repository’s.syncignoreis never imported. - Never pending. Edits of matching files do not count as changes in the Git panel, so they never make the sync look dirty.
- Version history still applies. Versions still lists and restores the matching files: only git leaves them out. While connected, the History tab lists every version of these files under Not synced, with the usual diff and Restore.
.syncignoreitself is always synced, including in release commits, even if a pattern matches it (*).- Only the root
.syncignorecounts. A.syncignorein a folder is an ordinary file. - Import locks are kept or synced a whole folder at a time. The path
.dolfin/imports/<import>/lock.jsondecides for its folder:*.jsonor.dolfin/imports/<import>/keeps that lock local,*.ttlalone does not split a lock. - The MCP tool
get_git_statuslists the matching project files underignored. - Not supported: escaped trailing spaces and
\#.
Don’t sync from the Git panel: the Connect form and the Checkpoint… dialog list the project files not in git yet, each with a Don’t sync box. A ticked file gets an exact line in .syncignore (/name for a root file) before the commit is built, so it is left out of that very commit; .dolfin-layout.json is ticked the first time it shows up. Not synced (N) lists the files .syncignore already keeps out: untick a file listed by an exact line to remove that line. A file matched by a wider pattern (*.json) shows that pattern read-only: edit .syncignore to change it.
A clone of the branch therefore passes radeau check offline, as long as every import is locked.
Connecting a repository
Only the project owner can connect. Choose SSH (deploy key) or HTTPS (access token) first; the fields follow the choice. Then fill in:
| Field | Content |
|---|---|
| Remote URL | The repository’s SSH URL, such as git@github.com:org/repo.git, or its HTTPS URL, such as https://gitlab.com/org/repo.git. An HTTPS URL must not contain a user or a token, nor a query or fragment. |
| Access token | HTTPS only, required. A password field. See Creating a token for HTTPS. The field’s hint reads “GitLab: project or deploy token with write_repository; GitHub: fine-grained token with Contents read/write”. |
| Username (optional) | HTTPS only. Default oauth2. |
| SSH key | SSH only. Generate a new key (default), optionally with Save as … in my settings to keep it as a named key for other projects; or Use a saved key from your list (name and short fingerprint). |
| Branch | The branch Agrafe pushes to. Default agrafe. |
| Path prefix | Optional folder of the repository the files go in, such as ontology/hr. |
With SSH and a new key, Connect creates a deploy key for this project and shows its public half. The private key is stored encrypted on the server and is never shown. Add the public key on the host as a deploy key with write access. With a saved key, the section shows that key’s public half and says it is likely already on the host: run Test connection first and add the key only if the test fails. A key you have just generated and saved under a name gets the new-key message instead: add it on the host.
| Host | Where |
|---|---|
| GitHub | Repository Settings → Deploy keys → Add deploy key. Paste the key and tick Allow write access. |
| GitLab | Project Settings → Repository → Deploy keys → Add new key. Paste the key and tick Grant write permissions to this key. |
| Other hosts | An SSH deploy key, or the SSH key of a bot account, with push access to this repository only. |
Named SSH keys that you can use for several projects are managed in Settings → SSH keys (Account settings). GitHub refuses the same deploy key on two repositories. To reuse one key across repos, add it as the SSH key of a bot/machine account (GitHub), or enable it on each project (GitLab deploy keys can be shared).
GitHub accepts a deploy key on one repository only: a saved key already added to another GitHub repository is rejected. When you pick a saved key for a GitHub remote, the form and the connected section say so, outside the host tabs.
Saved SSH keys
Saved keys belong to you and can be reused across your projects. Agrafe generates them; the private key never leaves the server, and there is no import of an existing private key. A key cannot be deleted while a project uses it. Only you can attach your saved key to a connection.
Changing the key
On a connected SSH project, the owner’s Change key… button switches the connection to another saved key, or generates a new key (optionally saved under a name). Generating asks for confirmation: the old public key stops working on the host, so add the new one there. After either change, run Test connection.
The section opens the instructions of the host it recognises in the URL; the tabs show the others. Copy puts the key on the clipboard.
With HTTPS, Connect stores the token encrypted and creates no deploy key. The connected section shows the transport, “token set” and a Replace token button instead of the deploy key box.
A remote (HTTPS, ssh:// or user@host:path, including user@[IPv6]:path) whose host is localhost (or ends in .localhost) or a loopback, private, link-local, CGNAT, multicast, reserved or documentation IP address is refused when connecting, with “remote host must not be localhost” or “remote host is a private or local address”. A host name is checked again before each push, fetch or test: if it resolves to such an address, the run stops as Remote unreachable with “remote resolves to a private address”. SSH then connects to the address that was checked, so the name is not looked up a second time.
An SSH remote must not contain [ or ] outside a bracketed IPv6 host (“remote URL must not contain ‘[’ or ‘]’ outside an IPv6 host”), so a repository path with brackets (for example repo[1]) cannot be used.
SSH or HTTPS
- SSH: a deploy key per project, created by Agrafe, or one of your saved keys. The deploy key and host key paragraphs of this page apply to SSH only.
- HTTPS: an access token that you create on the host and paste.
- Pick HTTPS when SSH port 22 is blocked, when the host only offers tokens, or when your organisation manages access through tokens.
- Pick SSH when you prefer a key limited to one repository that you can revoke on the host.
Creating a token for HTTPS
| Host | Token | Username |
|---|---|---|
| GitLab, project access token | Project Settings → Access tokens, role Developer or higher, scope write_repository. | Any value works; keep the default oauth2. |
| GitLab, deploy token | Project Settings → Repository → Deploy tokens, scope write_repository. | Must be the deploy token’s username. |
| GitHub | A fine-grained personal access token limited to this one repository, with Repository permissions → Contents: Read and write. | Leave the default. |
The token is stored encrypted on Agrafe, sealed with the server’s master key. It is never shown again, never written to the audit log, and deleted on Disconnect.
Keep the token in this browser only
With HTTPS, the connect form offers two choices:
- Store token encrypted on Agrafe (default): background sync, as described above.
- Keep token in this browser only: Agrafe never stores the token.
What the second choice does:
- The browser keeps the token in its local storage, under
agrafe-git-token:<project id>, and sends it with each git action (test, checkpoint, import, branch switch, overwrite, release tag). - The server uses it for that one git run, in memory, and forgets it. It is never written to Agrafe’s database, logs, audit log, backups or error messages.
- Connecting checks the token against the repository first; a refused token connects nothing.
- The browser cannot talk to GitHub or GitLab itself: their git endpoints do not allow requests from other websites (no CORS). That is why the token still passes through Agrafe’s server.
The tradeoffs:
- No background sync. Agrafe pushes only while a browser holding the token has the project open. A checkpoint whose push failed is pushed again from that browser, once the project has been quiet for 30 seconds. Until then the status says Waiting for a browser with the token.
- Per browser. Another browser, another device, or an editor of the project needs the token too: the section asks for it under Token for this browser. Without it, checkpoints and imports are refused with “token needed from browser”, and a release tag is created but not pushed.
- Lost when the site’s data is cleared. Enter it again then. Forget token in this browser removes it on purpose.
- What it protects against. A leak of Agrafe’s database, of a backup, or of the server’s master key does not expose the token.
- What it does not protect against. A compromised Agrafe server, or a cross-site scripting flaw in Agrafe, can read the browser’s local storage and see every request. Against those, the encrypted copy on the server is actually safer: it never reaches the browser.
- MCP tools never hold the token:
git_checkpointis refused for such a connection.
To switch later, the owner uses Replace token or where it is kept:
- To the browser: Agrafe’s copy is deleted, and this browser keeps the token you enter.
- To Agrafe: the token you enter is sealed on the server, and this browser’s copy is forgotten.
Replacing a token
- Owner only: Replace token or where it is kept in the connected section asks for the new token and, optionally, a username (blank keeps the current one).
- Use it before the token expires, or after it was revoked.
- It does not change the branch or the history, nor the status: run Test connection afterwards.
- Tokens expire: set a reminder for the expiry date.
Branch warning
If the branch is main or master, the section warns that it looks like the repository’s main branch. Connecting is allowed. Commits made on that branch outside Agrafe are merged automatically when they touch only other files, or .dlf files Agrafe left unchanged (see Merged automatically); any overlap stops the sync as Diverged. Prefer a dedicated branch.
Test connection
Test connection checks that Agrafe can reach the repository with the deploy key or the token (git ls-remote), without pushing. A successful test does not lift Paused or Diverged.
With SSH, the host keys of GitHub and GitLab.com are built in. For any other host, Test connection shows the fingerprint of the host’s key (“Host key of the remote: SHA256:…”). Compare it with the fingerprint your host publishes, then click Trust this host key. Pushes and imports are refused (“host key not confirmed”) until you have. Agrafe scans the host again when you confirm: if it now presents a different key, nothing is recorded and you test again. The recorded key is never replaced, so a host that later presents another key is refused. With HTTPS there is no host key to record.
Importing from the repository
When the connection works and nothing was pushed yet, Test connection also looks at the branch. If it already exists, the section lists what an import would bring before anything is written:
- the
.dlf,.mdand Turtle (.ttl,.turtle,.n3) files under the path prefix, in their folders. Each Turtle file that is not yet a Turtle source becomes one after the import, as with Add Turtle source: it is translated, and its.dlffiles are added or merged into. If that fails, the import still stands and the message says why; - the import locks under
.dolfin/imports/(see Import locks on disk); - the skipped entries, each with its reason: files that are not
.dlf,.mdor Turtle (aLICENSE), files over 5 MiB, names a project file cannot have (such as.hidden.dlfordocs/.hidden.dlf), and content that is not UTF-8 text.
Two buttons follow (owner only):
- Import into this project, offered only while the project has no file but its
package.dlf. The files are written as if you saved them, so each one gets a version in its history; the remotepackage.dlfreplaces the default one. - Create a new project from the repository creates a project of yours, named after the repository, imports the branch there and opens it. The connection, with its deploy key or token, moves to the new project: the current project is disconnected, since both cannot push to one branch. Your usual project and file limits apply.
An import is all or nothing: an import lock whose files do not match its lock.json stops it before any file is written. After an import, the branch counts as pushed: the next checkpoint only commits what you change. A checkpoint writes the branch’s whole content, so files that were skipped disappear from it; keep the branch for Agrafe.
If you do not import, the first checkpoint stops as Diverged (the branch has commits Agrafe did not make).
Status
The section shows the status, the remote, the branch, the time of the last push attempt and the last error. A small branch icon next to the project name in the top bar shows the same status, in the status’s colour, with the status, the unpushed changes and the last error in its tooltip. After an automatic merge, the tooltip adds “auto-merged at least N remote commit(s) (range)”. Click it to open the Git sync section. The icon is absent when the project is not connected. It refreshes every minute and after each action.
| Status | Meaning |
|---|---|
| OK | The last push or test succeeded. |
| Waiting for a deploy key | The connection has no deploy key (SSH only). |
| Diverged | The remote branch has commits Agrafe did not make. Pushes stop until you resolve it, see below. |
| Authentication failed | SSH: the host refused the key (missing, read-only or revoked). HTTPS: shown as “Authentication failed: token rejected or lacks write access” (expired, revoked, wrong scope or wrong username). |
| Remote unreachable | The host could not be reached, or (HTTPS) its TLS certificate was not accepted. Agrafe retries, waiting longer after each failure (up to 15 minutes). |
| Push rejected | The host refused the push, for example a protected branch or a server hook. |
| Paused | Pushes are paused. |
A connection that keeps its token in the browser also shows Waiting for a browser with the token while it has changes or a checkpoint to push and this browser has no token.
After an automatic merge, the Git sync section and the History tab show the notice “Merged at least N remote commits (range): files”, with an Undo auto-merge button (see Undo auto-merge).
Under the table, the section counts the unpushed changes: the files added, modified or deleted since the last pushed checkpoint, and the autosaves taken since. Show files lists them. A checkpoint that was committed but not pushed yet is mentioned too.
When a token expires
- On the next push or test, the status turns to Authentication failed: token rejected or lacks write access.
- Test connection fails the same way.
- Checkpoints are still committed locally; the next checkpoint after Replace token pushes them.
Checkpoint, pause, disconnect
- Checkpoint… asks for a message (at most 1000 characters), commits and pushes. If nothing changed, nothing is committed. While the sync is paused, waiting for a key or diverged, the checkpoint is committed but not pushed; the next checkpoint pushes it.
- The History tab of a connected project also has a commit box, above the files changed since the last pushed commit, grouped by file.
- Pull now looks at the remote branch once and brings its new commits into the project when that is safe: the same cases as an auto-merge (only files Agrafe does not own changed, or owned files you have not edited since the last push). Nothing is pushed; edits not checkpointed yet stay in the project for the next checkpoint. If a checkpoint is still waiting to be pushed, it is pushed instead. When the changes cannot be applied safely, nothing changes and the message says why. At most one pull a minute per project. Agrafe does not look at the remote on its own: without Pull now, remote changes show up at the next checkpoint.
- Pause stops pushes. Autosaves go on locally. Resume restarts them.
- Disconnect asks for confirmation, then deletes the connection, its deploy key (SSH) or stored token (HTTPS), and Agrafe’s copy of the repository. A saved key stays in your settings. The repository on the host is not changed: remove the deploy key there yourself, or revoke the token.
Resolving a divergence
Merged automatically
When a push finds commits on the remote branch that Agrafe did not make, Agrafe first tries to merge them, in two cases:
- Case 1: the remote changed only files outside the project’s files and import locks (a
README.md, CI files, files outside the path prefix). Agrafe commits its checkpoint on top of the remote branch; the project is unchanged. - Case 2: the remote changed
.dlf,.mdor Turtle files or import locks that Agrafe left unchanged since its last push. Their remote content is written into the project, each as a new version taggedvia: git remote <sha>. The project must have no errors before, and none after the merge; warnings and a failed fact check are fine, as in the Problems panel.
It does not merge, and stops as Diverged with a last error ending in not merged automatically: <reason>, when:
- the same file changed on both sides, or was deleted on one side and edited on the other;
- the remote added a new
.dlffile; - the project has errors before the merge, or would have errors after it;
- an import lock changed on both sides;
- the remote history was rewritten (a force push), or is more than about 670 commits ahead;
- the fetch hits the size limits (see Limits and audit);
- a file the merge would write is open in an editor;
- the host refuses the merged push.
The fetch is shallow, so the number of merged commits is a lower bound (“at least”).
Undo auto-merge
Undo auto-merge, in the notice, is for the owner and for editors with the Pro plan (as Take remote version). After a confirmation, it:
- writes each merged file back to its content before the pull, as a new version tagged
via: git auto-merge undo, and puts the import locks back; - resets the branch to Agrafe’s own checkpoint;
- sets the status to Diverged. The remote branch keeps the merged commit, and nothing is merged again: pick one of the three choices below.
The rules:
- Undo is available until the next checkpoint.
- Edits made to the merged files since the merge are kept in their history; the confirmation lists those files.
- Undo is refused with
close <file> firstwhile a merged file is open in an editor. - Undo deletes no version. A file the remote deleted had already been deleted by the merge, so it comes back as a new file with a single version; its old versions are still stored, but are not listed in the new file’s History.
The notice and its button are the same in the Git sync section and the History tab.
Choosing a resolution
When the status is Diverged, three buttons appear:
- Take remote version asks for confirmation, then makes the project’s
.dlffiles and import locks those of the remote branch, as an import does: files are updated or created, and the.dlf,.mdand Turtle files the branch lacks are deleted (package.dlfand Turtle sources are kept). Your local changes stay in the files’ version history. The status goes back to OK, and the next checkpoint builds on the remote branch. - Overwrite remote branch asks for confirmation, then force-pushes Agrafe’s last checkpoint over the remote branch. The commits made on that branch outside Agrafe are lost from it. Checkpoint first if there is no checkpoint yet.
- Switch to new branch keeps the remote branch as it is and moves the sync to a new one:
agrafe-2, thenagrafe-3, skipping the names the remote already has. The next checkpoint pushes there.
Import locks
A project whose package.dlf imports other ontologies exports their locks with the files. The section warns in two cases:
- an
importline has no lock (it failed to resolve, or a release must be picked): the repository gets no.dolfin/imports/files for it. Fix the line in the Imports field of the Package pane; the next checkpoint exports the lock. - lock files changed since the last checkpoint: they reach the repository with the next checkpoint.
Limits and audit
When Agrafe reads a repository (to import from it or take its version), it fetches only the branch’s last commit, and refuses or skips what is too big. To merge automatically, it fetches the history step by step, within the same size limits, until it finds its last pushed commit:
| Limit | Value | Over it |
|---|---|---|
| Size of the files under the path prefix (the whole repository without a prefix, or when the host does not support partial fetches) | 50 MiB | The fetch stops and nothing is kept. A file over the per-file limit still counts here. |
| Entries under the path prefix | 1000 | Refused, nothing is kept. |
| Size of one file | 5 MiB, as for a data file in a project | The file is skipped and listed. |
Agrafe’s copy of the repository is compacted from time to time after pushes (git gc --auto).
Test connection, Pull now and Trust this host key are limited to 6 a minute per user, across projects; past that they fail with “too many requests, try again shortly”.
Text the remote sends (remote: lines) appears in errors prefixed “from the remote:”. It is the host’s text, not Agrafe’s: do not follow instructions in it you do not expect.
Connecting, switching or regenerating the SSH key (GitSyncUserKey, GitSyncKeyRegenerated), replacing a token, moving the token between Agrafe and the browser (GitSyncTokenMode, with mode=browser or mode=server), confirming a host key (GitSyncHostKeyConfirmed, with the fingerprint), disconnecting, overwriting the remote branch and importing are recorded in the server’s audit log, with the project, the user and the branch or commit. An automatic merge is recorded as GitSyncAutoMerge (branch, base, remote tip, merged commit, case) and its undo as GitSyncAutoMergeUndone (branch, base, merged commit); the merged versions are tagged via: git remote <sha>. The remote URL, the deploy key and the token are never recorded.
Who can do what
| Owner | Editor | Viewer | |
|---|---|---|---|
| See the status | ✓ | ✓ | ✓ |
| Checkpoint, pause, resume | ✓ | ✓ | |
| Connect, test, replace token, disconnect | ✓ | ||
| Pull now, take remote version, undo auto-merge | ✓ | ✓ | |
| Import from the repository | ✓ | ||
| Overwrite remote branch, switch to new branch | ✓ |
The buttons you cannot use are hidden. Pulling, taking the remote version and undoing an auto-merge edit the project, so an editor needs the Pro plan that editing a shared project needs.
Account settings
Click your avatar in the top bar to open Settings. The sections are listed on the left.
| Section | What you can do |
|---|---|
| Profile | Your display name, your Handle and your avatar. The handle (@alice) is unique: 3 to 30 characters among a-z, 0-9, _ and -, saved lowercase; a few words such as admin are reserved. It shows next to your name on your public projects, and @alice on the Public projects page lists them. Clear it to remove it; someone else can then take it. Avatar: paste an image URL in Avatar URL, or leave it blank to use your Gravatar. Save profile applies them. Your name is what collaborators see next to your cursor and on your avatar. |
| Password | Change your password: current password, new password, confirmation. Signing in with GitHub or GitLab using the same email verifies the account and, if it was never verified, removes its password. |
| Languages | Order the languages you read, by dragging them; Add a language adds one. When a description exists in several languages (#en>, #fr> comments), the editor’s hover shows the first available one in this order. |
| Usage | How much of your plan you use: private projects, public projects, active deployments, with a per-project breakdown. |
| Shared | The projects other people shared with you, and a button to leave each one. |
| License | Your plan and its quotas. From here you can request a Pro license, and activate one by pasting the license token you received. |
| MCP | The Remote MCP URL to give an AI assistant. Copy config copies a ready-made client configuration. See Connecting AI assistants (MCP). |
| SSH keys | Named SSH keys for Git sync. The + button (Create a new SSH key) creates one from the name field; pressing Enter works too (Agrafe generates it; only the public half is shown). Each row shows the name, fingerprint, creation date and the projects using it, with icon buttons: copy (the public key), pen (rename) and trash (hold for 2 seconds to delete). A key used by a project cannot be deleted: detach it first (the trash button is disabled). GitHub refuses the same deploy key on two repositories. To reuse one key across repos, add it as the SSH key of a bot/machine account (GitHub), or enable it on each project (GitLab deploy keys can be shared). |
| Danger zone | Delete account… deletes your account. It cannot be undone and asks you to hold the button to confirm. |
The theme switch in the top bar (System, Light, Dark) is not a setting of your account: it is remembered by your browser, and shared with the other Dolfin apps.
Keyboard and mouse
On a Mac, read ⌘ for Ctrl.
Dolfin and Turtle editors
| Keys | Action |
|---|---|
| F12 | Go to definition. |
| Ctrl+S | Ignored: files save automatically. |
| Ctrl+Z / Ctrl+Shift+Z | Undo / redo. When editing with others, only your own edits. |
| Ctrl+F | Find and replace in the file. |
| Tab / Shift+Tab | Indent / un-indent. |
| Ctrl+Shift+[ / Ctrl+Shift+] | Fold / unfold the block at the cursor. |
| Ctrl+Space | Show completions. |
| Enter on a comment or annotation line | Continue it on the next line. |
| Right-click | Editor menu. |
Workspace
| Keys | Where | Action |
|---|---|---|
| Escape | Search box | Clear the search. |
| ↑ ↓ ← → Home End | File tree | Move between rows, open and close folders. |
| Enter | File tree | Open the file. |
| F2 | File tree | Rename the file. |
| ← / →, Home | Editor / output divider | Resize, reset. Double-click also resets. |
| Ctrl+Enter | SPARQL tab | Run the query. |
| Escape | Any dialog or popup | Close it. |
Graph and SVG
| Gesture | Action |
|---|---|
| Scroll | Zoom towards the pointer. |
| Drag the background | Pan. |
| Ctrl+drag | Zoom into the rectangle. |
| Ctrl+Shift+drag | Zoom out. |
| Drag a node / a file frame | Move it (Graph only). |
| Right-click a node / a file frame | Graph menus. |
| Right-click the tab title | Show or hide the others’ viewports and pointers. |
Hold buttons
Delete and restore buttons must be held until their fill completes. A quick click only shows a reminder.
Importing a Turtle file
Agrafe can create a project from one or more existing Turtle (.ttl) ontologies, so you do not have to retype them in Dolfin.
How to import
- Open the project list and choose Import from Turtle.
- Pick (or drop) one or more
.ttlor.turtlefiles. Each must be UTF-8 text..n3files are accepted too: N3 rules ({ … } => { … } .), inline in a Turtle file or alone in an.n3, becomeruleblocks in the.dlf. A rule that cannot be translated is skipped with a warning (the import still goes through); a rules-only file added to a project joins that project’s package. The live sync leaves rules alone. - One new project appears with the placeholder name New project, with every file as a source. Rename it inline, exactly as after New project.
Every file is checked and translated before anything is stored. If one cannot be read, you get an error naming it (Could not read turtle (foo.ttl): …) and no project is created, whatever the other files hold. One import carries at most 10 MiB of Turtle in total; import more in several steps (create the project, then add sources).
Imported projects always start private, and an import counts as one project against your private-project limit, however many files it has. The import is refused if your licence has expired, if you are at your project limit, or if the generated Dolfin files would exceed your per-project file limit. That limit counts the Dolfin files after merging, without package.dlf; the .ttl files themselves never count.
Adding a Turtle source to a project
Owners and editors can add Turtle files to an existing project, from the file tree:
- Import → Add Turtle source… picks one or more
.ttlfiles from your computer. - A
.ttlfile that is already in the project as a plain file can be promoted: right-click it and choose Add as Turtle source.
Each file is translated and becomes a new source. Its Dolfin files are added to the project, or merged into the files of the same name already there (see below). The same checks as an import apply: a file that cannot be read refuses the whole action and the project is left untouched, and the file limit counts the existing Dolfin files plus the new ones.
A Turtle whose text is identical to an existing source, or a file that already is a source, is refused (… is already a Turtle source of this project.): adding it twice never duplicates anything.
How several turtles are merged
- Same file name, one file. When two sources produce a Dolfin file of the same name (same
rdfs:isDefinedByfile, or the same IRI-structure split), the project gets one file holding the declarations of both. It is a shared file, listed under each of its sources. Identical declarations and identicalprefixlines appear once. The result only depends on the files and their order (the order you picked them in, or existing files first when adding). - One
package.dlf. It comes from the first source’sowl:Ontologymetadata, and later sources never overwrite it (when adding to a project, the project keeps its own). A later Turtle with a different ontology IRI is still imported; that IRI becomes the base IRI of its own source only. - Turtle file names. Each source is stored under its own name. A name already taken gets a numeric suffix:
onto.ttl,onto-2.ttl,onto-3.ttl…
What you get
- Dolfin files. The Turtle is translated to
.dlffiles. Each entity goes into the file named by itsrdfs:isDefinedBytriple; Turtle without that information is split by IRI structure. See Turtle & OWL Correspondence for the exact rules. package.dlf. Built from the Turtle’sowl:Ontologymetadata. If the Turtle has none, a default manifest is generated.- The original Turtle. It is stored in the project as a normal file named
<file name>.ttland recorded as one of the project’s sources (its origin). Everything that follows (the editor, Reveal, sync and Re-translate) works on this file.
The base IRI of a source is the subject of its Turtle’s owl:Ontology. A Turtle without one is still imported: the IRI is taken from its empty prefix (@prefix : <…>), else its @base, else the namespace most of its classes and properties use, else the project’s IRI, and a warning says which (re-exporting adds an owl:Ontology header). It is recorded once per source at import, and later features reuse it so that translation and sync always agree.
Projects with several Turtle sources
A project can have more than one origin Turtle, called its sources. Each source keeps its own record: its base IRI, its sync state, its sync reference point, and the list of Dolfin files it generated. Sync, Re-translate and Reveal work per source, on the files that source generated.
Two sources can generate the same Dolfin file (same file name). Such a file is shared: it holds declarations from both. A shared file is never synced back to any Turtle, and a Re-translate never removes another source’s declarations from it. See Shared files.
A project with a single source works exactly as described on the other pages: its source owns every Dolfin file in the project. When a second source is added, the first one keeps the files it was in sync with.
The origin file in the file tree
Every source file has an origin badge. A source at the root of the project is pinned at the top of the tree, in the order the sources were added. A source moved into a folder keeps its badge there, but is no longer pinned. The Dolfin files a source generated are nested under it; a shared file appears under each of its sources. A source in a folder with none of its Dolfin files beside it shows them nested under it, wherever they are stored. Otherwise a source file behaves like any file:
- It is editable, collaborative, versioned and included in project ZIP exports.
- You can rename it. The project remembers it by identity, not by name.
- It does not count against the per-project file limit.
- It is ignored by everything Dolfin: compilation, linting, the wire format and deployments only look at
.dlffiles.
Deleting an origin file
Deleting a source file asks for confirmation:
This is a Turtle source of this project. Deleting it detaches this source only: its Dolfin files stop syncing back to it and “Reveal in turtle source” no longer looks in it. Other Turtle sources keep working. Delete anyway?
If you confirm, only that source is detached: its record, sync reference point and sync state are removed, and its Dolfin files stay as ordinary files. The other sources keep syncing and revealing as before. When the last source is deleted, the project stops being a turtle-origin project: Reveal falls back to Reveal in turtle export, and there is no automatic sync or Re-translate any more.
Projects imported before this feature
Older imported projects have no origin: the original Turtle was discarded at import and cannot be recovered. They keep working normally, and Reveal in turtle export is available, but they have no sync and no Re-translate. To get the full feature, import the Turtle again as a new project.
Plain .ttl files
A .ttl file created in the tree (for example with New file) is a plain file: it opens in the Turtle editor and is otherwise ignored (no sync, no Re-translate, no Reveal in dolfin). To turn it into a source, right-click it and choose Add as Turtle source. Only Import from Turtle and Add Turtle source create sources.
The Turtle editor
Any .ttl, .turtle or .n3 file in a project opens in a Turtle editor instead of the Dolfin one. It never runs Dolfin diagnostics on the file.
What it does
| Feature | Behaviour |
|---|---|
| Highlighting | Turtle syntax colours, in both the light and dark theme. |
| Diagnostics | Syntax errors are underlined and listed as problems. Only the first error is reported. |
| Completion | Prefixes declared in the file, prefixes declared in your other open Turtle files, and the common vocabularies (rdf, rdfs, owl, xsd, skos, dcterms). After prefix:, local names of subjects already in the file. |
| Hover | Hover a prefixed name to see its full IRI. If the subject is defined in the file, its rdfs:label and rdfs:comment are shown. |
| Outline | One entry per statement subject. |
| Go to definition | On a prefixed name, jumps to its statement in the same file. |
Completion does not yet offer the namespaces of your Dolfin files; a Turtle imported into Agrafe already declares them in its own @prefix lines.
Context menu
Right-click in the Turtle editor for Cut, Copy, Select word and Paste. In the origin file there is also Reveal in dolfin, described in Reveal.
Editing the origin file
Editing the origin Turtle by hand is supported. Two things follow:
- The Dolfin files do not change on their own. Use Re-translate to Dolfin to bring your edits over.
- While the Turtle has a syntax error, sync is blocked (nothing is written to it) until you fix the error.
Reveal
Reveal jumps between a Dolfin declaration and its Turtle. Right-click a word in the editor to use it.
From Dolfin to Turtle
In a Dolfin file, right-click a name. The menu has Reveal in graph and one of two Turtle items, depending on the project:
| Project | Menu item | Where it takes you |
|---|---|---|
| Imported from Turtle (has an origin) | Reveal in turtle source | The origin .ttl opens in a tab, the statement is selected and flashes for about a second and a half. With several sources, see below. |
| Any other project | Reveal in turtle export | The Output panel switches to its Turtle tab and highlights the block the compiler generated. |
What you can reveal
- concepts and properties;
- the name of a
hasfield; - an enum value inside
one of:; - the id of a
fact.
Any other word (for example the type at the end of has owner: Person) is looked up as a concept or property name.
Which statement
A declaration corresponds to all Turtle statements whose subject is its IRI; Reveal shows the first one in the file. If there are several, a message says Showing the first of N statements. In the export, a concept with a one of: list has two blocks; the first (the class declaration) is shown.
A has field corresponds to its property, so a property shared by two concepts (has name on both) reveals the same statement from either. An enum value corresponds to its individual. A concept with an @iri_name override is found by that exact IRI.
Several Turtle sources
Reveal looks in every source. If more than one declares the name, it opens the best one and says Declared in N Turtle sources; showing the first. The best one is the source that translates the declaration into the Dolfin file you clicked in; after that, sources come in the order they were added.
When nothing is found
- No turtle counterpart: the declaration is new or renamed and the Turtle has not caught up yet (see sync), or the word is not a declaration.
- An error message if the origin Turtle does not parse (with several sources: only when none of the others has the declaration).
From Turtle to Dolfin
In the origin Turtle editor, right-click a prefixed name or an <IRI> and choose Reveal in dolfin. The matching Dolfin file opens with the declaration selected. The item exists only in origin files, not in other .ttl files.
With several sources, Reveal searches only the Dolfin files that source generated.
- On a predicate, a keyword or anything that is not a declaration, Reveal uses the subject of the statement you clicked in. Right-clicking
rdfs:domaininsideex:Dog …revealsDog. - When one IRI maps to several declarations, the order of preference is concept, property, fact, enum value, field.
- The Dolfin source is read as it is now, not as it was at import, so it keeps working after you edit either side.
Messages:
- No dolfin counterpart (not in dolfin yet? use Re-translate): you added the class to the Turtle by hand. See Re-translate.
- No dolfin counterpart found: N dolfin file(s) have syntax errors: Reveal skips Dolfin files that do not parse.
A concept that carries a concept-level @iri_name cannot be revealed from the Turtle yet; it gives the miss message.
Keeping Turtle and Dolfin in sync
In a turtle-origin project, every change you save in a Dolfin file is written back into the original Turtle automatically. You never have to export by hand.
When it runs
- Three seconds after you save a
.dlffile. Further saves within those three seconds are merged into one run. - When you delete or rename a
.dlffile.
It runs once at a time per project and never for edits to package.dlf or to the Turtle itself.
In a project with several Turtle sources, a saved file is synced only to the source(s) that generated it, each against its own reference point. A .dlf file that no source generated (one you created yourself) is not synced to any Turtle. In a project with a single source, every .dlf file syncs to it, as before.
Shared files
A Dolfin file generated by two or more sources is shared. Sync never writes a change to a shared file back to a Turtle: Agrafe cannot tell which source the change belongs to. The other files of the same source still sync, and the chip shows blocked: shared dolfin file, naming the file:
auto-sync skipped shared.dlf: generated by several Turtle sources, so the change cannot go back to one of them. Edit the Turtle sources by hand, then Re-translate
Renaming or deleting a shared file stops the sync of each of its sources completely, until you run Re-translate for that source.
To clear the state, make the same change in the Turtle sources by hand, then Re-translate each source (you can leave every file unticked: the shared file is then accepted as it is).
What is changed in the Turtle
Sync compares what Dolfin produced at the last sync with what it produces now, subject by subject, and touches only the subjects that differ.
- A changed declaration has its statement rewritten in place, using the Turtle’s own prefixes (missing prefixes are added after the last directive).
- A new declaration is appended after its concept’s last statement, or at the end of the file.
- A deleted declaration has its statements removed.
- Everything else is left byte for byte: untouched statements, comments and blank lines between statements, and Turtle that Dolfin does not model (“foreign” statements, for example your own annotations) even on a subject that is rewritten.
Limits
- Comments inside a rewritten statement are lost. Comments between statements are kept.
- A rewritten statement uses the serializer’s layout, not yours, and blank nodes come back with generated labels (
_:ts…). - A restriction or list whose blank nodes no longer match is replaced as a whole (it is listed as Degraded in the report).
- Changes to
package.dlf(version, author, description) are not copied to the Turtle. - Renaming a
.dlffile changes its namespace and therefore the IRI of everything in it. Sync treats it as removing the old subjects and adding the new ones.
The status chip
The project toolbar shows a chip for turtle-origin projects. Click it for details.
With several sources, the chip shows the source of the active tab: the .ttl itself, or the source that generated the active Dolfin file (the first one for a shared file), otherwise the first source. Its name is prefixed to the label, for example onto.ttl: Turtle in sync · 12:03. Undo last sync acts on that source.
| Chip | Meaning |
|---|---|
| Turtle in sync · 12:03 | Last sync succeeded at that (local) time. |
| syncing… | A change is waiting or running. |
| blocked: turtle has syntax error (line N) | The Turtle does not parse. Nothing is written. Fix the error and the next sync goes through. |
| blocked: dolfin has errors | The Dolfin files do not compile. Nothing is written. |
| blocked: shared dolfin file | A file shared with another source changed. See Shared files. |
| error: … | Something else, with the reason (for example read-only when your licence has lapsed, or concurrent edit). |
While blocked, no edit is lost: sync keeps its reference point and applies the whole difference once it can run.
Details
The popover shows the last report:
- Updated, Added, Removed: the subjects sync touched;
- Degraded: blank-node structures replaced as a whole;
- Missing: subjects sync wanted to remove or change but could not find, because you already edited them in the Turtle (skipped);
- the number of non-Dolfin statements kept.
Undo last sync
Undo last sync restores the Turtle as it was before the last sync, and survives a restart. It is refused if you edited the Turtle by hand since, or if it was already used.
Undo changes only the Turtle: the Dolfin edits that were synced stay. Turtle and Dolfin then differ until you change those declarations again or use Re-translate. Later edits sync normally.
If the Turtle is open while sync writes
If someone has the Turtle open, sync edits it as normal text operations, so other people’s cursors and selections are not disturbed. If the text changed under it, sync retries once and then reports error: concurrent edit.
Choosing the source in requests
The sync status, Undo last sync and Re-translate server functions take an optional file_id: the .ttl file id of the source to act on. Without it they act on the project’s only source. In a project with several sources, leaving it out is an error (this project has N Turtle sources: say which one).
Re-translate to Dolfin
Re-translate to Dolfin regenerates the Dolfin files from the current Turtle. Use it after you edited the origin Turtle by hand, or after adding a class there that has no Dolfin declaration yet.
It overwrites Dolfin files, so it always shows a preview first and never touches a file you did not tick.
Start it from the Re-translate to Dolfin… button in the origin Turtle’s toolbar, or from ⟳ Re-translate to Dolfin… in the origin file’s context menu in the file tree.
In a project with several Turtle sources, it acts on one source: the .ttl you started it from. Only the Dolfin files that source generated are compared, plus any existing file with the name of a file it produces. A file it writes joins that source’s files.
The dialog
The Turtle is translated exactly as at import, then compared with your current Dolfin files. Each file gets a status:
| Status | Meaning | Ticked by default |
|---|---|---|
| added | The Turtle now produces a file you do not have. | yes |
| modified | The generated file differs from yours. | yes |
| only in dolfin | You have a file the Turtle does not produce. Kept unless ticked (ticking deletes it). | no |
| unchanged | Identical. Listed collapsed. | no |
package.dlf is never ticked by default: your version, author and description are only overwritten if you tick it.
Shared files
A shared file also holds declarations from other sources. Re-translating one source must never remove them. If the file would lose a declaration that another source’s Turtle makes, its row cannot be ticked, and its note names the other source and the declarations:
shared with b.ttl: re-translating would drop its declarations (Person). Edit this file by hand instead
A declaration that both sources make is written as the source you re-translate makes it. If a shared file does not parse, its row is refused too.
Click a file name to see a side-by-side diff: current Dolfin on the left, after re-translate on the right.
The footer says how many files will be replaced. Confirm with Replace N file(s).
If the Turtle has a syntax error, the dialog shows it with its line and column and does nothing.
Safety
- Previous contents stay restorable from each file’s version history.
- Afterwards the project’s sync reference is set to the new Dolfin files, so the automatic sync that follows finds nothing to do and does not write anything back.
- Edits you saved in the last three seconds in files you did not tick are treated as already synced.
- If something fails halfway, the chip shows
error: partial re-translate — run Re-translate againand automatic sync is switched off. Run Re-translate again: files already written show as unchanged, and it finishes the rest. - The file limit still applies to added files (the origin Turtles and
package.dlfare not counted).
Connecting AI assistants (MCP)
Agrafe is a remote Model Context Protocol server. An MCP client such as Claude can read your deployed ontologies, run SPARQL queries against them and read your project glossaries, with your own permissions.
What it exposes
| Resources | One per deployment you can access: schema://ontology/{deployment_id}, the ontology as Turtle. Titled <project> v<version>; the description lists the concepts (up to 20 by name), the property count and the triple counts. Plus one per project with Live view on: schema://ontology/project/{project_id}, titled <project> (live), the Turtle of the project’s current files (what preview_turtle shows), with _meta.basis set to the live basis. Reading it needs mcp:query; with Live view off it answers a JSON-RPC error whose data is the live_view_disabled refusal, and a project you cannot see answers not-found. |
Tool list_projects | Optional query, include_shared (default true) and folder. Lists your projects and the projects shared with you, deployed or not: an undeployed project has deployments: [], which is why list_deployments does not show it. Each entry has project_id (the id get_project, get_glossary, draft_mapping and list_deployments take), name, comment (the package.dlf description), role (owner, editor or viewer), owner (display name, else email), public, package_iri and package_version (null when package.dlf has none), folder_id (null at the root), created_at, modified_at and deployments ([{deployment_id, version, active}]). query keeps the projects whose name or comment contains it, ignoring case, like the search box of the Projects page. include_shared: false keeps your own projects. folder is a folder id (an entry’s folder_id) and keeps the projects directly in that folder, not in its subfolders; folder names are not unique, so names and paths are not accepted. |
Tool get_project | Argument project_id. Returns the list_projects entry plus file_count (the files shown in the tree: package.dlf and source Turtle files are not counted), limits (the owner’s plan, as a shared project counts against its owner: plan, write_allowed, and files and deployments as {used, max, remaining}, max and remaining being null when unlimited; files.used counts package.dlf, as the file limit does), import_locks ({locked, entries, imports: [{import_iri, requested_version, locked_at}]}, see imports) and git_sync (the Git panel’s status: remote, branch, status, last error, unpushed work and changes since the last checkpoint; never the deploy key; null when the server has no git sync or the project is not connected, see git sync). |
Tool create_project | Arguments name and package_iri, optionally package_version (default 0.1.0), dolfin_version (default 1), description, author (default: your display name), folder and idempotency_key. Creates a private project, as New project on the Projects page does, and writes its package.dlf as the ⚙ Package pane writes it (see package.dlf for the fields). package_iri is required, because Deploy needs a package name: an IRI such as https://example.org/app or a dotted name such as com.example.app. A missing or invalid one is refused before anything is created, with {"error": "invalid_argument", "argument": "package_iri", …}. description is {lang: text} ("" for the untagged entry) or a plain string. folder is a folder id, or the name of one of your folders (refused when several share it). Requires projects:write. When your plan’s project limit is reached, the refusal has rule: "limit", required: {"limit": "projects", "max": …, "settings": "/settings/license"} and a message pointing at Settings → License. A retry with the same idempotency_key returns the same project and does not count against the limit again. Returns project_id, name, files: ["package.dlf"] (it is hidden from the file tree, but it is there), package (as get_package) and diagnostics (the package checker’s errors, normally []). |
Tool get_package | Argument project_id. The project’s package settings, read from its hidden package.dlf: name (the package name, as in the Package pane), version, dolfin_version, rdf_version ("1.1" or "1.2", "1.1" when the line is absent; a hand-written invalid value, which the checker rejects, is returned as written), author, description ({lang: text}, "" for the untagged entry), package_iri (as in list_projects), imports (the raw import lines; see imports) and content_version, the version update_package takes. Requires files:read; any role can read. |
Tool update_package | Arguments project_id and expected_version (get_package’s content_version), and any of name, version, dolfin_version, rdf_version, author, description and message (shown in History). rdf_version is "1.1" or "1.2" exactly (see rdf_version); any other value is refused with {"error": "invalid_argument", "argument": "rdf_version", …} and nothing is written; "1.1" removes the line. Saves package.dlf as the Package pane does: only the fields you pass change, other lines (imports included) stay as they are. description replaces the whole map: pass every language you want to keep, or omit description to leave it untouched. name changes the package name only, never the project name (rename the project on the Projects page). A stale expected_version answers a conflict. A change the package checker rejects is refused and nothing is written. Like the Package pane, the save then re-locks the imports; imports_sync lists each import line’s lock status. Returns the new package (as get_package), imports_sync and diagnostics. Bump version here before update_deployment. Requires projects:write and the owner or an editor with Pro. |
Tool rename_project | Arguments project_id and name (not empty or blank). Renames the project, as renaming it on the Projects page does. While the project’s package.dlf is still exactly as it was created (a package name derived from the old project name, nothing edited), its package name follows the new project name; an edited package.dlf is left alone (change it with update_package). See package.dlf for the fields. Returns {project_id, name, previous_name}. An empty name is refused with {"error": "invalid_argument", "argument": "name", …}. Audited as ProjectRenamed with the old and new names, when the name changes. Requires projects:write and the project owner. |
Tool set_project_public | Arguments project_id and public (true or false). Makes the project public (read-only to anyone on /public, as the Public switch does) or private again. Only a private → public change counts against your plan’s public-project limit: when it is reached, the refusal has rule: "limit", required: {"limit": "public_projects", "max": …, "settings": "/settings/license"} and a message pointing at Settings → License. Turning it off, or setting the value it already has, is never refused by the limit. An expired licence refuses the change to public with rule: "plan"; a project importing a release of a private project cannot be made public. Returns {project_id, public, changed}. Audited as ProjectVisibilityChanged (old_public, new_public) when it changes. Requires projects:write and the project owner. |
Tool move_project_to_folder | Arguments project_id and folder_id: a folder id (as list_projects’ folder_id), or null for the root. Required: leaving it out is refused, so a typo never moves a project to the root. Moves the project into that folder, last among its items, as dropping it on the folder does. A folder that is not yours, or does not exist, and a malformed id are refused with {"error": "invalid_argument", "argument": "folder_id", …}. Returns {project_id, folder_id, previous_folder_id} (null = root). Audited as ProjectMoved (old_folder, new_folder, root for the root) when the folder changes. Requires projects:write and the project owner. |
Tool list_collaborators | Argument project_id. Lists the project’s collaborators, as the Share dialog does: [{share_id, invite_email, role, accepted}], role viewer or editor, accepted false while the invitation is pending. invite_email is the address you typed. Requires projects:write and the project owner. |
Tool invite_collaborator | Arguments project_id, email and role (viewer or editor). Invites the address, as the Share dialog does, and sends the same invitation email: a sign-up link for an address without an account, an in-app invitation otherwise (emailed, unless they had another invitation recently). The answer has the same shape either way. Inviting a current member or a pending address again (with or without an account) keeps the same share_id, sends no new email and only changes the role when it differs; only a sign-up invite whose 24-hour link has expired is replaced, with a new share_id, a new email and status sent. Returns {share_id, invite_email, role, accepted, status}, status sent (new invitation), updated (role changed) or unchanged. Sharing needs a Pro plan: otherwise the refusal has rule: "plan", required: "pro" and a message pointing at Settings → License. A bad role or an empty email is refused with {"error": "invalid_argument", "argument": …}; inviting yourself is an error. Audited as CollaboratorInvited (email, role, status) when the status is sent or updated. Requires projects:write and the project owner. |
Tool remove_collaborator | Arguments project_id and share_id (from list_collaborators). Removes the collaborator, or cancels a pending invitation, as the Share dialog’s remove does; a member who had accepted gets the usual removal email. A share_id that is not one of this project’s is an error. Returns {share_id, removed: true}. Audited as CollaboratorRemoved (share_id). Requires projects:write and the project owner. No Pro plan needed. |
Tool add_import | Argument project_id (the importing project) and exactly one form, as the Package pane’s Imports rows: a release, release_id, or import_project_id and version (from list_releases), writing import <package-iri> "version"; a web import, url and optionally iri (the IRI the import goes by, default the URL), writing import <iri> from <url>; or text, one raw import line (the syntax). Optionally expected_version (get_package’s content_version: a stale one answers a conflict) and message. Saves package.dlf and re-locks as update_package does. An IRI package.dlf already imports has its line replaced (action: "replaced"), never duplicated; the same line again is unchanged. Returns {import_iri, line, action, status, imports, package}: status is this line’s lock status, imports every line’s, package as get_package. A release form locks the release it names, even when another release has the same IRI and version. A text or URL line that several releases match is choice_needed: call add_import again with one candidate’s release_id. A web import is fetched from public addresses only. Requires projects:write and the owner or an editor with Pro. |
Tool remove_import | Arguments project_id and iri (the imported IRI, with or without <>), optionally expected_version and message. Removes its import line from package.dlf and re-locks, which drops its lock (removed). An iri that package.dlf does not import answers {"error": "not_found", "argument": "iri", "imports": [...]} with the current lines. Returns {import_iri, line, removed, imports, package}. Requires projects:write and the owner or an editor with Pro. |
Tool relock_imports | Argument project_id. Re-locks the imports to the saved package.dlf, as saving the Package pane does, and returns {imports}: every line’s lock status (a lock kept as it was is locked with changed: false) and each dropped lock (removed). Requires projects:write and the owner or an editor with Pro. |
Tool list_releases | Argument project_id. Returns importable, the releases the Imports pane’s picker offers this project (from your projects, those shared with you, and public projects, minus the ones this project may not import): {release_id, project_id, project_name, owner, public, package_iri, version, import_line}, public meaning the project is reached only as a public project and import_line the line add_import writes; and own, this project’s releases {release_id, package_iri, version, created_at}, newest first. Requires mcp:read. |
Tool create_release | Argument project_id, optionally version. Creates a release, as the Package pane’s Create release: freezes the saved files under package.dlf’s version. There is no argument to choose the version: set it with update_package first; a version argument is only a check, refused unless it equals package.dlf’s. It needs a clean compile, an absolute package IRI and a version (else {"error": "not_releasable", "message"}); a version already released answers {"error": "conflict"}. With git sync connected, the tag v<version> is added in the background. Returns {release_id, version, package_iri}. Audited. Requires projects:write and the owner or an editor with Pro. |
Tool list_files | Argument project_id. Lists every file of the project, sorted by path: path, kind (the lower-case extension: dlf, ttl, md, csv, json, xml, xlsx, …), size (bytes; for a spreadsheet, the size of the workbook, not of its stored form), version (the version read_file returns), modified_at (when the file was last saved), errors and warnings (how many the Problems panel shows for the file: the file’s share of get_problems, same checker, so cross-file, import, rule, S017 data and mapping (S050, S051, counted in the .dlf holding the mapping) problems count; 0 for files the panel does not check, such as CSV or spreadsheets; null when the check is still running and has no earlier result). A .dlf source also has namespace, the IRI its terms are minted under, as a Deploy mints them: it follows from the package IRI and the file’s path (see packages), and is null when package.dlf has no package IRI or the file does not parse. package.dlf is listed with hidden: true (the file tree hides it, get_project’s file_count skips it). In a project imported from Turtle, the original .ttl has origin: true. Requires files:read; any role can read. |
Tool read_file | Arguments project_id and path (a list_files path, matched exactly), optionally range. Returns content, version and size as the editor shows the file now, live edits included. range is {start_line, end_line}, 1-based and inclusive: only those lines come back (line ends kept), with total_lines and truncated (true when content is not the whole file). end_line may be left out, or be past the end: the read stops at the last line. start_line below 1, end_line before start_line and non-integers are refused. version and size stay the whole file’s, so a later write can pass version as expected_version. A spreadsheet (.xlsx, .xlsm, .ods) has no content: it answers {"kind": "spreadsheet", "sheets": [{"name", "header", "rows"}], "version", "size"}, each sheet with its header row and its first 5 data rows as text, read as a mapping reads them; range does not apply. Files over 5 MiB are refused. A path that is not in the project is a tool error naming it. Requires files:read; any role can read. |
Tool list_versions | Argument project_id, optionally path (a list_files path) and limit (default 100, at most 1000). Lists History versions as the History pane does: with path, that file’s; without, the whole project’s, merged newest first, plus its checkpoint groups [{group_id, name, created_at, members: [{path, oid}]}]. Each version is {oid, path, created_at, is_head, retained, tag, group_id}: oid is the History version id, is_head marks the file’s current version, retained is false once it is outside your plan’s retention window, tag holds the via: mcp lines (client, user, message) of a version an assistant wrote (null otherwise), group_id the group it is in. Returns {versions, total} (and groups). An unknown path answers {"error": "not_found", "argument": "path"}. Requires mcp:read; any role can read. |
Tool read_version | Arguments project_id, path and version (an oid from list_versions). Returns the file’s content at that version, shaped as read_file’s answer plus oid and path. Its version is that content’s hash, equal to read_file’s only when the file still holds that text. A version outside the retention window can still be read. An oid that is not a version of that file (another file’s or another project’s) answers {"error": "not_found", "argument": "version"}. Requires files:read (it returns file content, as read_file); any role can read. |
Tool restore_version | Arguments project_id, path and version (an oid), optionally expected_version (read_file’s version: a stale one answers a conflict) and message (default restore of <oid>). Restores as the History pane’s Restore: the old content becomes a new version on top, older versions stay (never a rewind). Open editors get it live; History tags it via: mcp; git sync and the Turtle sync see it as a save. A version outside the retention window needs a Pro plan: refused with rule: "plan", required: "pro". Returns {restored, path, from_oid, oid, version}: restored is false when the file already holds that text (nothing is written), oid the file’s head version after the restore, version the new content’s read_file token. An oid of another file is not_found. Audited as VersionRestored. Requires projects:write and the owner or an editor with Pro; a viewer is told an editor is required. |
Tool create_checkpoint_group | Arguments project_id, name (at most 200 characters) and versions ([{path, version}], 1 to 200, oids from list_versions). Groups those versions under name, as the History pane’s group creation, e.g. MCP: scaffold passe-plat. Grouped versions are kept past the retention window. Returns {group_id, name, members: [{path, oid}]}. A member that is not a version of that project file is not_found. Audited as CheckpointCreated. Requires projects:write and the owner or an editor with Pro. |
Tool get_git_status | Argument project_id. The project’s git sync status, as the Git panel shows it: {connected: false} when no repository is connected, else {connected: true, remote_url, branch, path_prefix, status, last_error, last_attempt_at, last_pushed_oid, dirty_since, unpushed_wip, pending_checkpoint, diff_vs_last_checkpoint: {added, modified, deleted}} (the same object as get_project’s git_sync). status is ok, paused, diverged, pending_key, auth_failed, …. The deploy key and the host key are never returned, and remote_url never carries a password. Without git on the server, a tool error says why. Requires mcp:read; any role can read. |
Tool git_checkpoint | Arguments project_id and message (1 to 1000 characters, trimmed). Checkpoints now, as the Git panel’s Checkpoint: squashes the work since the last checkpoint into one commit, then pushes it. Returns {commit, push}: commit is the branch tip (null when there was nothing to commit), push is {outcome, error}, or null when no push ran (paused, pending key, diverged). An empty or too long message answers {"error": "invalid_argument", "argument": "message"}. Audited as GitCheckpointed. Requires projects:write and the owner or an editor with Pro. |
Tool git_pause | Argument project_id. Pauses git sync, as the Git panel’s Pause: nothing is pushed until git_resume. Returns {status}. Audited as GitSyncPaused. Requires projects:write and the owner or an editor with Pro. |
Tool git_resume | Argument project_id. Resumes a paused git sync, as the Git panel’s Resume. Refused when sync is not paused, and when the owner’s plan lacks git sync (rule: "plan"). Returns {status} (ok, or pending_key before the deploy key is added). Audited as GitSyncResumed. Requires projects:write and the owner or an editor with Pro. |
Tool add_turtle_source | Arguments project_id, path (a .ttl, .turtle or .n3 name) and content (the Turtle text). Adds the file as a new Turtle source of the project, as the project view’s Add Turtle source: it is translated to Dolfin and its .dlf files are created, or merged into the existing ones; from then on, edits to those files sync back to the Turtle. Returns {source, sources, warnings, diagnostics}: source (and each of sources) is {file_id, path, base_iri, sync_status, sync_message, sync_at, generated_file_ids, generated_files} (generated_files are the .dlf names). A Turtle file that does not translate answers {"error": "bad_content", "file", "message"} (with line:col) and nothing is written. Audited as TurtleSourceAdded. Requires projects:write and the owner or an editor with Pro; the owner’s licence and file limit apply. |
Tool retranslate_to_dolfin | Argument project_id, optionally file_id (the source’s .ttl file id, required when the project has several sources), dry_run (default true) and selected (file names, with dry_run: false). Re-translates the source’s current Turtle to Dolfin, as the project view’s Re-translate to Dolfin. A dry run writes nothing. Applying writes the selected rows and makes the result the new sync baseline, so the next sync changes nothing. See Turtle sources. Dry run: any role, files:read. Apply: projects:write, the owner or an editor with Pro. |
Tool get_problems | Argument project_id, optionally path (a list_files path) and severities (e.g. ["error", "warning"]; values error, warning, info, hint). Returns what the Problems panel shows, from the same checker the editor runs, on the current content (live edits included) with the project’s locked imports loaded, so cross-file references and import errors count: {entries, summary: {errors, warnings}, stale, truncated, fact_error?}. Each entry is {severity, code, file, line, col, end?: {line, col}, message, hint?, fix?: {label, edits: [{file, start_line, start_col, end_line, end_col, replacement}]}, problem_ref}, sorted by file and position. problem_ref is an opaque id of the entry for apply_quick_fix: the same problem at the same place keeps its ref from one check to the next; once the problem is fixed, or moves because the text before it changed, its ref is gone. Lines and columns are 1-based, as the panel shows them. A fix is the panel’s quick fix (and the editor’s: Wrap word in backticks is included); an edit’s file is a list_files path like the entry’s file, and can be another file than the entry’s (for example Declare concept X in file). The S017 data results and the mapping diagnostics (S050, S051) the panel adds after every save are included (see Problems). When that data validation could not run (the project’s sources do not load, e.g. a parse error listed in entries; import data that does not load; a SHACL validation error), fact_error gives the reason as the panel’s note says it: "Data validation failed: …". There are then no S017 entries, and their absence is not evidence that the facts conform. fact_error is absent when the validation ran. It is not filtered by path or severities and does not count in summary. A validation slower than the wait shows as stale: true, not as fact_error. path and severities filter entries; summary always counts the whole project. At most 500 entries come back: beyond that truncated is true and summary still has the full counts. The tool never answers with a half-done check: it waits up to 5 seconds for a running one, and if that is not enough it returns the last complete result with stale: true (call again shortly for a fresh one). For what a code means, see the language reference. An unknown path or severity is a tool error. Requires files:read; any role can read. Every tool that returns diagnostics from this check (write_file, write_files, patch_file, apply_quick_fix, the declaration tools and the Turtle source tools) attaches the same object, fact_error included. |
Tool check_dolfin | Checks a draft and saves nothing: no file, no history version, no collaborative edit, and get_problems keeps answering for the saved content. Arguments files ([{path, content}], list_files paths, each path once), optionally project_id and base. With base: "project" (the default when project_id is given) the files are laid over the project’s current files, an equal path replacing that file and any other path being added, and the locked imports are loaded: use it for any draft meant for a project, so references such as ingredients.Ingredient to the project’s other files resolve. With base: "empty" (the default without project_id) only the given files are checked, with no imports. Returns {diagnostics, namespaces}: diagnostics is get_problems’ {entries, summary, stale, truncated} (same checker, same codes, 1-based positions, 500-entry cap, stale always false) for every file checked, overlaid project files included, with the mapping diagnostics (S050, S051) but without the S017 data results (those need saved data; get_problems adds them) and never with fact_error. namespaces maps each given .dlf to the namespace IRI a deploy gives it; it is empty unless package.dlf (saved or given) names the package with an IRI. There is no glossary in the result: save, then call get_glossary. At most 200 files and 4 MiB of content per call. base: "project" without project_id, another base, an empty or repeated path is a tool error. Requires files:read; with a project_id, any role on that project can check, even with base: "empty". |
Tool get_namespaces | Exactly one of project_id (the project’s current files, live edits included) and deployment_id (the files frozen at the deployment’s Deploy or last Update; a deployment made before its sources were recorded, or a Turtle-origin one, is a tool error). Tells how the package’s terms are named in RDF, as the compiler names them for a Deploy: {package_iri, files, prefixes, imports, rules, basis}. package_iri is null when package.dlf names the package without an IRI. files lists each .dlf except package.dlf, sorted by path: {path, namespace_iri, dotted_name, iri_name_override?}, namespace_iri being the IRI its terms are minted under (terminator included, null without a package IRI or when the package does not load), dotted_name the module other files reference it by (ingredients in ingredients.Ingredient), and iri_name_override the file’s @iri_name, when it has one. prefixes maps each @prefix of the compiled Turtle (as preview_turtle shows it) to its IRI; {} when the package does not compile. imports has one entry per import line: {iri, version, lock_status, dotted_name, namespaces: [{dotted_name, namespace_iri}]}, lock_status being locked, stale (locked at another version) or not_locked (see imports); both branches read the project’s current locks. rules gives the IRI templates for concept (also fields and properties), enum_variant (<namespace_iri><Concept>_<Variant>) and fact (<namespace_iri><id>, so <package_iri>/data#<id> in data.dlf): see how IRIs are named for the rules and the @iri_name overrides. Requires mcp:read; any role can read. |
Tool preview_turtle | Exactly one of project_id and files ([{path, content}], as check_dolfin: each path once, at most 200 files and 4 MiB), optionally path. Returns, as plain text, the Turtle the Turtle tab shows: with project_id, compiled from the current files (live edits included) with the locked imports; with files, those files alone, with no imports (include a package.dlf). It is the ground truth for the IRIs a Deploy mints. As in the tab, spreadsheet (.xlsx, .ods) mappings are left out, and a # Not in this preview: mapping from <…> as XLSX line on top names each one: their rows are read on Deploy and by live SPARQL. path (a .dlf path) keeps the document header (prefixes and package ontology) and that file’s declarations. A project with no .dlf besides package.dlf gives empty text, as the tab is empty. A compile error is a tool error with the compiler’s message; an unknown path is a tool error too. Saves nothing. Requires files:read; any role can read. |
Tool write_file | Arguments project_id, path, content and expected_version (required: the version read_file or list_files gave, or null to create a file that must not exist yet), optionally dry_run and message (shown in History). Creates or replaces one file, as a save in the editor: see how writes behave. path is a list_files path with its extension, such as models/recipe.dlf; folders are created as needed. It is refused with {"error": "invalid_argument", "argument": "path", …}, before anything is written, when it starts with . or /, contains .., \ or a control character, has a hidden segment (.x), writes .dlf or .md in upper case, has an extension the file tree does not take, or, for a .dlf, has a segment that is not a valid namespace name (letters, digits, - and _: a source’s path is its namespace; see how IRIs are named; a .dlf whose content starts with a namespace line only needs a safe path, and the refusal ends with “…, or add a namespace line”), or has the namespace of another .dlf of the project (my-file.dlf next to my_file.dlf). A data file (.csv, .json, .xml, .gpx, a spreadsheet) over 5 MiB is refused with argument: "content"; a spreadsheet’s content is its bytes in base64. Creating a file counts against the owner’s file limit (rule: "limit", required: {"limit": "files", …}); replacing one does not. A stale expected_version, null for a file that exists, or a version for a file that does not, answers a conflict with the current content and version. Writing the same content again saves nothing and returns the same version. Writing package.dlf re-locks the imports, as saving the Package pane does: the result then has imports_sync (as update_package) and package_diagnostics (the package checker’s errors). Returns {version, created, diagnostics, diff}: diagnostics is get_problems’ {entries, summary, stale, truncated} with the entries of the whole project, this file’s first (so truncation never cuts them), and its summary, diff a unified diff from the old content (empty for a new file) to the new one. dry_run: true saves nothing, creates nothing and records nothing (no History, no audit, no import re-lock): it answers the same result plus dry_run: true, checked as check_dolfin with base: "project" checks a draft (no S017 data results, nor fact_error). The conflict check still applies. Requires files:write and the owner or an editor with Pro. |
Tool upload_data_file | Arguments project_id, path, exactly one of text and base64, and expected_version (as write_file), optionally dry_run and message. Creates or replaces one data file (.csv, .json, .xml, .gpx, and .xlsx/.xlsm/.ods where spreadsheets are enabled): write_file with the content given as text or as bytes. See uploading data and writing mappings. Requires files:write and the owner or an editor with Pro. |
Tool import_zip | Arguments project_id, zip_base64 (the zip’s bytes, standard base64, at most 16 MiB compressed and 64 MiB unpacked) and on_conflict (skip or overwrite, required). Imports a project zip as Import → Files does. See importing and exporting zips. Requires files:write and the owner or an editor with Pro. |
Tool export_zip | Argument project_id. Returns a short-lived download link to the zip that Export as zip builds. See importing and exporting zips. Requires files:read; any role. |
Tool write_mapping | Arguments project_id, file (the target .dlf), data_file (a CSV data file of the project), concept and expected_version (the file’s version, or null to create it), optionally overrides, dry_run and message. Writes the draft_mapping draft as a mapping block in file, and answers write_file’s result plus a preview of the first rows. See uploading data and writing mappings. Requires files:write and the owner or an editor with Pro. |
Tool write_files | Arguments project_id and files ([{path, content, expected_version}], each item as write_file‘s arguments: null creates), optionally on_conflict (fail, the default, skip or overwrite), dry_run and message (one History message for every file). Writes several files in one call, for a change that spans files. files must not be empty, each path once, at most 200 files and 4 MiB of content in all; a bad path or size is refused as in write_file, with argument naming the item (files[2].path). A conflict is what write_file answers a conflict for (a stale expected_version, null for a file that exists, a version for one that does not). on_conflict is the choice Import gives: fail writes nothing and answers a conflict with conflicts: [{path, content, version}] listing every one; skip writes the other files and reports the conflicting ones as skipped, with their current content and version; overwrite ignores the versions and writes every file (missing ones are created). Not a transaction: storage saves one file at a time, so everything is checked first (arguments, versions, and the file limit for all the files created at once) and nothing is written if a check fails; then the files are saved in order. If a save still fails (a lost connection, say), the files before it stay saved, it is failed with its error, the ones after it are not_written, and complete is false: re-read those and retry them. Returns {files, complete, diagnostics}: one {path, status, version, created, diff} per item, in order, status being created, written, unchanged (same content: nothing saved), skipped, failed or not_written; and one get_problems pass for the whole call, with the entries of the whole project, the saved files’ first, and its summary. Writing package.dlf re-locks the imports once, after all the files (imports_sync, package_diagnostics). dry_run: true saves nothing and answers the same files (as they would be) with the diagnostics of the project with every file laid over it; conflicts are checked the same way. Requires files:write and the owner or an editor with Pro. |
Tool patch_file | Arguments project_id, path (an existing file) and expected_version (required, a string), exactly one of edits and unified_diff, optionally dry_run and message. Changes part of a text file, safer than write_file while someone else is in it. edits is [{old, new}], applied in order, each on the text the previous ones produced: each old must occur exactly once, byte for byte (line endings included; nothing is normalised). An old found 0 times or 2 times or more fails the whole patch with {"error": "invalid_argument", "argument": "edits", "message": "edits[1].old matches 0 times …; nothing was saved"}; add surrounding lines to make it unique. An empty old is refused. unified_diff is a diff in the usual @@ -a,b +c,d @@ form (the ---/+++ header lines are optional): every hunk’s context and removed lines must match the file exactly at the line it names, or the patch fails with argument: "unified_diff". Passing both or neither is invalid_argument. Spreadsheets cannot be patched: replace them with write_file. A missing file is a tool error; a stale expected_version answers a conflict. The patched file is size-checked like write_file, and patching package.dlf re-locks the imports. Returns {version, created: false, diagnostics, diff} as write_file; dry_run: true saves nothing. Requires files:write and the owner or an editor with Pro. |
Tool add_concept | Arguments project_id, file (a .dlf path) and name, optionally sub (parent concepts), fields ([{name, type, cardinality?, optional?, list_of?, constraints?, iri_name?, form?}], as add_field takes them, omitted cardinality as in add_field), glossary and form ({key: value}, written as the #@ glossary: / #@ form: blocks), closed_variants (the one of: values), plus the semantic tools’ common arguments. Declares a concept without writing text: it is rendered in canonical Dolfin and placed at the end of the file, after the prefix lines, one blank line apart; existing comments and annotations stay as they are. Refused (argument: "name") when the name is already declared in the file’s namespace, in this file or another one minting terms under the same namespace; a same-named concept in another namespace is fine. A name that is not PascalCase is accepted with a warning. Requires files:write and the owner or an editor with Pro. |
Tool update_concept | Arguments project_id, file, name and expected_version, and at least one of sub (the parent list; [] removes it), glossary and form ({key: value} replacing that #@ block; null removes it), plus the common arguments. Edits the concept in place: what is not given (fields, comments, other annotations) is kept. It does not rename: the name stays as it is. Requires files:write. |
Tool remove_concept | Arguments project_id, file, name and expected_version, optionally on_references (fail, the default, or report), plus the common arguments. Deletes the concept with the comment and #@ lines directly above it, without leaving extra blank lines. The answer lists what still uses the concept in the project as references: [{file, line, col, kind, name, context}], where kind and name are the declaration holding the use (fact, rule, query, concept, property…). With fail and references left, nothing is removed and the refusal carries the list; with report it is removed anyway, the list comes back with a warning and diagnostics show the errors it leaves. Requires files:write. |
Tool add_field | Arguments project_id, file, concept, name and type, optionally cardinality (one, optional, some, any, N, at least N, at most N, N..M; omitted = required (1..*, like some), except list of (0..1) and set of (0..*); optional and any = may be absent (0..*), see Cardinality), optional (true is cardinality: "optional", 0..*; false removes it and an optional field becomes required; a contradicting cardinality is refused), list_of (true: list of type, which takes no cardinality; with constraints, written list of (type [ … ])), constraints (value comparisons such as ["> 0", "<= 10"]), iri_name (the absolute IRI of the field’s property, written as its @iri_name line) and form ({key: value}, its #@ form: block), plus the common arguments. Appends a has line to the concept’s body, after its other lines (before a one of: block); a body-less concept X gains its colon. Refused when the edit would add a Duplicate property (argument: "name": the concept already has that field, update_field changes it) or an S019 (argument: "iri_name": another field of that name in the file gives another IRI). Requires files:write. |
Tool update_field | Arguments project_id, file, concept, name and expected_version, and at least one of add_field’s type, cardinality, optional, list_of, constraints, iri_name and form, plus the common arguments. Each given argument replaces that part of the field, null removes it (type stays); cardinality: null, or optional: false on an optional field, leaves no keyword: the field becomes required (as in add_field); the rest (the # and #@ lines above it, its axioms, a trailing # comment) is kept. It does not rename. Refused on a new S019. Requires files:write. |
Tool remove_field | Arguments project_id, file, concept, name and expected_version, plus the common arguments. Deletes the has line with its body (@iri_name, axioms) and the # / #@ lines directly above it. When it was the concept’s last body line, the concept loses its colon. Requires files:write. |
Tool add_property | Arguments project_id, file and name, optionally domain and range (a type), domain_card and range_card (cardinalities), sub (a parent property or a list), inverse_of, equivalent_to (a property path), transitive, symmetric, reflexive (true adds the axiom) and iri_name (absolute IRI), plus the common arguments. Declares a standalone property at the end of the file: one-line property p: D -> R when both sides are given (the side cardinalities need that form, else they are refused), domain X / range X body lines otherwise. Refused (argument: "name") when the name is already declared in the file’s namespace, and on S014 (argument: "domain" or "range") when a side is given twice with different types, such as a domain list of two types: write a union (A or B) instead. A repeated identical type is only the S014w warning and is accepted. Requires files:write. |
Tool add_enum | Arguments project_id, file, concept and variants (a list of names), plus the common arguments. Makes the concept closed: writes its one of: block, after its fields; a body-less concept gains its colon. Refused (argument: "concept") when the concept already has one (add_enum_variant adds to it), and on a variant name given twice. The answer adds variants: [{name, iri}] for every variant of the concept, the IRI as the compiler mints it (read from the Turtle of the edited package, as preview_turtle shows it; null when it does not compile). A variant neither UPPER_CASE nor PascalCase is written, with a warning. Requires files:write. |
Tool add_enum_variant | Arguments project_id, file, concept, variants and expected_version, plus the common arguments. Appends the variants to the concept’s one of: block, at its indent. Refused (argument: "variants") on a variant the concept already has, and (argument: "concept") when it has no block (add_enum writes one). Answers variants and warns as add_enum. Requires files:write. |
Tool remove_enum_variant | Arguments project_id, file, concept, variants and expected_version, optionally on_references (fail, the default, or report), plus the common arguments. Deletes the variants; when none is left, the whole one of: block goes (and the colon of a concept left without body). Refused on a variant the concept does not have. references lists what still uses them (facts, rules…), with the same fail / report behaviour as remove_concept. variants lists those left. Requires files:write. |
Tool set_annotation | Arguments project_id, file, target (concept or field), kind (glossary or form), concept, field (with target: "field"), entries ({key: value}) and expected_version, plus the common arguments. Merges entries into the declaration’s #@ glossary: or #@ form: block: a given key replaces its line, null removes it, other lines stay as written; a new block is added above the declaration, an emptied one goes. Keys are those the readers know: glossary label, pref_label, alt_label, definition, scope_note (each may carry a language tag, definition@en); concept form title, display; field form label, placeholder, help, widget, row, col, group (their meaning: annotations, forms). Another key is refused (argument: "entries"). Requires files:write. |
Tool apply_quick_fix | Arguments project_id, problem_ref (from a get_problems entry) and expected_versions, optionally dry_run and message. Applies that entry’s fix, the quick fix the Problems panel offers (Declare concept X, … in file, Create file and declare, Replace with…, Rename to…, Wrap word in backticks, …), and saves the files it edits. The project is checked again first: if no entry has that problem_ref any more (fixed, or moved), it is a tool error, so call get_problems again; an entry without fix is a tool error too, and so is a check still running (retry shortly). expected_versions gives the version of every file in fix.edits, null for a file the fix creates, as {"models/a.dlf": "…"} or [{path, expected_version}]; a missing or stale one is a conflict listing each such file’s current content and version, and nothing is written. The edits are applied to the current content (live edits included), then the files are written exactly as write_files with on_conflict: fail writes them, and the answer is the same, plus fix: {label} and problem_ref. What the fixes change is described in Problems; for the language itself see the language documentation. Requires files:write and the owner or an editor with Pro. |
Tool list_deployments | Optional filters project_id, active and validation_status, combined (all must match). Lists the deployments you can query: deployment and project ids, project name, your role (owner, editor or viewer), version, active (it has a token that is not revoked, as in get_deployment), validation_status, validation_note, creation date and triple counts. Projects without a deployment are not listed: use list_projects. validation_status tells how much of the package the stored SHACL shapes check, read from the deployment without running a validation: ok (every construct is checked), not_checked (some are skipped; validation_note says how many) or unavailable (no usable shapes: the deployment predates validation, or its shapes could not be emitted; validation_note says which). It does not say whether the data conforms: run validate_deployment for that. Any other validation_status value is refused. |
Tool get_deployment | Argument deployment_id. Tells whether a deployment still matches its project’s current files: version, active (it has a token that is not revoked), created_at, compiled_from (one {path, hash} per file the deployment was compiled from, hash being sha256: and the hex digest of the file; never the file’s content), differs_from_sources and, when it differs, diff_summary (added, removed and changed paths). The current files are compared as Update would compile them. A deployment made before its sources were recorded has compiled_from and differs_from_sources set to null (unknown); Update it once to record them. See Frozen deployments. |
Tool run_sparql_query | Argument query and exactly one of deployment_id or project_id, optionally now (an xsd:dateTime, the time the package’s rules use for now(); see SPARQL). Runs a read-only SPARQL SELECT or ASK query against one deployment, or, with project_id, against the project’s current files compiled on the fly: schema, facts and mapped data, the same store as the SPARQL tab’s Live: current package. The project_id form needs Live view. Both or neither id, a malformed id, query or now is an invalid_arguments refusal; an unknown or inaccessible project or deployment is a project_not_found / deployment_not_found refusal. The rows are not shown in the Instances panel: with project_id, the user can browse the project’s saved data there by picking concepts; it draws their instances and links (that page gives the cap), without unsaved edits or a pinned now, and never a deployment’s data. |
Tool run_project_query | Argument query_name (the name of a Dolfin query of the project) and exactly one of deployment_id or project_id, optionally now. Runs that query’s generated SPARQL, the one add_query returns, as run_sparql_query runs a query: same answer, row cap, timeout, scope mcp:query and rate limit. With deployment_id the query is compiled from the deployment’s frozen files, with its IRIs; with project_id from the project’s current files, on the live package, which needs Live view. An unknown query_name is a tool error listing the queries there are; other errors as run_sparql_query. With project_id, the user can browse the project’s saved data in the Instances panel, as for run_sparql_query. Read-only. |
Tool explain_fact | Arguments subject, predicate (IRIs: <…>, a bare absolute IRI such as http://… or urn:…, or a prefixed name of rdf, rdfs, owl, xsd or skos such as rdf:type, the form proof nodes print) and object (an IRI or a literal: "v", "v"^^<datatype>, "v"@lang; a plain "v" matches the stored literal by its text, whatever its datatype), exactly one of deployment_id or project_id (the latter needs Live view), optionally cursor (proof index, integer, default 0, at most 200) and now (pins the rules’ clock). Returns one proof of the triple, the tree the Agrafe Why? panel shows: {"proof": …, "next_cursor": k+1}, next_cursor null on the last proof; {"derivable": false} when the fact is not derived; a cursor past the last proof gives {"derivable": true, "proof": null, "next_cursor": null}. Each node has a kind saying where it comes from (chips): File (hand-written facts), Mapping (a mapping’s source file, in origin.open), RuntimeData, Source (unknown origin: every stored fact of the live package), Closure (subClassOf, subPropertyOf, sameAs, inverseOf chain or property path, one child per step), Rule (rule.label, bindings in detail, clock_dependent: true when the rule reads now(), directly or through a rule it reads; absent otherwise), Builtin, Negation or Aggregate. A deep or large proof is cut (truncated). Each call recomputes the proofs before cursor, so later proofs cost more, hence the cap. A negative, non-integer or too large cursor, a malformed term or now, or both or neither id, is an invalid_arguments refusal, never {"derivable": false}; not-found as run_sparql_query. Any other prefix (a project namespace, ex:alice) is not read: it is a tool error {"error":"invalid_argument","argument":…,"rule":"unknown_prefix","message":…}, so write that IRI in full in <…>. A bare http:x without // is rejected the same way; bare urn:, tag:, mailto:, file:, data: and tel: IRIs are kept. A proof the reasoner cannot build is a refusal {"error":"refused","rule":"explain_unsupported","message":…} (also from why_not_fact). Scope mcp:query, same timeout and rate limit as run_sparql_query. |
Tool why_not_fact | Arguments project_id (the live package, needs Live view), subject, predicate, object (same term syntax as explain_fact), optionally path (string, a child’s path from a previous answer, default "", the root) and all_fail (boolean, default false). Explains why the triple is not derivable from current data and rules, the tree the Agrafe Why not? panel shows, one level per call: {"path": …, "node": {"summary", "tag", "rule", "all_failing", "conjuncts", "near_misses", "rules", "proofs", "hidden"}, "children": [{"label", "expandable", "path"}]}. Call again with a child’s path (verbatim) to open it; an information-only child has "path": null. With all_fail: true a rule node lists every condition that fails, not only the first; its children’s paths keep that mode (a * after the rule’s index, as in "1*.0"). A fact that holds gives {"derivable": true, "hint": "use explain_fact"}. A malformed path, argument or term is an invalid_arguments refusal; a path with no such child is an explain_unsupported refusal; an unknown or inaccessible project is project_not_found. Each call recomputes the tree down to path. Scope mcp:query, same timeout as run_sparql_query. Read-only. |
Tool validate_project | Argument project_id, optionally files ([{path, content}], unsaved content laid over the project’s files as check_dolfin does: same path replaces, new paths are added; same limits) and now. Validates the project’s own facts and mapped data against the SHACL shapes of its current files, without deploying, and returns the same JSON as validate_deployment, with the live basis. Needs Live view. Errors as run_sparql_query. |
Tool validate_deployment | Argument deployment_id, optionally now (an xsd:dateTime such as 2026-06-15T12:00:00Z, the time date conditions use). Validates the deployment’s data against the SHACL shapes compiled from its package and returns the same JSON as the validate endpoint: conforms, results, skipped (constructs not checked) and warnings. A deployment made before validation existed answers that it must be redeployed. Errors as run_sparql_query. |
Tool deploy_project | Argument project_id, optionally dry_run and idempotency_key. Deploys the project as the Deploy button does (see deployments): it compiles the files as they are saved and publishes them behind a live write API. Each Deploy creates a new id; to change an existing deployment and keep its id, tokens and data, use update_deployment. A project with errors is refused before anything is created, with {"error": "project_has_errors", "summary": {errors, warnings}, "first_errors": […]}, the entries being get_problems’ for the same files. The owner’s plan applies: over the active-deployment limit the refusal has rule: "limit" and required: {"limit": "active_deployments", "max": …, "settings": "/settings/license"}; an expired licence has rule: "plan". dry_run: true creates nothing and returns what the Publish this project? dialog shows: package, version, file_count (files other than package.dlf) and endpoint (POST /api/data/<deployment-id>/triples). Otherwise returns deployment_id, project_id, version, endpoints (triples, sparql, validate, dolfin_file: the data API URLs), triple_counts (schema, fact, data), validation_status and validation_note (as list_deployments), compiled_from (as get_deployment) and basis. The deployment gets its API token as in the UI, but the token value is never returned: copy one from the deployment’s API tokens in Agrafe. A retry with the same idempotency_key within 15 minutes returns the first deployment and creates no other one; the key is yours and per tool, not per project, so use a new key for another project. Dry runs never use the key. IRIs are minted as described in how IRIs are named. Requires deploy:write and the owner or an editor with Pro. |
Tool update_deployment | Argument deployment_id, optionally idempotency_key. Updates the deployment in place as the Update button does: the project’s saved files are compiled into the same deployment_id, whose version goes up by one. Its tokens and the data written through the API are kept; the source graphs of mapped data files (CSV, JSON, XML, …) are rebuilt, and remapped_sources lists those files. A project with errors is refused as for deploy_project. After the update the kept data is validated against the new shapes, as validate_deployment does, and validation sums it up: {status: "ran", conforms, violation_count, result_count, examples} (at most 3 results, in validate_deployment’s shape), or {status: "unavailable", reason} when no shapes are usable or the run timed out. When the kept data no longer conforms, the update stays and the answer has a warning; fix the data or the schema, then run validate_deployment. Also returns version, triple_counts (data counts the kept data), validation_status, validation_note, compiled_from and basis. Requires deploy:write and the owner or an editor with Pro. |
Tool list_deployment_tokens | Argument deployment_id. Lists the deployment’s API tokens, newest first: token_id, created_at, created_by (the user id, null for older tokens) and, when set, created_via ("mcp" for tokens issued by issue_deployment_token; absent for tokens made in Agrafe), last_used_at (the last API call with it, updated at most every 5 minutes), revoked_at and label. Never returns a token value or hash. Requires mcp:read and any role on the project. |
Tool issue_deployment_token | Arguments deployment_id and optionally label. Issues a new API token for the deployment, as the deployment’s API tokens panel does, marked created_via: "mcp" with the issuing user and client. How the secret reaches you is your choice on the consent screen, never the assistant’s (the tool has no argument for it): with Claim link the answer is {token_id, claim_url, expires_at} and the secret stays out of the transcript (see claiming a token); with Return to the assistant it is {token_id, token, warning}: the dlf_live_… value is then in the conversation, and in whatever the client logs, so treat it as exposed there. To change the mode, disconnect and reconnect the client. Audited as TokenCreated. Requires tokens:write and the owner: an editor is refused with rule: "role", required: "owner". |
Tool revoke_deployment_token | Arguments deployment_id and token_id (from list_deployment_tokens). Revokes the token, as the API tokens panel does, and returns {token_id, revoked_at}. Revoking a token that is already revoked returns its original revoked_at. A token of another deployment, or an unknown one, answers not found. Audited as TokenRevoked. Requires tokens:write and the owner: an editor is refused with rule: "role". |
Tool create_share_link | Arguments deployment_id and allowed_concepts (concept names or IRIs of the deployment), optionally expires_at (RFC 3339, in the future), max_submissions (at least 1), quarantine (default false) and public_reference_concepts. Creates a form share link with the same checks as POST …/share-links: an empty allowed_concepts, a past expires_at, max_submissions: 0 or a concept the deployment does not have is a tool error, and nothing is created (concepts are not checked for Turtle-origin projects). The dls_… token is shown once, delivered as issue_deployment_token’s by your choice on the consent screen, never the assistant’s: with Claim link the answer is {link, claim_url, expires_at} (see claiming a token); with Return to the assistant it is {link, token, warning}, and the token is then in the conversation. link is the link as list_share_links shows it. Audited as ShareLinkCreated (via=mcp, the client, the link id, the delivery mode, never the token). Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan"). |
Tool list_share_links | Argument deployment_id. The deployment’s share links, newest first, revoked ones included, with the fields of GET …/share-links. Never returns a token or its hash. Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan"). |
Tool revoke_share_link | Arguments deployment_id and link_id (a link’s id). Revokes the link and returns {link_id, revoked_at}. Idempotent: revoking a link that is already revoked returns its original revoked_at. A link of another deployment, or an unknown one, answers not found. Audited as ShareLinkRevoked, once per link. Requires forms:share and the owner or an editor with a Pro plan (else rule: "plan"). |
Tool write_triples | Arguments deployment_id and triples ([{s, p, o}]), optionally source ({derived_from, label?, agent?}) and dry_run. Writes the triples to the deployment exactly as POST …/triples does: same body, same checks, same code (list values as JSON arrays, typed date strings, the rdfs:subClassOf rules are described there; for the value types themselves see the language reference). All or nothing: a rejected triple writes none of them, and the tool error’s structuredContent is the HTTP 422 body plus its status, {"status": 422, "errors": [{index, message}]}, one entry per rejected triple. Returns {written, graph}: written does not count the unit triples the server adds, graph is the data graph, or with a source the source graph minted for this batch. source.derived_from and source.agent must be IRIs and label at most 500 characters, else {"status": 400, "error": …}. agent defaults to your user IRI (urn:user:<your id>) when a source is given without one. At most 1000 triples per call (more is a tool error, nothing written): split larger batches. The cap is the MCP tool’s; the HTTP endpoint has none. dry_run: true writes nothing and returns the validate_triples report (same code). Audited as TriplesWritten (via=mcp, the client, the count); dry runs are not. Requires data:write and the project owner. |
Tool validate_triples | Arguments deployment_id and triples, optionally source, as write_triples. The dry run of write_triples (the same code as dry_run: true) under its own name, so a read-only client can use it: writes nothing and returns the report of POST …/validate/triples for the stored data plus these triples, conforms, results, skipped and warnings. A rejected triple gives the same {"status": 422, "errors": […]} as write_triples, and the same 1000-triple cap applies. Requires mcp:query; any role on the project. |
Tool list_sources | Argument deployment_id. The deployment’s source graphs, as GET …/sources: {sources: [{graph, derived_from, generated_at, agent?, label?, triples}]}, oldest first. The uuid at the end of graph is what delete_source takes. Requires mcp:read and any role on the project. |
Tool delete_source | Arguments deployment_id and uuid (the last segment of a list_sources graph). Deletes that source graph, its provenance and its manifest entry, as DELETE …/sources/<uuid>, and returns {deleted, removed} (the graph IRI, the triples removed). An unknown source is {"status": 404, "error": …}, a uuid that is not one {"status": 400, …}. A mapped data file’s source (CSV, JSON, XML, …) is rebuilt by every Update, so deleting it only lasts until the next Update: the answer then has a note saying so; remove the mapping or the file to drop it for good. Audited as SourceGraphDeleted (via=mcp, the client, the graph). Requires data:write and the project owner. |
Tool list_pending | Argument deployment_id. The deployment’s pending (quarantined) submissions, as GET …/pending: {pending: [{graph, derived_from, generated_at, triples, subjects, types, data, truncated?}]}, oldest first. SPARQL cannot read a pending graph, so data (the submitted triples, at most 200 per graph, truncated: true beyond) is how to review one. Requires mcp:read and any role on the project. |
Tool approve_pending | Arguments deployment_id and ids (uuids, the last segment of a list_pending graph). Approves them, as POST …/pending/approve: their data becomes queryable. All or nothing: one id that is not pending answers {"status": 404, "error": …} and nothing is approved; a bad uuid is a 400. At most 500 ids per call, checked before anything else. Returns {approved}. Audited as PendingApproved (via=mcp, the client, the count and the ids); an empty ids changes nothing and is not audited. Requires data:write and the project owner. |
Tool reject_pending | Arguments deployment_id and ids, as approve_pending. Rejects them, as POST …/pending/reject: their graphs are deleted. Same all-or-nothing rule, 500-id cap and errors as approve_pending. Returns {rejected, removed} (the graphs, the triples removed). Audited as PendingRejected. Requires data:write and the project owner. |
Tool write_triples with project_id | Arguments project_id (instead of deployment_id: give exactly one) and triples, optionally dry_run; no source. Writes to the project’s live dev dataset (see Live view and deployments), not to a deployment. The triples get the same per-triple checks as POST …/triples, against the project’s current files (a bad triple: {status: 422, errors: [{index, message}]}), then the Live view SHACL check of the current shapes on the dataset with and without the batch: a batch that adds a Violation is refused with {status: 422, error, new_violations} and nothing is written. Violations already in the dataset, such as data a schema change made invalid, do not block a write: they show up in validate_project. Returns {written, basis}. dry_run: true writes nothing and returns the validate_project report with the batch, plus would_write and new_violations. Owner, or editor with Pro; needs Live view; scope data:write. |
Tool clear_live_data | Argument project_id. Deletes the whole live dev dataset and returns {cleared} (the triples removed). Nothing else is touched: files, deployments and their data stay. Owner, or editor with Pro; needs Live view; scope data:write. |
Tool copy_live_data_to | Argument deployment_id, optionally dry_run. Seeds a deployment with its own project’s live dev dataset: the triples are added to the deployment’s data graph, the graph POST /api/data/<id>/triples writes (a deployment’s schema is frozen, its data is not). They are checked against the deployment’s shapes, with and without the copy: a copy that adds a Violation is refused ({status: 422, error, new_violations}), for instance when the deployment predates a property the dev data uses. A deployment made before SHACL validation answers its usual 409 (redeploy it). Returns {copied, deployment_id}; dry_run returns the deployment’s validation report with the copy, plus would_copy and new_violations. The dev dataset is kept. Owner only, like write_triples on a deployment; needs Live view; scope data:write. |
Tool list_dev_tokens | Argument project_id. Lists the project’s dev tokens (dlf_dev_…, for the live HTTP endpoints), newest first, with the fields list_deployment_tokens gives. Never the secret or its hash. Any role on the project; scope mcp:read; works with Live view off, so you can still see what was issued. |
Tool issue_dev_token | Argument project_id, optionally label. Issues a dev token for the project’s live view, delivered like issue_deployment_token (the secret once, or a claim link, as chosen on the consent screen). It works only on /api/projects/<project_id>/live/* of this project, never on a deployment endpoint. Owner only (an editor is refused with rule: "role"); needs Live view; scope tokens:write. |
Tool revoke_dev_token | Arguments project_id and token_id (from list_dev_tokens). Revokes the token and returns {token_id, revoked_at}; revoking twice keeps the first revoked_at. A token of another project is not found. Works with Live view off. Owner only; scope tokens:write. |
Tool describe_concept | Argument name, and exactly one of project_id and deployment_id (both or neither is a tool error). With project_id it compiles the project’s current files with their locked imports, as Deploy does, so it works before any deploy and answers basis: "sources"; with deployment_id it reads that deployment’s frozen schema. Returns one concept as JSON: iri, file (the package-relative path that defines it; empty in deployments made before files were recorded), variants ([{name, iri}] for a one of concept, else empty), parent and child concepts, and each property with iri (the canonical key; predicate_iri is the same value, kept for older clients), range, required (at least one value), cardinality ({min, max}, max null when unbounded, the same as bounds), cardinality_text (get_glossary’s cardinality text), constraints (the bounds as a list such as [">= 1"] or [">= 1", "<= 1"], empty when there are none), is_list (collection is "list"), and the field shape below. For a list of field, range is the element type. IRIs follow how IRIs are named; with project_id they equal a Deploy’s when the package name is an IRI (else they are relative, as in the Turtle tab). A project whose files do not load compiles to no concepts: the error then says so; see get_problems. Not available for Turtle-origin projects. With project_id, requires mcp:read and any role on the project. |
Tool get_glossary | Argument project_id (from list_projects or list_deployments). Returns the project’s glossary, compiled from its current Dolfin sources: concepts, properties and rules, plus lint diagnostics. Each concept, property, datatype and individual has iri, the compiled IRI (see how IRIs are named), and qualified_name, the module-qualified name such as recipes.Recipe that draft_mapping also uses. Concepts and properties also have source_file and line. id is the bare name (Recipe), or the qualified name when two modules declare the same name. Each concept field has the field shape below, next to its older type_ref (List for a list of field) and cardinality. Each entry’s definition (and definition_i18n, per language) is the #@ glossary: definition when there is one, else the text of the leading comment, so a plain # comment above a has line shows as that field’s definition. In the compiled Turtle the two stay apart (skos:definition and rdfs:comment, see comments and labels). If the sources have errors, the tool answers with the diagnostics and whatever partial glossary could be built. |
Tool draft_mapping | Arguments project_id, file (a CSV data file of the project, e.g. Airport.csv) and optionally concept (e.g. Airport). Reads the header and the first 5 rows, and returns a draft mapping as JSON. Given a concept, one fact whose properties are the headers matched to the concept’s property names (with as int, as float or as boolean when its type calls for one) and one variable for each header the fact reads, plus the match scores, the unmatched headers, the sample rows (only with scope files:read; without it sample_rows is left out and sample_rows_omitted says why) and concept_file, the file that defines the concept. The fact’s class is qualified by that file’s module, such as model.Airport for model.dlf, so the draft is valid in any .dlf file of the project. Properties whose type is a concept are never matched: they need an IRI, not a cell. The subject uses an id column when there is one (a header id, or one ending in ID such as Airport ID), as in <urn:airport:{?id}>, else the placeholder <urn:fixme:set-the-subject> to replace. With a concept, source is the block as Dolfin text: paste it in a .dlf file and open it in the mapping form to review it. Without a concept, the draft has one variable per header and no fact yet, and the answer lists the concepts that match the most headers. Writes nothing. |
Resources docs:// | The docs, as Markdown (text/markdown), shipped with the server: docs://agrafe/{page} for this book (the page path without .md, e.g. docs://agrafe/mcp, docs://agrafe/output/validation), docs://dolfin/grammar for the full grammar, and docs://dolfin/syntax/{page} for the other pages of the language book, reference and tutorial alike, by file name (docs://dolfin/syntax/types, docs://dolfin/syntax/01-opening-day). Each page is whole, under a first line naming its URI and the dolfin_version it describes (also in _meta.dolfin_version). Scope mcp:read. An unknown docs:// URI answers a JSON-RPC error. |
Resources file://, glossary:// | file://project/{project_id}/{path}: a project file’s current content as text/plain, exactly what read_file returns (a collaborator’s unsaved edits included). path is the file’s full relative path as list_files gives it, percent-encoded (file://project/P/models/my%20recipe.dlf); it is matched exactly, and an unknown path answers a JSON-RPC -32602 error. Files are not listed one by one: resources/templates/list gives the file://project/{project_id}/{path} template, to a token with files:read. glossary://project/{project_id}: the get_glossary JSON (application/json), listed in resources/list for each project you can access, to a token with glossary:read. Same permissions as the tools: files:read and project access for files, glossary:read for glossaries. A missing scope answers -32001 with the refusal in data, a project you cannot see answers not-found, and a project whose Dolfin has errors answers -32602 with the glossary report. For the Dolfin rules themselves, see the language book. |
Tool get_docs | The same pages, for clients that handle resources poorly. Exactly one of topic and query, or neither. topic is a page URI, with or without docs:// (dolfin/syntax/types, agrafe/mcp): the whole page. An unknown topic is an error listing the valid ones. query searches every page for the text, ignoring case: {dolfin_version, query, total_matches, truncated, hits}, each hit {topic, uri, title, line, snippet}, at most 3 per page and 30 in all. With neither, the index {dolfin_version, topics: [{topic, uri, title}]}. Scope mcp:read. |
| Prompts | explore_ontology (deployment_id), write_sparql_query (deployment_id, question) and explain_concept (deployment_id, concept). Ready-made instructions that walk the assistant through the resources and tools above. Each one ends with the PREFIX declarations of the deployment’s namespaces. All their arguments are required. A fourth prompt, scaffold_app_backend, builds a new project and needs no deployment. |
You can access your own projects and projects shared with you (accepted invitations), with their deployments. A deployment or project that does not exist and one you cannot access give the same error. The mcp:query tools (run_sparql_query, run_project_query, explain_fact, why_not_fact, validate_project, validate_deployment) give it as the project_not_found / deployment_not_found refusal, message unchanged (project not found or not accessible); so does write_triples with project_id.
run_sparql_query returns literals with the datatype they are stored with. An int value comes back as xsd:integer, never xsd:int, whether it was compiled from the sources or written with POST …/triples; a client that type-checks literals should expect xsd:integer.
run_sparql_query returns at most 1000 rows. When more rows match, a second message says the result was truncated; page with LIMIT and OFFSET. A query still running after 10 seconds is cancelled. validate_deployment returns at most 200 results (a second message says when more were dropped). validate_deployment and validate_project time out after 60 seconds.
Frozen deployments
A deployment is a snapshot of the project’s files taken when it was deployed or last updated. Editing the files does not change it: until someone presses Update, run_sparql_query, validate_deployment and describe_concept keep answering from the old snapshot, while get_glossary and draft_mapping read the current files. To tell them apart, every answer of get_glossary, get_deployment, describe_concept, get_namespaces, validate_deployment, deploy_project and update_deployment has a top-level basis field, and so does the SPARQL JSON result of run_sparql_query:
basis | The answer was computed from |
|---|---|
"sources" | the project’s current files (get_glossary, get_namespaces and describe_concept with project_id) |
"deployment:<id>@v<n>" | version n of deployment id (the other tools) |
{"kind": "live", "files": [{"path", "version"}]} | the project’s current files, compiled on the fly (run_sparql_query with project_id, validate_project, the project schema resource). version is the one read_file gives and write_file expects, for each file that was compiled (including files overlays). |
When a deployment answer disagrees with get_glossary, call get_deployment: differs_from_sources: true and its diff_summary name the files edited since the last Update.
Live view
Live view is a project setting, off by default. Only the owner can turn it on, with the Live view switch in the header of the project’s Deployments panel, next to Deploy; no MCP tool can change it. When it is on, an assistant with mcp:query and access to the project can query and validate the project’s current files without deploying: run_sparql_query with project_id, validate_project and the schema://ontology/project/{project_id} resource. They compile the files on every change (a compiled package is reused while no file version changes) and are rate-limited like the other tools.
When it is off, these three refuse, before compiling anything, with:
{"error": "refused", "rule": "live_view_disabled", "message": "Live view is off for this project: …", "hint": "enable Live view in the project settings"}
run_sparql_query with project_id and validate_project include the project’s live dev dataset (empty unless something wrote to it), so data that a schema change makes invalid shows up in validate_project. The dev dataset tools (write_triples with project_id, clear_live_data, copy_live_data_to, issue_dev_token) and the dlf_dev_ HTTP endpoints refuse with the same error when Live view is off. Turning it off deletes nothing: the dev data and dev tokens come back when it is turned on again (list_dev_tokens and revoke_dev_token keep working meanwhile).
Tools that only read the sources, not the data, are not gated: check_dolfin, get_problems, get_namespaces, preview_turtle and describe_concept with project_id.
Field shape
describe_concept (each property) and get_glossary (each concept field) describe a field with the same keys, so the two tools agree:
| Key | Meaning |
|---|---|
collection | "list" for a list of T field, whose value is one ordered rdf:List. "none" for every other field, set of T included: its values are attached directly. |
element_type | The type of each value: T for a list of T field. describe_concept names it as in range (concept name, or quantity text such as mass (quantity, quantitykind:Mass)); get_glossary as in type_ref (mass). |
bounds | {min, max}: how many values the field takes. max is null when unbounded. A list of field is {min: 0, max: 1} (one list; min is 1 for a key), not a count of its members. See cardinality for what each keyword means. |
cardinality | get_glossary: bounds as text: exactly 1, at most 1, at least 1, 2 to 5, any. describe_concept puts that text in cardinality_text and gives cardinality as {min, max}. |
Writing files
Read, then write with the version you read; on a conflict, merge the returned content and retry with its version:
{"name": "read_file", "arguments": {"project_id": "P", "path": "models/recipe.dlf"}}
→ {"content": "concept Recipe:\n has title: string\n", "version": "9c1e…", "size": 37}
{"name": "patch_file", "arguments": {"project_id": "P", "path": "models/recipe.dlf",
"expected_version": "9c1e…", "dry_run": true,
"edits": [{"old": " has title: string\n", "new": " has title: string\n has servings: int\n"}]}}
→ {"dry_run": true, "version": "47ab…", "created": false,
"diagnostics": {"entries": [], "summary": {"errors": 0, "warnings": 0}, "stale": false, "truncated": false},
"diff": "--- a/models/recipe.dlf\n+++ b/models/recipe.dlf\n@@ -1,2 +1,3 @@\n concept Recipe:\n has title: string\n+ has servings: int\n"}
The same call without dry_run saves it. A new file is write_file with "expected_version": null. For what a Dolfin source may contain, see the language reference.
Semantic authoring
add_concept, update_concept, remove_concept, add_field, update_field, remove_field, add_property, add_enum, add_enum_variant, remove_enum_variant, set_annotation, add_fact, update_fact, remove_fact, add_rule and add_query change a .dlf file by declaration instead of by text (the project-wide refactors work differently). They follow the same contract:
fileis the target.dlfpath.package.dlf, spreadsheets and other files are refused (write_fileandpatch_fileedit those).- A missing file is an error naming
create_file. Withcreate_file: trueit is created, starting empty;expected_versionis thennullor omitted. - Otherwise
expected_versionis required, the versionread_filereturned. A stale one answers a conflict, as withpatch_file. dry_run: truesaves nothing.messageshows in History, and the saved version is tagged via MCP, as forpatch_file.- The answer is
{version, created, diff, diagnostics, warnings}(plusreferencesforremove_concept,remove_enum_variantandremove_fact,variantsfor the enum tools,sparqlforadd_query).diagnosticsis theget_problemsresult for the file after the edit; invalid arguments areinvalid_argumentrefusals and save nothing. - New declarations go after the prefix lines, comments and
#@annotations are kept, and the file keeps its line endings. - An edit that would add a Duplicate property,
S014orS019error is refused (theS014wwarning is not), naming the argument at fault; the check is the Problems panel’s. Other problems the edit leaves come back indiagnostics.
What the generated source means is in the language reference: concepts and fields (sub, one of:), cardinality, properties, annotations (#@ glossary:, #@ form:), @iri_name, and the grammar for list of and value constraints.
{"name": "add_concept", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "9c1e…", "dry_run": true, "name": "Ingredient",
"fields": [{"name": "label", "type": "string", "cardinality": "one"}],
"glossary": {"label": "Ingredient"}}}
→ {"dry_run": true, "version": "5d02…", "created": false, "warnings": [],
"diagnostics": {"entries": [], "summary": {"errors": 0, "warnings": 0}, "stale": false, "truncated": false},
"diff": "…\n+\n+#@ glossary:\n+#@ label \"Ingredient\"\n+concept Ingredient:\n+ has label: one string\n"}
{"name": "remove_concept", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "9c1e…", "name": "Recipe"}}
→ {"error": "invalid_argument", "argument": "on_references",
"message": "'Recipe' is still used in 1 place(s); nothing was removed. …",
"references": [{"file": "data.dlf", "line": 3, "col": 14, "kind": "fact", "name": "pancakes", "context": "fact pancakes a Recipe"}]}
{"name": "add_field", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "9c1e…", "concept": "Recipe", "name": "cookMinutes", "type": "int",
"cardinality": "optional", "constraints": [">= 0"], "form": {"label": "Cuisson (minutes)", "row": 4}}}
→ {"version": "a417…", "created": false, "warnings": [], "diagnostics": {…},
"diff": "…\n+ #@ form:\n+ #@ label \"Cuisson (minutes)\"\n+ #@ row 4\n+ has cookMinutes: optional int [ >= 0 ]\n"}
{"name": "update_field", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "a417…", "concept": "Recipe", "name": "cookMinutes", "cardinality": "one", "form": null}}
{"name": "add_property", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "b210…", "name": "basedOn", "domain": "Recipe", "range": "Recipe", "transitive": true}}
→ diff "+property basedOn: Recipe -> Recipe\n+ transitive\n"
{"name": "add_property", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "b210…", "name": "madeWith", "domain": ["Recipe", "Dish"]}}
→ {"error": "invalid_argument", "argument": "domain",
"message": "S014: the domain of property `madeWith` conflicts with itself; nothing was saved. One domain per property: write a union as \"(A or B)\", …"}
{"name": "add_enum", "arguments": {"project_id": "P", "file": "units.dlf",
"expected_version": "c3f8…", "concept": "Unit", "variants": ["Gram", "litre"]}}
→ {"version": "d901…", "created": false, "diagnostics": {…},
"warnings": ["variant 'litre' is neither UPPER_CASE nor PascalCase (e.g. 'Litre')"],
"variants": [{"name": "Gram", "iri": "http://passeplat.fr/units#Unit_Gram"},
{"name": "litre", "iri": "http://passeplat.fr/units#Unit_litre"}],
"diff": "…\n-concept Unit\n+concept Unit:\n+ one of:\n+ Gram\n+ litre\n"}
{"name": "remove_enum_variant", "arguments": {"project_id": "P", "file": "units.dlf",
"expected_version": "d901…", "concept": "Unit", "variants": ["litre"], "on_references": "report"}}
{"name": "set_annotation", "arguments": {"project_id": "P", "file": "models/recipe.dlf",
"expected_version": "e77a…", "target": "field", "kind": "form", "concept": "Recipe", "field": "cookMinutes",
"entries": {"row": 2, "placeholder": "30", "label": null}}}
→ diff "…\n- #@ label \"Cuisson (minutes)\"\n- #@ row 4\n+ #@ row 2\n+ #@ placeholder \"30\"\n"
Facts
add_fact(id, types, values?, allow_incomplete?) writes fact <id> a <types> with one line per entry of values ({field: value}, written in key order). update_fact(id, types?, values?, allow_incomplete?) replaces the type list when types is given, and replaces each field of values in place: the field’s line(s) take the new value, a field the fact does not have yet goes last, null removes one (with its # lines). Other lines, comments and their order are kept. remove_fact(id, on_references?) deletes the fact with its # / #@ lines; on_references and references are as for remove_concept (the facts, rules and queries still using it).
How a JSON value is written:
| JSON | Written as |
|---|---|
| string | a string literal, escaped; or the variant itself when the field’s range is an enum that has it (a string that is not one of its variants is refused) |
| integer, float | an int, a float: 1.0 stays a float (negative numbers have no fact literal and are refused) |
true / false | the boolean |
| array | several values, v1, v2 (one line per item when the items are blocks) |
| object of fields | an anonymous block [ … ]; "$type": "Sub" gives its a Sub line |
{"$ref": "rex"} | a reference to fact rex |
{"$variant": "FICTION"} | an enum variant (checked against the field’s range when it is an enum) |
{"$date": "2024-01-31"} | date(2024-01-31 as y-m-d); other text goes in as is ("June 1st 2026") |
{"$time": …}, {"$date_time": …}, {"$duration": …}, {"$quantity": "45 kg"} | the smart literal with that text |
A tag is a one-key object whose key starts with $, so a block (field names) is never read as one; another $ key is refused, naming values. The facts section of the language reference says what each form means.
The fact tools refuse an id another fact of the namespace already has, a type that is no concept of the project or does not resolve from the file (a bare name is a concept of the file itself; a concept of another namespace takes its qualified name, pets.Dog, and a bare Dog naming it is refused with the name to use; a type qualified by one of the file’s prefix aliases, an import’s concept, is let through with a warning and its fields are not checked), a field that the fact’s concepts (their own or inherited fields, in any file) do not have, and a result that would not parse. They also refuse an edit that leaves a fact without a required field (S010, the Problems panel’s check run before and after the edit: a fact that was already incomplete does not count). With allow_incomplete: true the edit is saved and each such S010 comes back in warnings.
{"name": "add_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "f012…",
"id": "rex", "types": ["pets.Dog"], "values": {"name": "Rex", "species": "Dog", "weight": 4.0,
"born": {"$date": "2024-01-31"}, "owner": {"$ref": "bob"}, "address": {"city": "Paris"}}}}
→ diff "…\n+fact rex a pets.Dog\n+ address [\n+ city \"Paris\"\n+ ]\n+ born date(2024-01-31 as y-m-d)\n+ name \"Rex\"\n+ owner bob\n+ species Dog\n+ weight 4.0\n"
{"name": "add_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "f012…",
"id": "max", "types": ["pets.Dog"], "values": {"weight": 3.5}}}
→ {"error": "invalid_argument", "argument": "values",
"message": "S010: missing required field `name` in fact `max` (type `pets.Dog`); nothing was saved. Give it in values, or pass allow_incomplete: true"}
{"name": "update_fact", "arguments": {"project_id": "P", "file": "data.dlf", "expected_version": "0a9b…",
"id": "rex", "values": {"weight": 4.2, "owner": null}}}
Rules and queries
add_rule(name, source_text) and add_query(name, source_text) take the declaration as Dolfin text: source_text is one rule or query declaration named name (its # lines may come with it). It is appended after the file’s declarations, a blank line apart. Refused, saving nothing (argument: "source_text"): text that does not parse, that declares anything else (another kind, another name, a second declaration), or an edit that adds an error to the file in the Problems checker (an unknown concept, say). A name another rule (or query) of the namespace already has is refused with argument: "name".
add_query also returns sparql, the query’s generated SPARQL with its PREFIX lines, the IRIs of the live package (the one run_project_query with project_id runs), or sparql_error when the query has no SPARQL translation.
{"name": "add_query", "arguments": {"project_id": "P", "file": "pets.dlf", "expected_version": "3c1d…",
"name": "dogs", "source_text": "query dogs:\n ?d a Dog\n"}}
→ {"version": "…", "diff": "…\n+query dogs:\n+ ?d a Dog\n", "diagnostics": {…}, "warnings": [],
"sparql": "PREFIX …\nSELECT …"}
{"name": "run_project_query", "arguments": {"project_id": "P", "query_name": "dogs"}}
Why a fact is not derivable
why_not_fact takes project_id, subject, predicate, object (strings, required), path (string, default "", the root) and all_fail (boolean, default false). Open the tree one node at a time: each child’s path is the argument of the next call.
{"name": "why_not_fact", "arguments": {"project_id": "P", "subject": "<http://ex/alice>",
"predicate": "<http://ex/canVote>", "object": "true"}}
→ {"path": "", "node": {"summary": "… is not derivable from current data and rules", "tag": "goal", …},
"children": [{"label": "stored facts for …", "expandable": true, "path": "0"},
{"label": "rule voter", "expandable": true, "path": "1"}]}
{"name": "why_not_fact", "arguments": {…, "path": "1", "all_fail": true}}
→ {"path": "1*", "node": {"tag": "rule failed", "all_failing": true,
"conjuncts": [{"index": 0, "text": "…", "ok": false}, {"index": 1, "text": "…", "ok": false}], …},
"children": [{"label": "conjunct 1 …", "expandable": true, "path": "1*.0"}, …]}
{"name": "why_not_fact", "arguments": {…a fact that holds…}}
→ {"derivable": true, "hint": "use explain_fact"}
Refactors: rename_symbol and move_declaration
These two change several files at once, so they do not take file: they work on the whole project and write every file they change in one write_files call (on_conflict fail).
rename_symbol(kind, old_qualified, new_name)is the editor’s Rename Symbol (F2): the declaration and every reference in every.dlffile.kindisconcept,enum,property,field,variant,factorquery.old_qualifiedismodule.Name, ormodule.Concept.namefor a field or variant, where the module is the file’s dotted path (ingredients.Ingredient). A bareNameis accepted when only one file declares it. A qualified reference keeps its qualifier (other.Ingredientbecomesother.Item).move_declaration(from_file, to_file, name)moves a concept, enum or property, with its#and#@lines, to the end ofto_file.to_fileis created if it does not exist. References are rewritten so they still resolve:from.Namebecomesto.Nameeverywhere, and plainNameinto_file. A bareNameleft infrom_filebecomesto.Name. Inside the moved block, a bare reference to another declaration offrom_filegets itsfrom.qualifier, andto.Xloses it. Aliases and prefixed names are left as written. How qualified names resolve is in the language reference.
Both are refused (invalid_argument, nothing saved) in these cases: an unknown or ambiguous symbol, an invalid new_name, a name the scope already has (the namespace, or the concept for a field or variant), an edit outside the project’s .dlf sources (import locks, package.dlf and Turtle files are never edited), and any error the change adds anywhere in the project (the Problems checker). Every changed file is written at the version the edit was computed on. If a file changes in between (or a version you pass in expected_versions is stale), the answer is a conflict and nothing is written. dry_run: true returns the diffs and saves nothing. message shows in History.
A .dlf file that does not parse is skipped: its references are not rewritten, so it may still use the old name. The change still goes through, but the answer lists the file in unparsed, adds a warnings entry naming it (recipes.dlf does not parse and was skipped; it may still use the old name …) and has complete: false. Fix the file and update it by hand, or run the refactor again. A stale expected_versions entry for a skipped file is still a conflict: nothing is written. A skipped file you do not list in expected_versions is not checked.
A term’s IRI is its namespace plus its name, so both tools change IRIs. The answer always carries a warnings entry saying so: data already deployed under the old IRIs may be orphaned. It also lists the project’s deployments (deployment_id, version, active; empty when there is none).
{"name": "rename_symbol", "arguments": {"project_id": "P", "kind": "concept",
"old_qualified": "ingredients.Ingredient", "new_name": "Item", "dry_run": true}}
→ {"dry_run": true, "files": [{"path": "ingredients.dlf", "status": "written", "diff": "…"},
{"path": "recipes.dlf", "status": "written", "diff": "…- has uses: ingredients.Ingredient\n+ has uses: ingredients.Item\n"}],
"diagnostics": {…}, "warnings": ["IRIs change: … 1 deployment(s) of this project (see deployments)."],
"deployments": [{"deployment_id": "…", "version": 3, "active": true}]}
{"name": "move_declaration", "arguments": {"project_id": "P", "from_file": "ingredients.dlf",
"to_file": "recipes.dlf", "name": "Item"}}
Uploading data and writing mappings
upload_data_file and write_mapping follow write_file’s contract: expected_version is required (null creates), a stale one answers a conflict, dry_run: true saves nothing, and the answer is {version, created, diagnostics, diff}.
-
upload_data_filetakes the content astextor asbase64(standard alphabet, padded), never both. A.csv,.json,.xmlor.gpxfile is stored as text, so itsbase64must decode to UTF-8. A spreadsheet is binary and is stored as its base64: passbase64, nottext. A file over 5 MiB, measured on the decoded bytes, is refused withargumentnamingtextorbase64. Other paths (.dlf,.md, Turtle) are refused onpath: write them withwrite_file. -
write_mappingreads the CSV, drafts the mapping asdraft_mappingdoes forconcept(an unknown concept getsdraft_mapping’s error), and appends the block tofileafter a blank line, as the mapping form’s Save does. A missingfileis created. Only CSV data files can be drafted. -
overridesadjusts the draft before it is written. It takes three keys; any other key is refused onoverrides:subject: the fact’s subject template, such as<urn:airport:{?code}>.bindings:{var: column}. It adds a variable, or points an existing one at another column.matches:{property: column}. The concept’s property reads that column, with the same cast as the draft (as int, …).nulldrops the property.
Variables that no template reads are dropped. A column that is not in the CSV, or a property that the concept does not have, is refused.
-
Besides
write_file’s fields, the answer hassource(the block written),preview,sample_rows(the first 5 data rows, as text),matches,unmatched_headersandconcept_file.previewis the mapping form’s preview over the first 5 rows:{turtle, rows_total, facts_generated, diagnostics}(an{error}when the mapping cannot expand). -
A CSV without an
id-like column gets the placeholder subject<urn:fixme:set-the-subject>, so every row would become the same resource. The block is still written, with awarningsentry; fix it withoverrides.subject.
For what a mapping block means, see mappings in the language reference.
{"name": "upload_data_file", "arguments": {"project_id": "P", "path": "Airport.csv",
"text": "id,Name,elevation_ft\nBRU,Brussels,184\n", "expected_version": null}}
{"name": "write_mapping", "arguments": {"project_id": "P", "file": "airports.dlf",
"data_file": "Airport.csv", "concept": "Airport", "expected_version": null,
"overrides": {"subject": "<urn:airport:{?id}>"}}}
→ {"version": "5d0a…", "created": true, "diff": "…", "diagnostics": {…},
"source": "mapping from <package://Airport.csv> as CSV\n map: …",
"preview": {"turtle": "…", "rows_total": 1, "facts_generated": 1, "diagnostics": []},
"sample_rows": [["BRU", "Brussels", "184"]], "matches": […], "unmatched_headers": ["id"], "concept_file": "model.dlf"}
Renaming and deleting files: rename_file and delete_file
Both work like the file tree’s Rename and Delete. They need the files:write scope and the owner or editor role, and expected_version is required: the version that read_file or list_files returned. If the file changed since, the answer is a conflict with its current content and version, and nothing changes. Neither tool touches package.dlf or the import locks (.dolfin/imports/**).
rename_file(project_id, from, to, expected_version)movesfromtoto.tofollows the same path rules aswrite_fileand must include its extension. Iftoalready exists, the answer is a 409conflictand nothing is overwritten. Atowhose namespace another.dlfalready has (my_file.dlfwhilemy-file.dlfexists) is refused onto. Iffromdoes not exist, the call is refused onfrom. A new extension must be an allowed one, and a spreadsheet can only become another spreadsheet extension. The origin.ttlkeeps its extension.delete_file(project_id, path, expected_version, confirm?)deletespath.
A .dlf file’s path is its namespace unless it starts with a namespace line; a file with one never changes namespace on rename. A .dlf without one keeps its namespace too: when the rename would change it, a namespace <old> line is inserted as its first code line, the answer carries kept_namespace (the old namespace) and the notice kept namespace … (delete the namespace line to follow the new path) in warnings, and no file loses its references. Its IRIs still change when its raw path differed from that namespace (a dash or a leading digit: my-file.dlf becomes namespace my_file; how paths become namespaces and IRIs is in the language reference). When IRIs change, the answer warns that data deployed under the old IRIs may be orphaned. A .dlf rename always lists the project’s deployments (deployment_id, version, active). references lists the files that still use the old namespace: the rename adds errors there, and those errors are also in diagnostics. Fix them with patch_file, for example. Both answers carry diagnostics, in the same shape as get_problems.
A data file that mapping blocks read can still be deleted, or renamed. The answer warns that the next deploy fails, and mappings lists each block (file, mapping: the block’s position in that file, counting from 1, and source). Update or remove those blocks before you deploy.
The origin .ttl, the file that a Turtle import came from, is only deleted with confirm: true. Without it, the call is refused on confirm and the message says to retry with confirm: true. Deleting it detaches the Turtle source first, so the .dlf files no longer sync with it. Only the project owner can do this. The answer has origin_detached: true.
{"name": "rename_file", "arguments": {"project_id": "P", "from": "ingredients.dlf",
"to": "food.dlf", "expected_version": "9c1e…"}}
→ {"from": "ingredients.dlf", "path": "food.dlf", "version": "9c1e…",
"warnings": ["IRIs change: … 1 deployment(s) of this project (see deployments).",
"1 file(s) still reference the old namespace (see references and diagnostics): …"],
"deployments": [{"deployment_id": "…", "version": 3, "active": true}],
"references": ["recipes.dlf"], "diagnostics": {…}}
{"name": "delete_file", "arguments": {"project_id": "P", "path": "recipes.csv", "expected_version": "47ab…"}}
→ {"path": "recipes.csv", "deleted": true,
"warnings": ["1 mapping(s) read package://recipes.csv (see mappings): the next deploy fails …"],
"mappings": [{"file": "load.dlf", "mapping": 1, "source": "package://recipes.csv"}], "diagnostics": {…}}
Importing and exporting zips: import_zip and export_zip
import_zip(project_id, zip_base64, on_conflict) does what Import → Files does with a zip, and reads the zip with the same code:
- Entries that Import skips are not imported. These are hidden files and folders, paths with
.., nested zips, unsupported extensions and files that are not UTF-8 text. The answer lists each one indropped, as{entry, reason}. Spreadsheets are imported where the server reads them, as withupload_data_file. - A bad file name or an oversized data file refuses the whole zip before anything is written (
invalid_argumentwithstatus400 or 413, as the Import button’s refusal). on_conflictdecides what happens to a path that already exists:skipkeeps the project’s file (Skip conflicts) andoverwritereplaces it (Overwrite all). Any other value is refused onon_conflict.package.dlfis always replaced. New files count against the owner’s file limit (rule: "limit"), checked for the whole zip first.- The zip’s
.dolfin/imports/**locks, as Export as zip writes them, are checked against theirartifact_hashbefore the first file is written. If one lock is incomplete, does not match its hash or repeats an import, the call is refused and nothing is imported. Once the files are written, the locks become the project’s locks and replace the others (locks: {imported, removed}). If storage fails at that last step, the files stay imported andlocks.errorsays so. A zip without locks that brings apackage.dlfre-locks its imports, aswrite_filedoes (imports_sync,package_diagnostics).
The answer reports each file, so a skipped file is never silent:
{"name": "import_zip", "arguments": {"project_id": "P", "zip_base64": "UEsDB…", "on_conflict": "skip"}}
→ {"files": [{"path": "package.dlf", "status": "overwritten", "version": "5d2a…"},
{"path": "recipes.dlf", "status": "skipped", "version": "9c1e…"},
{"path": "steps.dlf", "status": "written", "version": "47ab…"}],
"dropped": [{"entry": ".git/config", "reason": "hidden file or folder"}],
"created": 1, "updated": 1, "skipped": 1, "locks": {"imported": 1, "removed": 0},
"diagnostics": {…}}
status is written (a new file), overwritten or skipped. version is the file’s version after the import, the one read_file gives. For a skipped file it is the version the project kept. The import is a store write, as the Import button’s: each file gets a History version, and a git-synced project autosaves.
export_zip(project_id) returns {url, expires_at}. url is <agrafe>/mcp/export/<ticket>, and a plain GET with no auth header downloads <package name>.zip. The zip holds what Export as zip downloads: every file (live edits included), a minimal package.dlf when the project has none, and the import locks under .dolfin/imports/<import>/. The link works for 10 minutes, and the ticket is random and kept in the server’s memory only (a restart forgets it). The zip is built when the link is fetched, after checking again that the user still has access and the token’s files:read scope. The link is single use: the first GET consumes it (a HEAD does not). A link that has been used or has expired, whose OAuth token has been revoked, or whose user has lost access, answers 404; call export_zip again for a new one. Anyone holding an unused link can download the zip once, so treat it like a token. Importing the downloaded zip with import_zip into another project gives the same files and locks.
Building an app backend: scaffold_app_backend
The prompt scaffold_app_backend walks the assistant from an app idea to a deployed, seeded backend. Its arguments are app_description (required: what the app does and which data it keeps) and package_iri (optional: the package IRI of a new project, e.g. https://example.org/app). It needs no deployment_id, because the deployment does not exist yet. The prompt quotes app_description as the user’s text and tells the assistant to read it as data, not as instructions.
First the assistant reads the language rules with get_docs: dolfin/syntax/syntax (cardinality and one of:), dolfin/syntax/types and dolfin/syntax/turtle (how IRIs are named). The prompt does not copy these rules; they are the pages of the language book. Then the steps are:
list_projects, andcreate_projectif no project fits.check_dolfinon the draft files, until it reports no errors.write_files(new files:expected_version: null).get_namespaces, andpreview_turtleto spot-check the IRIs.- The Live view checks, only if the user turns them on (see below).
deploy_projectwithdry_run: true, then for real.issue_deployment_token. In claim-link mode the user opens theclaim_urland copies the token into the app’s.env. In return mode the assistant writes the token to.envitself. Either way, the assistant never repeats the token.write_tripleswithdry_run: trueon seed data, fixing each violation in the report.write_triplesfor real.validate_deployment, which must reportconforms: true.- Optionally,
run_sparql_queryon the deployment.
Live view is off by default, and only the owner can turn it on. So, before any live check (validate_project, run_sparql_query or write_triples with project_id), the assistant asks the owner to turn on the Live view switch in the header of the project’s Deployments panel, next to Deploy. A refusal with live_view_disabled carries a hint asking to enable Live view; the switch is the one above. If Live view stays off, the assistant skips the live checks and checks the data with validate_deployment after deploying.
Imports and releases
add_import, remove_import and relock_imports edit the import lines of package.dlf, then re-lock them, as the Imports rows and Save package settings do. Each line’s lock status is {import_iri, status, changed, ...}, changed meaning this call wrote or dropped the lock:
status | Also | Meaning |
|---|---|---|
locked | release_id (null for a web import) | Resolved; your files see the import’s names. |
failed | reason | Not resolved, e.g. no release and the URL could not be fetched, or a public project importing a private release. |
choice_needed | candidates: [{release_id, project_id, project_name, owner, version, package_iri}] | Several releases match the line. Nothing is locked until you call add_import with one release_id. |
removed | The lock of a line no longer in package.dlf was dropped. |
list_releases lists what can be imported; create_release makes this project importable. See what releases are for.
History: list_versions, read_version, restore_version, create_checkpoint_group
These tools are the History pane’s list, preview, Restore and groups. They are not releases, which are for imports only.
Two ids are involved. An oid (from list_versions) names a History version. A version (from read_file, and what expected_version takes) is the SHA-256 of a file’s content. History merges quick saves within about 15 seconds into one version, which changes its oid, so oids are for history, versions for writes. A restore within 15 seconds of the file’s last version, changing one region only, merges into that version too, as in the History pane.
To undo its own edits, an assistant can:
- Call
list_versionswithpathbefore editing, and note each file’s headoid. - Make the edits, then group the versions they made with
create_checkpoint_group(name it, for example,MCP: scaffold passe-plat). - To undo, call
restore_versionwith each file’s notedoid. There is no group restore: restore files one by one, as in the History pane.
Git sync: get_git_status, git_checkpoint, git_pause, git_resume
These tools are the Git panel’s status, Checkpoint, Pause and Resume, with the same rules (see who can do what). On a project with no repository, the three write tools answer project is not connected to a repository. When the connection keeps its token in the user’s browser, get_git_status reports token_in_browser: true (and waiting_for_browser while work waits to be pushed), and git_checkpoint is refused: MCP never holds that token. Connecting, disconnecting, importing from the repository, switching branch and resolving a divergence (overwrite the remote, take the remote version) are UI-only: no MCP tool does them.
Turtle sources: add_turtle_source and retranslate_to_dolfin
These tools are the project view’s Add Turtle source and Re-translate to Dolfin, with the same rules and the same translation: see Turtle projects. How Turtle maps to Dolfin is in the language reference.
retranslate_to_dolfin overwrites Dolfin files, so it previews by default. Run a dry run first, read the rows, then apply:
{"name": "retranslate_to_dolfin", "arguments": {"project_id": "P"}}
→ {"source": {"file_id": "T", "path": "onto.ttl", …},
"files": [
{"name": "org.dlf", "status": "Modified", "default_selected": true, "blocked": null,
"lines_added": 1, "lines_removed": 0, "diff": "--- a/org.dlf\n+++ b/org.dlf\n@@ …\n+ has nick: string\n", "truncated": false},
{"name": "other.dlf", "status": "Added", "default_selected": true, "blocked": null,
"lines_added": 2, "lines_removed": 0, "content": "concept Thing:\n has label: string\n", "truncated": false},
{"name": "extra.dlf", "status": "Deleted", "default_selected": false, "blocked": null,
"lines_added": 0, "lines_removed": 2}],
"unchanged": ["package.dlf"]}
{"name": "retranslate_to_dolfin", "arguments": {"project_id": "P", "dry_run": false}}
→ {"added": 1, "modified": 1, "deleted": 0, "applied": ["org.dlf", "other.dlf"], "diagnostics": {…}}
- Each changed row has a
status(Added,ModifiedorDeleted; unchanged files are listed by name inunchanged), line counts, and, forModified, a unifieddiff(current → translated), or, forAdded, the newcontent. A text over 64 KiB is cut (truncated: true);read_filehas the current text. - Without
selected, apply writes thedefault_selectedrows.package.dlfandDeletedrows (Dolfin files the Turtle no longer produces) are never selected by default: name them inselectedto apply them. - A row with
blockedset is a.dlfanother Turtle source also generated, which this re-translate would strip of that source’s declarations. Selecting it refuses the whole call ({"error": "blocked", "file", "message"}), and nothing is written. - On a project with several sources, a call without
file_idanswersinvalid_argument(argument: "file_id") with thesourcesto pick from. A project with no Turtle source answers{"error": "no_turtle_source"}. - A Turtle that does not parse answers
bad_content, as inadd_turtle_source. - Selected names that are not rows of the diff are refused (
argument: "selected"). Apply is audited asRetranslated.
Scopes
| Scope | Kind | Allows |
|---|---|---|
profile | read | Your email and display name. |
mcp:read | read | Connect, list and read resources and prompts, run list_projects, get_project, list_deployments, get_deployment, describe_concept, get_namespaces, get_docs, list_sources, list_pending, list_releases, list_versions and get_git_status; read the docs:// resources. |
mcp:query | read | Run run_sparql_query, explain_fact, why_not_fact, validate_deployment, validate_project and validate_triples; read schema://ontology/project/{project_id}. |
glossary:read | read | Run get_glossary and draft_mapping (its sample rows also need files:read). |
files:read | read | Read package settings (get_package), list and read project files (list_files, read_file), problems (get_problems), check drafts (check_dolfin), preview Turtle (preview_turtle), export a zip (export_zip), read History versions (read_version). |
projects:write | write | Create projects (create_project), edit package settings (update_package), rename projects, make them public or private and move them between folders (rename_project, set_project_public, move_project_to_folder; owner only); edit imports (add_import, remove_import, relock_imports) and create releases (create_release); restore History versions and group them (restore_version, create_checkpoint_group); checkpoint, pause and resume git sync (git_checkpoint, git_pause, git_resume). |
files:write | write | Create, write and patch files (write_file, write_files, patch_file, apply_quick_fix, add_concept, update_concept, remove_concept, add_field, update_field, remove_field, add_property, add_enum, add_enum_variant, remove_enum_variant, set_annotation, upload_data_file, write_mapping); rename and delete files (rename_file, delete_file); import a zip (import_zip). |
deploy:write | write | Deploy and Update (deploy_project, update_deployment). |
tokens:write | write | Issue and revoke deployment tokens (issue_deployment_token, revoke_deployment_token) and dev tokens (issue_dev_token, revoke_dev_token): this client can mint API tokens. |
data:write | write | Write triples (write_triples), write and clear the live dev dataset (clear_live_data, copy_live_data_to), delete sources (delete_source), approve or reject pending data (approve_pending, reject_pending). |
forms:share | write | Create, list and revoke form share links (create_share_link, list_share_links, revoke_share_link): this client can mint dls_ share tokens. |
A client that asks for no scope gets the read scopes it is allowed, never a write scope, and is authorized without a consent page. A tool called without its scope answers access denied: missing <scope> scope.
Write access is opt-in
When a client asks for a write scope, Agrafe shows a consent page. It lists the read scopes the client gets, then one checkbox per write scope the client asked for, none of them ticked. Only the scopes you tick are granted; Cancel sends the client back with access_denied. Ticking API tokens (tokens:write), share links (forms:share) or both shows, once below the write scopes, how new tokens (API tokens and dls_ share tokens) should reach you:
| Choice | |
|---|---|
| Claim link (default) | The assistant gets a link; you open it in Agrafe to see the token. |
| Return to the assistant | The token value is returned to the assistant. |
The choice is stored with the authorization and kept when the client refreshes its token. To change scopes or the choice, disconnect and reconnect the client.
Claiming a token
In claim-link mode issue_deployment_token (and issue_dev_token, create_share_link) answers a claim_url (/claim/token/<id>) instead of the token. Open it signed in to Agrafe as the user who connected the assistant: the page shows which deployment and label the token is for, and Reveal token shows the dlf_live_… value once, with a Copy button. Opening the page does not use the link up (so link previews cannot burn it); revealing does. Another account sees “belongs to another account” and the link stays valid for you.
A claim link works once and for 10 minutes. The pending secret is held only in the server’s memory, so a restart of Agrafe also voids it. Either way the token itself was created: revoke it (revoke_deployment_token or the API tokens panel) and issue a new one. For a share link, revoke the link (revoke_share_link) and create a new one.
Connectors registered before a scope was offered must be reconnected to get it, as for glossary:read. Tokens issued before write scopes existed have none and keep none.
Roles
Write tools act as you, with your role in the project (see collaboration):
| Role | Can |
|---|---|
| Owner | Everything. |
| Editor with a Pro plan | Files and package settings (imports and releases included), Deploy, Update, form share links. |
| Editor without Pro | Read only (form share links need Pro too, as in Agrafe). |
| Viewer | Read only. |
Only the owner can share, rename or delete the project, make it public, issue or revoke deployment and dev tokens, and connect git. The owner’s plan limits (projects, files, active deployments, public projects) still apply. A project you cannot see answers the same not-found error as one that does not exist.
Refusals
A tool that refuses (write tools, and the mcp:query tools for bad arguments and not-found) answers a tool error (isError: true) whose text is JSON, also sent as structuredContent:
{"error": "refused", "rule": "scope", "message": "this connection lacks the files:write scope; …", "required": "files:write"}
rule | Means | required |
|---|---|---|
scope | The connection was not granted the scope. Reconnect and tick it. | The scope. |
role | Your role does not allow it. | "editor" or "owner". |
plan | You are an Editor without a Pro plan. | "pro". |
limit | The owner’s plan limit is reached. | {"limit": "files", "max": 50} (or projects, active_deployments, public_projects). |
live_view_disabled | The project’s Live view is off. Carries hint instead of required. | none |
invalid_arguments | An argument of an mcp:query tool is missing or malformed; message names it. Nothing was read. | none |
project_not_found | The project does not exist or you cannot see it: the same answer for both. | none |
deployment_not_found | Same, for a deployment. | none |
explain_unsupported | explain_fact / why_not_fact cannot build that proof or node. | none |
How writes behave
These rules apply to every write tool as it ships.
-
Versions. A file’s
versionis the SHA-256 (hex) of its content, so it stays the same when History merges quick saves. Every write takesexpected_version: theversionyou last read, ornullto create a file that must not exist yet. While someone edits the file live, the version is computed from what they see now. -
Conflicts. When
expected_versionno longer matches, nothing is written. The tool answers a tool error, shaped like a refusal, with the current content and version, so you can merge and retry:{"error": "conflict", "status": 409, "message": "the file changed since you read it …", "content": "…", "version": "3f2a…"}contentandversionarenullwhen the file does not exist. -
Idempotency. Mutating tools take an optional
idempotency_key. A retry with the same key, by the same user, on the same tool, within 15 minutes returns the first successful result without doing the work again, even when the other arguments differ. Failed calls are not remembered. Secrets are never kept for replay: a replayedissue_deployment_tokenanswer has no token and lists the removed fields inredacted.write_file,write_filesandpatch_filetake no key: theirexpected_versionalready makes a retry safe (a retry of a write that went through answers a conflict whosecontentis what you wrote). -
History. A write is a normal save: collaborators editing the file see it live (an open project page picks up new files, and the Problems of files it does not have open, within a few seconds), it appears in History (merged with saves made in the next 15 seconds, like typed edits), and it triggers the git-sync autosave. Its History version is tagged
via: mcpwith the client name, your user and the optionalmessageof the write. A typed edit that merges into it keeps the tag. -
Audit log. Project create and delete, project rename, visibility change and folder move, collaborator invite and removal, package settings changes, file writes (
FileWritten), Deploy, Update, token issue and revoke, source delete, pending approve and reject, and share link create and revoke are recorded in the audit log asvia=mcp client=<name>, with ids only, never secrets or content.
Connecting
Claude (claude.ai)
Add a custom connector with the URL https://agrafe.dolfin.fr/mcp. Claude registers itself as a public OAuth client (no secret, PKCE), sends you to Agrafe to log in and authorize, and connects. No configuration file is needed.
Claude Desktop and other stdio clients
Settings → MCP in Agrafe shows a ready-to-copy configuration that bridges through mcp-remote:
{
"mcpServers": {
"agrafe": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://agrafe.dolfin.fr/mcp/sse"]
}
}
}
Use Copy config and paste it into claude_desktop_config.json.
Endpoints
For integrators. Both transports are supported:
| Endpoint | |
|---|---|
POST, GET, DELETE /mcp | Streamable HTTP (protocol 2025-06-18 or 2025-03-26). |
GET /mcp/sse and POST /mcp/message?session_id=… | SSE transport (protocol 2024-11-05, older clients). |
initialize answers with the protocol version the client asked for when it is one of 2025-06-18, 2025-03-26 or 2024-11-05. Otherwise it answers with the newest, 2025-06-18, or with 2024-11-05 if the client sent no version.
On the streamable transport, POST /mcp takes one JSON-RPC request and returns one JSON response; batches are not supported. The response to initialize carries an Mcp-Session-Id header. Send it on every later request:
| Case | Status |
|---|---|
| Header missing | 400 |
| Unknown or expired session | 404 (start again with initialize) |
| Session opened by another user | 403 |
MCP-Protocol-Version header present but not a supported version | 400 |
GET /mcp with the session header opens a Server-Sent Events stream for messages from the server. Opening a new one replaces the previous stream. DELETE /mcp ends the session. A session with no open stream expires one hour after its last request.
Supported methods: initialize, ping, resources/list, resources/templates/list, resources/read, resources/subscribe, resources/unsubscribe, tools/list, tools/call, prompts/list, prompts/get. Any notifications/* message is acknowledged and ignored.
The server advertises resources.listChanged. When a project gets a new deployment, or one of its files is created, deleted or renamed (in the editor, by an import, or by an MCP write tool), every open stream of every user who can access that project (owner or accepted share) receives notifications/resources/list_changed: the GET /mcp stream on the streamable transport, the /mcp/sse stream on the SSE transport. A streamable session with no GET /mcp stream open gets no notification. A deployment never changes once created, so only the live project resource can be subscribed to (next section).
Live schema change notifications
The server also advertises resources.subscribe. Subscribe to a project’s live schema resource:
{"jsonrpc": "2.0", "id": 7, "method": "resources/subscribe",
"params": {"uri": "schema://ontology/project/<project_id>"}}
The subscribe call is checked like resources/read of the same URI. The project’s Live view setting must be on (else the live_view_disabled error), you need scope mcp:query and access to the project. Any other URI gets -32602 (invalid params). resources/unsubscribe with the same params stops it.
Each time a file of the project is saved (editor autosave, write_file, REST update, file create, delete or rename), the session’s stream receives:
{"jsonrpc": "2.0", "method": "notifications/resources/updated",
"params": {"uri": "schema://ontology/project/<project_id>"}}
The notification carries no content: call resources/read on the URI again to get the new Turtle. Saves less than half a second apart give one notification. Nothing is sent once Live view is switched off or you lose access to the project, and nothing is queued: a streamable session without an open GET /mcp stream can subscribe but gets no notifications. Subscriptions belong to the session and end with it.
Authorization is OAuth 2.1 with PKCE (S256):
| Endpoint | |
|---|---|
/.well-known/oauth-authorization-server | Server metadata. Lists client_secret_post and none as token authentication methods. |
/.well-known/oauth-protected-resource (also under a path suffix such as /mcp/sse) | RFC 9728 metadata. |
/oauth2/register | Dynamic client registration. token_endpoint_auth_method: "none" registers a public client with no secret. |
/oauth2/authorize, /oauth2/token, /oauth2/revoke, /oauth2/userinfo | The usual flow. |
Rate limits
POST /mcp, DELETE /mcp and POST /mcp/message are rate-limited per access token: 100 requests per minute by default (RATE_LIMIT_RPM on the server), counted separately from the data API. Over the limit, a request gets 429 Too Many Requests; wait and retry. Opening a stream (GET /mcp or GET /mcp/sse) is not limited. There is no per-plan query quota.
An unauthenticated request gets 401 with WWW-Authenticate: Bearer resource_metadata="…/.well-known/oauth-protected-resource", which is how a client discovers where to log in.
Behind a proxy
The SSE stream needs unbuffered responses. Agrafe sends X-Accel-Buffering: no, so nginx does not stall the handshake; other proxies must not buffer /mcp/sse either. HOST=https://… splash-graph/check-mcp.sh checks discovery, OAuth registration, both transports and the buffering.