Skip to content

Build on Sophia JSON-LD

Excluded alternative universe

This is the excluded alternative universe from the parent ADR.

This planning path uses Sophia JSON-LD as the semantic foundation for a new language server, rather than as an LSP implementation. “Universe” is planning shorthand for the consequences of committing to this foundation.

Sophia JSON-LD pchampin/sophia_rs is the sophia_jsonld parser-and-serializer package in Sophia pchampin/sophia_rs; its manifest Cargo.toml depends on json-ld 0.15.1 and offers optional file: and HTTP(S) context retrieval.

Implementation checklist

  • Create the Rust LSP transport, lifecycle, document model, workspace store, and request routing that Sophia does not provide.
  • Parse JSON-LD, YAML-LD, and Markdown-LD into one document model while retaining a source map from JSON-LD value paths to JSON, YAML, or embedded-front-matter spans.
  • Design and implement a mapped-input adapter from each document model to Sophia JSON-LD parsing and serialization APIs pchampin/sophia_rs, retaining enough semantic provenance to return LSP ranges.
  • Configure a context and document-loader policy around Sophia’s optional file and HTTP context features Cargo.toml, including local-document access, permitted remote access, and relative-IRI base resolution.
  • Interpret JSON-LD type coercion to @id so IRI-valued strings are distinguished from literals and surfaced as clickable LSP document links.
  • Build an IRI definition index and serve every matching workspace target through the LSP definition response.
  • Make semantic conversion, source maps, document links, and the definition index update from authoritative unsaved text on open and full-document change notifications.
  • Translate parser, context, and semantic errors back through the source map to exact JSON, YAML, or Markdown diagnostic ranges.
  • Add JSON-LD conformance fixtures and LSP end-to-end tests for diagnostics, @type: @id links, relative cross-file resolution, Markdown offsets, unsaved buffers, and multiple definition targets.
  • Package the Rust binary and provide editor integration, installation, versioning, and release automation.

Universe consequences

  • Own the full LSP implementation and its editor-facing compatibility surface.
  • Maintain adapters and source maps across three authored syntaxes while following Sophia and its json-ld dependency releases.
  • Establish and maintain the server’s context-loading, workspace-indexing, and navigation policies as product behaviour.