Skip to content

Add SPARQL skills: write-ltlod-sparql (mechanics) + investigate-ltlod (recipes) - #87

Merged
namedgraph merged 1 commit into
masterfrom
feat/sparql-skills
Oct 26, 2026
Merged

namedgraph merged 1 commit into
masterfrom
feat/sparql-skills

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Two agent skills that package how to query the LTLOD dataset, which the existing docs don't: CLAUDE.md is ETL/dev-facing, EXAMPLES.md is a query catalogue, URI-SCHEME.md is the URI map — but nothing teaches an agent to go from a question to a correct, performant query.

write-ltlod-sparql — mechanics (how to write/run a correct, fast query)

Independent of what you're asking:

  • the named-graph-per-document data shape (one GRAPH ?g block per document; cross-document joins across blocks)
  • how to run it: the live https://linkeddata.lt/sparql endpoint (throttled — 2r/s burst 10, 429 beyond; a few interactive queries only) vs. a local TDB2 store — queries/run.sh, and building a persistent store once with riot --base | tdb2.tdbloader + tdb2.tdbquery for repeated/bulk work (never in-memory arq over the TriG for GRAPH queries)
  • the query-shape rules that decide empty-vs-right and fast-vs-hung: no FROM <urn:x-arq:UnionGraph>, no alt-path with unbound subject in a GRAPH block, no per-row FILTER NOT EXISTS over the store, read values via triples (skos:notation/dct:identifier) not by string-parsing IRIs, always --base, plus a "query returns empty" checklist
  • Triggers on writing/debugging/optimizing any LTLOD SPARQL, including authoring app/*.ttl views and queries/*.rq.

investigate-ltlod — recipes (what to join to answer a question)

  • the join-key map: JAR code / asmens_id / AR codes / calendar connect the registers as the same IRI, so joins need no lookup
  • where each domain lives, and recipes (follow a company's public money; a politician's declared interests vs. contracts/funds; a supplier below the procurement radar; campaign donors), each pointing at the relevant EXAMPLES.md query
  • the caveats that change a conclusion: ltlod:matchMethod precision (filter name-and-office), suppressed <3 natural-person cells, links that dangle until the full JAR is loaded, and the unmodeled hash-keyed gaps (NMA applicants, finmin repayments/irregularities) + the EU-amount/2021-27 limits
  • Builds on write-ltlod-sparql; references EXAMPLES.md / URI-SCHEME.md rather than copying, so it stays small and doesn't drift.

All recipe-referenced example queries exist on master (Tier-1 series #81–#86). No code changes — docs/skills only.

🤖 Generated with Claude Code

… (recipes)

Two agent skills that package how to query the LTLOD datasets, which CLAUDE.md
(ETL/dev) and EXAMPLES.md (worked queries) don't:

- write-ltlod-sparql — query mechanics, independent of the question: the named-graph-
  per-document data shape, how to run a query (the throttled live /sparql endpoint vs. a
  local TDB2 store built from the TriG — the preferred path for anything bulk), and the
  query-shape rules that decide empty-vs-right and fast-vs-hung (one GRAPH block per
  document, no union graph, no alt-path with unbound subject in a block, no per-row
  FILTER NOT EXISTS over the store, read values via triples not IRI string-parsing,
  --base always). Triggers on writing/debugging/optimizing any LTLOD SPARQL, incl.
  authoring app views and example queries.

- investigate-ltlod — turns an investigative question into the right query: the join-key
  map (JAR code / asmens_id / AR codes / calendar connect the registers as the same IRI),
  where each domain lives, recipes (follow a company's public money; a politician's
  interests vs. contracts/funds; a supplier below the procurement radar; campaign donors),
  and the caveats that change a conclusion (matchMethod precision, suppressed <3 cells,
  links that dangle until the full JAR loads, the unmodeled hash-keyed gaps). Builds on and
  points to write-ltlod-sparql; references EXAMPLES.md / URI-SCHEME.md rather than copying.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@namedgraph
namedgraph merged commit fba7f80 into master Oct 26, 2026
@namedgraph
namedgraph deleted the feat/sparql-skills branch October 26, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant