ldh-AddFile
Uploads a local file to a LinkedDataHub document as an RDF-described resource, stores the bytes in the uploads namespace, and returns the file URI for placement in content.
Instructions
Adds a file to a LinkedDataHub document via multipart RDF/POST.
Appends `a nfo:FileDataObject ; nfo:fileName ; dct:title ; ...`
to the target document and stores the file bytes at
`<base>/uploads/{sha1}` (LDH's built-in upload namespace).
The file is a resource the document holds, not one of its content blocks: to show it in the content mode,
place it with ldh-AddObjectBlock, the returned `url` as its value.
Arguments:
- `url` — URI of the target document to add the file's description to.
- `file` — absolute local file path. The bytes are read and streamed
to the server.
- `title` — human-readable title (`dct:title`).
- `description` — optional description (`dct:description`).
- `content_type` — optional MIME-type override; auto-detected from
the file path if absent.
Returns a result with `url` (the uploaded file's URI, as the document
describes it after the upload: `<base>/uploads/{sha1}`, `<base>` being
the application's base URI) and `status` (HTTP status code) bindings.
Place the file in the content with ldh-AddObjectBlock, `url` as value.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"url": "<url>",
"file": "<file>",
"title": "<title>"
},
"name": "ldh-AddFile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Target document URI to add the file's description to. | |
| file | Yes | Absolute local file path. The bytes are read and uploaded. | |
| title | Yes | Title of the file (dct:title). | |
| description | No | Optional description (dct:description). | |
| content_type | No | Optional MIME-type override; auto-detected from path if absent. |