Upload files and link them to resources

Northwind comes with images: a photo per employee, an icon per category. Uploaded files are stored content-addressed — the file's URL is derived from the SHA-1 hash of its content, under {base}uploads/. The same bytes always land at the same URL, which is what makes file references stable enough to bake into import mappings.

Linking files to resources

A file becomes part of the graph the moment something points at it. The category mapping from the Data stage does exactly that — the CSV carries each image's hash in its pictureHash column, and the mapping mints the upload URL from it:

?category foaf:depiction ?picture .
...
BIND(uri(concat(str($base), "uploads/", encode_for_uri(?pictureHash))) AS ?picture)

The employee mapping does the same with a photoHash column, linking the portrait with foaf:img, the predicate for an image of a person, while foaf:depiction is the looser depicts relation used for the category art.

Click the Create dropdown at the bottom of the page and select File. Choose the file, give it a title, and save. The Upload file guide walks through the form in detail.

What you now see

Category and employee documents now render with their images — foaf:depiction and foaf:img are picked up by the default layout, no template work required.

An employee document with the photo rendered

How this works

  • Hierarchical URIs — the content-addressed uploads/{sha1sum} namespace in the dataset structure
  • Upload file — the upload form and the CLI command, step by step

Next: Insight