Skip to content

Client side property/object metadata#298

Merged
namedgraph merged 2 commits into
developfrom
rf-client-side-property-object-metadata
May 12, 2026
Merged

Client side property/object metadata#298
namedgraph merged 2 commits into
developfrom
rf-client-side-property-object-metadata

Conversation

@namedgraph
Copy link
Copy Markdown
Member

No description provided.

namedgraph and others added 2 commits May 12, 2026 23:08
…keys

Adds ldh:load-property-metadata/ldh:set-property-metadata to the promise chain after object metadata, fetching vocabulary labels via DESCRIBE against /ns. Threads property-metadata and object-metadata tunnel params through bs2:DocumentBody and bs2:PropertyList so sort keys resolve vocabulary labels client-side. Also adds ac:object-label 2-arg overload and preloads common namespace ontologies into the document cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@namedgraph namedgraph merged commit d216841 into develop May 12, 2026
1 check passed
namedgraph added a commit that referenced this pull request May 12, 2026
The pre-cached vocabulary documentPool keys entries under
resolve-uri(ac:document-uri(<ns>), \$ac:contextUri) — ac:document-uri strips the
trailing fragment so hash namespaces like &http; are stored under
http://www.w3.org/2011/http (no #). The ac:property-label mode C branch was
looking up documents via doc-available(namespace-uri()) / document(namespace-uri()),
which still includes the # for hash vocabs, so the lookup missed and labels for
http:*, rdf:*, rdfs:*, spin:* etc. fell through to the local-name() fallback.
Slash-namespace vocabs (dct:, etc.) happened to work because there's no fragment
to strip on either side. Server-side Saxon was unaffected because Java's URI
resolver fetches over HTTP and the wire layer drops the fragment naturally.

Wrap the lookup in ac:document-uri(namespace-uri()) so it matches the cache key.
Also drops the temporary xsl:message debug lines added in #298.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
namedgraph added a commit that referenced this pull request May 14, 2026
The doc-available()/document(namespace-uri()) branch in ac:property-label
(default.xsl) was unguarded after #298, so on Saxon-JS it fell back to a
synchronous XMLHttpRequest for every property whose namespace wasn't already
in the documentPool. With ?mode= on the source RDF's base URI, document('')
resolved to the page URL and Firefox served the cached HTML representation
to that sync XHR, producing the cascade of "XML Parsing Error: Expected:
</meta>" failures after ldh:set-property-metadata.

ac:property-label is invoked from xsl:sort and can't be made async, so the
fix uses Saxon-JS's own ixsl:doc-fetched() — a synchronous probe of the
internal documentPool (SaxonJS3.rt.js: I.fixed.Ta[$uri]) that triggers no
fetch. Saxon's doc-available() probe is restored with its pre-#298
use-when="...SAXON" guard so server-side behaviour is unchanged.

ac:object-label gets the symmetric addition: the LDH override at
default.xsl:87 had inherited the SPARQL-based $object-metadata branch but
dropped Web-Client's doc-fetch branch entirely, so object URIs whose label
lived in a cached vocab (e.g. skos:Concept, ldh:View) never resolved
client-side. Both processors now have parallel chains: local source RDF →
async-loaded metadata → documentPool/live-fetch → URI heuristics.

rdf.xsl bs2:TypeControl gets the same gating: ac:label(key(..., ...)) stays
unconditional, only the document() source inside key() is wrapped in
if (ixsl:doc-fetched(...)) then ... else () on Saxon-JS to avoid the sync
XHR. xmlns:ixsl declaration added to rdf.xsl since it didn't have one.

Debug xsl:message lines included in all three SaxonJS branches to verify
which lookups take the documentPool path; safe to strip in a follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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