agentleFS
OpenLinkSoftwareOpenLinkSoftware/ai-agent-skills/virtuoso-rdf-bulk-loader/SKILL.md

virtuoso-rdf-bulk-loader

Skill42 starsChanged 51 days agoMITView on GitHub

Generate and run Virtuoso isql bulk-load scripts for RDF directories. Takes a source folder plus optional graph IRI, file pattern/formats, and load mode (directory-wide via ld_dir + rdf_loader_run, or per-file named graphs via TTLP_MT with an auto prefix preamble), and emits a ready-to-run .sql. Use when bulk-loading RDF files from a folder into a Virtuoso quad store via isql, regenerating loader scripts after store changes, or simplifying repeated folder loads.

The file

Files
SKILL.md

Virtuoso RDF Bulk Loader — isql loader generation from a source folder

Generate a ready-to-run isql .sql from a local folder of RDF files. Two modes:

ModeMechanismUse for
dir (default)ld_dir + rdf_loader_run — one named graph for the whole folder; Virtuoso auto-detects format (N-Triples, Turtle, RDF/XML, N-Quads, TriG, JSON-LD, Notation3) and reads gzip/bzip2 nativelySimple bulk ingestion, mixed formats, compressed archives
per-fileTTLP_MT — one named graph per file (Turtle family: .ttl, .nt, .trig), optional auto prefix-preamble and CLEAR-before-loadExact per-document graphs (e.g. an agent memory store), re-loadable deltas

Workflow

  1. Elicit (never guess): source folder (must be accessible to the Virtuoso server process — ld_dir registers server-side paths), target graph IRI (dir mode), file pattern or format list.
  2. Generate:
    python3 scripts/generate-bulk-load-sql.py \
      --source-dir /path/to/rdf/ \
      --graph https://example.com/my-graph \
      --pattern '*.ttl' \
      --out bulk-load.sql
  3. Run (your credentials, never displayed):
    isql 1111 dba <dba-password> -f bulk-load.sql
  4. Monitor (the generated script ends with the load_list check):
    select * from db.dba.load_list where ll_state <> 2;
    ll_state 2 = done; rows remaining = still pending/errored (ll_error column).
  5. Verify (generated script ends with per-graph counts):
    SPARQL SELECT ?g (COUNT(*) AS ?t) WHERE { GRAPH ?g { ?s ?p ?o } } GROUP BY ?g;

Options (generate-bulk-load-sql.py)

FlagDefaultMeaning
--source-dir(required)Folder containing the RDF files (server-visible path)
--graphurn:dav:/DAV/home/kidehen/bulk-load/Target named graph (dir mode)
--pattern*.*ld_dir pattern, e.g. *.ttl, *.nt.gz, *.nq
--formats—Shorthand expanding to patterns, e.g. ttl,nt,nq
--modedirdir (ld_dir) or per-file (TTLP_MT per document)
--graph-baseurn:dav:/DAV/home/kidehen/bulk-load/IRI prefix for per-file graphs (file relpath appended)
--preambleoffper-file mode: prepend store-wide prefix union so prefix-undeclared Turtle loads
--clearoffEmit SPARQL CLEAR GRAPH before loading (idempotent re-runs)
--outbulk-load.sqlOutput path
--dry-runoffPrint the script instead of writing

Notes

  • Server-side paths: ld_dir paths are read by the Virtuoso server, not your client. For a remote Virtuoso, stage files on the server first.
  • Idempotency: ld_dir does not double-load identical files; rdf_loader_run() may be re-run safely. --clear makes full re-runs replace the graph.
  • Troubleshooting: load failures, permission issues, DAV paths, and named-graph management — see the virtuoso-rdf-loader skill (ld_dir + rdf_loader_run deep-dive).
  • This skill is the generator generalization of the agent-rdf-memory loader (agent-rdf-memory/scripts/generate-loader-sql.py); that store's refresh-loader.sh is the same pattern in action.

Safe Virtuoso ISQL Error Output

Whenever this workflow invokes OpenLink's native Virtuoso isql client, pass the bare client option COMMAND_TEXT_ON_ERROR=OFF, for example isql {host}:{port} {user} {password} COMMAND_TEXT_ON_ERROR=OFF {script.sql}. Place it before SQL input, script arguments, or -i. OFF maps to the client's internal value 0 and prevents the client from appending the full failed command to error output. The client accepts OFF/ON; literal 0 is rejected. Do not use -u for this setting (-u populates the U argument array). This does not redact secrets from server diagnostics, shell history, or process arguments, so keep credentials out of SQL text and logs. Do not apply this Virtuoso-specific option to unixODBC/iODBC isql clients.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.