Virtuoso Rdf Loader 标志

Virtuoso Rdf Loader

组织
OpenLinkSoftware
virtuoso-rdf-loader

Bulk-load RDF archives (N-Triples, Turtle, RDF/XML, N-Quads, TriG, JSON-LD, Notation3 — gzip-compressed or raw) into a Virtuoso instance via isql, using ld_dir + rdf_loader_run. Covers single-file loads, directory-wide ingestion, load monitoring, named-graph management (clear/replace/append), and troubleshooting. Triggers on phrases like "load this RDF into Virtuoso", "bulk load into Virtuoso", "ingest .nt.gz into Virtuoso", or any request to push RDF data to a Virtuoso SPARQL endpoint via isql.

概览

发布者OpenLinkSoftware
代码仓库ai-agent-skills
技能名称virtuoso-rdf-loader
星标数
42
复刻数
10
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 OpenLinkSoftware 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Virtuoso Rdf Loader AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/virtuoso-rdf-loader
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OpenLinkSoftware/ai-agent-skills.git /tmp/ai-agent-skills
mkdir -p .claude/skills
cp -r /tmp/ai-agent-skills/virtuoso-rdf-loader .claude/skills/virtuoso-rdf-loader
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Virtuoso Rdf Loader,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Virtuoso Rdf Loader。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Virtuoso Rdf Loader 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Virtuoso RDF Bulk Loader Skill

ld_dir + rdf_loader_run · isql · N-Triples · Turtle · RDF/XML · N-Quads · TriG · JSON-LD · Notation3 · gzip

Purpose

Load RDF archives directly into a Virtuoso quad store — no pre-extraction needed. Virtuoso's ld_dir + rdf_loader_run reads compressed files (.gz, .bz2) natively and supports every major RDF serialization. The skill provides:

  • Single-file loads — one archive → one named graph
  • Directory loads — every matching file in a server-side directory
  • Graph management — clear before load, append, or replace
  • Progress monitoring — poll DB.DBA.LOAD_LIST until completion
  • Error triage — interpret load errors and suggest fixes

Supported Formats

FormatExtensionsNotes
N-Triples.nt, .nt.gz, .nt.bz2Line-based; fastest for bulk
Turtle.ttl, .ttl.gz, .ttl.bz2Compact; common for LOD
RDF/XML.rdf, .rdf.gz, .rdf.bz2Legacy; still widespread
N-Quads.nq, .nq.gz, .nq.bz2Quad format; includes graph IRIs
TriG.trig, .trig.gzMulti-graph Turtle superset
JSON-LD.jsonld, .jsonld.gzJSON-based; web-friendly
Notation3.n3, .n3.gzSuperset of Turtle
OWL.owl, .owl.gzRDF/XML variant

All formats are handled by the same ld_dir + rdf_loader_run pipeline — no format-specific flags needed.


Execution Routing

Default order for data ingestion:

  1. isql CLI — direct isql host:port execution (preferred; always available)
  2. MCP — if a virtuoso-support-agent MCP server is connected, it can relay SQL
  3. SPARQL INSERT — via SPARQL endpoint when isql path is unavailable (wraps individual INSERTs; unsuitable for bulk)
  4. URIBurner upload — when the data is at a URL and URIBurner's sponger is available

If the user names a specific mode, honor that preference.


Step 0 — Connection Detection (Always Run First)

bash
# Check isql availability
which isql

# Quick connectivity test
echo "SELECT 'ok';" | isql <host>:<port> <user> <pass> 2>&1 | head -3

If isql is not found, ask the user for:

  • isql path, OR
  • Virtuoso host:port credentials to try MCP, OR
  • SPARQL endpoint URL for fallback loading

Step 1 — Gather Parameters

Before any load, collect:

