Skip to content

Client-orchestrated graph writes; inference-free ontology serving - #343

Merged
namedgraph merged 4 commits into
developfrom
ft-client-graph-writes
Aug 9, 2026
Merged

Client-orchestrated graph writes; inference-free ontology serving#343
namedgraph merged 4 commits into
developfrom
ft-client-graph-writes

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Summary

Moves the Add data and Generate containers orchestration to the client over the uniform Graph Store Protocol, and reworks application-ontology serving to be inference-free. Together this removes the server-side fetch/SSRF surface (pen-test LNK-002) and stops inferred rdf:type rdfs:Resource from leaking into proxied namespace documents.

Changes

Client-orchestrated writes (BREAKING — replaces /add and /generate)

  • Add data: the submit handler splits on the presence of a spin:query input. The add/clone variant fetches dct:source through the same-origin ?uri= proxy as RDF/XML (CORS + Jena format conversion) and POST-appends it to the sd:name target. The import-ontology variant is unchanged and still RDF/POSTs to /transform.
  • Generate containers: builds one container document per checked class and PUTs them via parallel ixsl:all fan-out, seeded by ixsl:resolve so requests run in an active promise context. The view block is now correctly wrapped as ldh:Objectrdf:valueldh:View (the endpoint's bare ldh:View bypassed ldh:InvalidContentBlockType validation).
  • Deletes Add.java, Generate.java and their Dispatcher locators. /transform is retained until a client-side SPARQL engine lands.

Dialog fixes

  • Add data: seed the target-graph typeahead from the local browser location (ac:absolute-path(ldh:request-uri())) instead of ldh:base-uri(.), which resolved to the proxied remote when viewing one and defaulted the write target to that remote (403). Cross-origin targets now render an inline error instead of proxying the write.
  • Generate containers: initialise the parent typeahead with the current container, disable Generate until the schema loads, and make schema loading fully async (replacing a blocking document() fetch with an ixsl:resolve promise chain).

Inference-free ontology serving

  • Application ontologies are resolved as a native ontapi owl:imports union graph (cached per ontology URI on Application) instead of a manually flattened, RDFS-materialized model. Every consumer traverses hierarchies explicitly via (rdfs:subClassOf)*.
  • The shared repository now only holds raw per-document graphs, which ProxyRequestFilter serves directly — asserted triples only, identical to a direct document GET. This fixes inferred rdf:type rdfs:Resource leaking into proxied namespace documents (multi-token @typeof that silently degraded View blocks).
  • Namespace no-query GET serves the raw ontology graph from the shared repository instead of rebuilding a repository per request.
  • View term labels (order-by, facet headers, parallax, rdf:type facet values) now resolve via the app's /ns SPARQL endpoint instead of proxying each term's vocabulary document (Resolve view term labels from /ns instead of the Linked Data proxy #340).

Tests

  • Drops the obsolete /add and /generate HTTP tests; adds add/GET-proxied-source-POST-append.sh, add/PUT-generate-container.sh, proxy/GET-proxied-mapped-vocab.sh, and sparql-protocol/query/GET-ns-no-query.sh.
  • Adds OntologyClosureCIReproTest and extends OntologyImportsCharacterizationTest.

See CHANGELOG.md for the user-facing summary.

🤖 Generated with Claude Code

namedgraph and others added 3 commits August 9, 2026 12:54
…rites

Move the "Add data" and "Generate containers" orchestration to the client
over the uniform Graph Store Protocol interface, removing the server-side
fetch/SSRF surface (pen-test LNK-002) and collapsing two special-purpose
endpoints into standard per-document writes.

- Add data: the submit handler splits by the presence of a spin:query input.
  The add/clone variant fetches dct:source through the same-origin ?uri=
  proxy as RDF/XML (CORS + Jena format conversion) and POST-appends it to the
  sd:name target (ldh:add-data-source-response / ldh:add-data-form-error). The
  import-ontology variant is unchanged and still RDF/POSTs to /transform.
- Generate containers: builds one container document per checked class and
  PUTs them via parallel ixsl:all fan-out (ldh:generate-containers-fanout ->
  ldh:generate-containers-join), seeded by ixsl:resolve so the requests run in
  an active promise context. The view block is now correctly wrapped as
  ldh:Object -> rdf:value -> ldh:View (the endpoint's bare ldh:View bypassed
  ldh:InvalidContentBlockType validation).
- Delete Add.java, Generate.java and their Dispatcher locators. /transform is
  retained until a client-side SPARQL engine lands.
- http-tests: drop the obsolete /add and /generate tests (the system/ suite is
  unregistered); add add/GET-proxied-source-POST-append.sh and
  add/PUT-generate-container.sh. CHANGELOG updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… schema load

- Initialise the parent typeahead with the current container (ldh:LoadTypeaheads
  from ldh:base-uri, matching btn-save-as), which was lost when the form stopped
  carrying a source param.
- Disable the Generate button until the schema is loaded; enable it in
  ldh:endpoint-classes-response once the class list is populated.
- Make Load schema fully async: the service-endpoint resolution used a blocking
  document() fetch (the "TO-DO: asynchronous request"). Replaced with an
  ixsl:resolve -> ldh:load-schema-endpoint -> ldh:load-schema-results promise
  chain, so the request no longer blocks and the progress cursor shows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…te targets

The "Add RDF data" dialog seeded its target graph typeahead from
ldh:base-uri(.), which resolves to the proxied remote resource when viewing
one (ac:document-uri(ac:uri())). So adding data while viewing a proxied
document defaulted the write target to that remote and proxied the append to
it (403). The source is still ldh:base-uri (the remote being imported).

- btn-save-as now seeds the graph typeahead from ac:absolute-path(ldh:request-uri())
  (the local browser location), which is always a local dataspace document.
- Guard the append: a cross-origin target renders an inline error instead of
  proxying the write. ldh:add-data-form-error now tolerates a missing response
  so pre-fetch validation can reuse it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@namedgraph
namedgraph changed the base branch from master to develop August 9, 2026 17:51
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@namedgraph
namedgraph merged commit 9da6ff0 into develop Aug 9, 2026
1 check passed
@namedgraph
namedgraph deleted the ft-client-graph-writes branch August 9, 2026 19:12
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