ParameterRequiredDefaultNotes
--hostYes—Virtuoso SQL listener hostname
--portNo1111Virtuoso SQL listener port
--userNodbaisql user
--passNodbaisql password
--graphYes—Target named-graph IRI
--dirYes—Server-side directory containing RDF files
--patternNo*.*File pattern for ld_dir (match the format you're loading)
--modeNoappendappend, clear, or replace

--dir must be accessible to the Virtuoso server process — ld_dir registers server-side paths, not client-side paths. For remote Virtuoso, the files must already be on the server.

Recommended Patterns by Format

Loading…Use --pattern
N-Triples*.nt.gz
Turtle*.ttl.gz
RDF/XML*.rdf.gz
N-Quads*.nq.gz
TriG*.trig.gz
JSON-LD*.jsonld.gz
Notation3*.n3.gz
All formats in directory*

Mode Behavior

ModeSQL executed before loadResult
append(none)Triples added to existing graph
clearSPARQL CLEAR GRAPH <iri>Graph emptied, then loaded
replaceSPARQL CLEAR GRAPH <iri> then loadSame as clear + load

Step 2 — Register and Load

The core workflow (two SQL calls):

sql
-- Register files (any supported format)
ld_dir ('/data/rdf/incoming/', '*.nt.gz', 'https://example.com/my-graph');

-- Start the loader (runs asynchronously in the server)
rdf_loader_run ();

Execute via isql:

bash
isql ${HOST}:${PORT} ${USER} ${PASS} <<EOF
ld_dir ('${LOAD_DIR}', '${PATTERN}', '${GRAPH}');
rdf_loader_run ();
CHECKPOINT;
EOF

ld_dir Parameters (Full Signature)

sql
ld_dir (
  in dir         varchar,   -- server-side directory path
  in file_pattern varchar,  -- e.g. '*.nt.gz', '*.ttl.gz', '*.nq.gz', '*'
  in graph_iri   varchar    -- target named graph
);

Key points:

  • ld_dir is idempotent — calling it twice with the same files does not double-load
  • Files are matched by name in DB.DBA.LOAD_LIST — renaming a file after registration re-triggers it
  • rdf_loader_run() can be called multiple times safely; it processes pending entries only
  • The loader auto-detects the RDF format from file content — no format flag required
  • The loader runs on server threads — isql returns immediately

Step 3 — Monitor Progress

Poll DB.DBA.LOAD_LIST until no rows remain in progress:

sql
SELECT
  ll_file,
  ll_graph,
  CASE ll_state
    WHEN 0 THEN 'PENDING'
    WHEN 1 THEN 'LOADING'
    WHEN 2 THEN 'DONE'
    WHEN 3 THEN 'FAILED'
  END AS state,
  ll_started,
  ll_done,
  ll_rows,
  ll_error
FROM DB.DBA.LOAD_LIST;

ll_state Meanings

ll_stateStatusAction
0PendingWaiting — loader will pick it up
1LoadingIn progress — wait
2DoneSuccess — committed
3FailedSee ll_error column

Monitor loop:

bash
while true; do
  STATUS=$(isql ${HOST}:${PORT} ${USER} ${PASS} <<'EOSQL' 2>/dev/null)
    SELECT ll_file, ll_state, ll_error
    FROM DB.DBA.LOAD_LIST
    WHERE ll_state IN (0, 1, 3);
EOSQL
  if echo "$STATUS" | grep -q 'No\. of rows\|0 rows'; then
    echo "All loads complete."
    break
  fi
  echo "$STATUS"
  sleep 5
done

Step 4 — Verify

After loading, check the row count in the target graph:

sql
SPARQL
SELECT (COUNT(*) AS ?triples)
FROM <${GRAPH}>
WHERE { ?s ?p ?o };

Or via isql:

bash
isql ${HOST}:${PORT} ${USER} ${PASS} <<EOF
SPARQL SELECT (COUNT(*) AS ?triples) FROM <${GRAPH}> WHERE { ?s ?p ?o };
EOF

For a spot check, sample 10 triples from the graph:

sql
SPARQL SELECT * FROM <${GRAPH}> WHERE { ?s ?p ?o } LIMIT 10;

Bundled Shell Script

scripts/bulk-load-rdf.sh automates Steps 2–3 for single-file or directory loads. Invoke it from the skill directory:

bash
./scripts/bulk-load-rdf.sh \
    --host     localhost \
    --port     1111 \
    --user     dba \
    --pass     dba \
    --graph    https://example.com/my-graph \
    --dir      /data/rdf/incoming \
    --pattern  "*.nt.gz" \
    dataset.nt.gz
FlagPurpose
--host / --portVirtuoso SQL listener
--user / --passisql credentials
--graphTarget named-graph IRI
--dirServer-side staging directory
--patternFile pattern for ld_dir
--no-copySkip cp — files already in --dir

Troubleshooting

SymptomLikely causeFix
No file(s) found in LOAD_LISTld_dir path not server-accessibleVerify --dir exists on the server; check permissions
ll_state = 3 (FAILED)Malformed data or encoding issueCheck ll_error; validate the RDF file; try one file interactively via DB.DBA.TTLP()
Load stuck at PENDINGLoader not running or blockedCall rdf_loader_run() again; check server error log
Duplicate triplesSame files loaded twiceClear graph, delete from LOAD_LIST, then re-register and re-load
Permission denied on --dirVirtuoso server user can't read directorychmod 755 the directory and chmod 644 the files
.gz files not recognisedPattern doesn't match files on diskUse the correct pattern for the file extension
Wrong graph IRI in N-Quads/TriGFile contains its own graph IRIsN-Quads/TriG files specify graphs inline — ld_dir's graph becomes a default for triples not in a named graph
Out of disk / transaction log fullBulk load exceeds temp spaceIncrease TempSpace / TransactionLog in virtuoso.ini; load in smaller batches

Loading Without ld_dir (Single-File Interactive)

For one-offs where ld_dir isn't practical, pipe a decompressed file directly to isql. DB.DBA.TTLP() auto-detects the format:

bash
gunzip -c data.nt.gz | isql ${HOST}:${PORT} ${USER} ${PASS} <<'EOF'
DB.DBA.TTLP (
  file_to_string_output ('/dev/stdin'),
  '',
  'https://example.com/my-graph',
  0
);
EOF

Prefer ld_dir + rdf_loader_run for everything except single small files — it's parallel, transactional, restartable, and format-agnostic.


Quick Reference

TaskSQL / Command
Register filesld_dir('/path/', '*.nt.gz', 'graph-iri');
Start loaderrdf_loader_run();
Check progressSELECT * FROM DB.DBA.LOAD_LIST WHERE ll_state < 2;
Clear graphSPARQL CLEAR GRAPH <iri>;
Count triplesSPARQL SELECT (COUNT(*) AS ?c) FROM <iri> WHERE {?s ?p ?o};
Remove registrationDELETE FROM DB.DBA.LOAD_LIST WHERE ll_file LIKE '%pattern%';
Force re-loadDelete from LOAD_LIST + ld_dir again + rdf_loader_run
Set parallel loadersrdf_loader_run(max_files => 8);
Check server logtail -f virtuo<port>.log on server

Initialization Sequence

When invoked:

⛔ PRE-BUILD CHECK: Before producing output, re-read the relevant workflow section above and re-read any checklists or verification gates defined in this skill. Confirm each checklist item before writing output. Apply the CLAUDE.md Anti-Drift Protocol: re-read spec section before build, gate-first validation, section-by-section delivery.

  1. Run Step 0 — verify isql is available and Virtuoso is reachable
  2. Ask for: host, port, credentials, graph IRI, server-side directory, file pattern
  3. Determine the RDF format from file extensions — confirm with user
  4. Confirm mode (append / clear / replace)
  5. If mode is clear or replace: warn user, then execute SPARQL CLEAR GRAPH
  6. Run ld_dir to register files with the correct pattern
  7. Run rdf_loader_run to start loading
  8. Poll DB.DBA.LOAD_LIST until all files report ll_state = 2 (done)
  9. Run verification count query — report triples loaded per file
  10. If any files report ll_state = 3 (failed), surface ll_error and troubleshoot

Reference Files

FileContents
references/ldir-parameters.mdFull ld_dir parameter reference, all supported formats and patterns, rdf_loader_run options, LOAD_LIST schema, graph management
scripts/bulk-load-rdf.shShell script automating register → load → monitor

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.

Version

2.0.0 — Format-agnostic. Supports N-Triples, Turtle, RDF/XML, N-Quads, TriG, JSON-LD, Notation3, OWL — gzip-compressed or raw. Same ld_dir + rdf_loader_run pipeline for all.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Virtuoso Rdf Loader AI 技能有什么作用?

Bulk-load RDF archives (N-Triples, Turtle, RDF/XML, N-Quads, TriG, JSON-LD, Notation3 — gzip-compressed or raw) into a Virtuoso instance via isql, using ld_dir + rdf_loader_run. Covers single-file loads, directory-wide ingestion, load monitoring, named-graph management (clear/replace/append), and troubleshooting. Triggers on phrases like "load this RDF into Virtuoso", "bulk load into Virtuoso", "ingest .nt.gz into Virtuoso", or any request to push RDF data to a Virtuoso SPARQL endpoint via isql.

为什么在 TypingMind 中使用 Virtuoso Rdf Loader?

因为您只需安装一次,就能搭配任何模型使用。Virtuoso Rdf Loader 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Virtuoso Rdf Loader?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/OpenLinkSoftware/ai-agent-skills/tree/main/virtuoso-rdf-loader。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Virtuoso Rdf Loader?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Virtuoso Rdf Loader 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Virtuoso Rdf Loader 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Virtuoso Rdf Loader AI 技能免费吗?

是的。OpenLinkSoftware 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