Skip to content

Complete the JSON-LD 1.1 API (toRdf, fromRdf, etc) - #17

Merged
xavierlacot merged 10 commits into
mainfrom
feat/to-rdf-from-rdf
Nov 22, 2026
Merged

xavierlacot merged 10 commits into
mainfrom
feat/to-rdf-from-rdf

Conversation

@xavierlacot

@xavierlacot xavierlacot commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

This PR adds the toRdf and fromRdf algorithms (with N-Quads parsing and serialization) and lets any algorithm take its document as a URL, HTML pages included. The seven official W3C JSON-LD 1.1 test suites now pass and are part of the EARL report.

DocumentLoaderInterface::load() now takes a LoadDocumentOptions and returns a RemoteDocument.

Also in this branch:

  • Relative IRIs are resolved as RFC 3986 section 5.2 says, through league/uri-interfaces.
  • Microdata and RDFa are now read with the HTML5 parser of PHP 8.4.
  • there are multiple fixes in expansion, flattening and framing (@graph kept as a graph object in arrays, plain and language-tagged strings no longer merged, error names have been aligned with the specification), and HTTP Link headers with unquoted parameters are now read.
  • Code coverage is measured correctly (83% to 93% of lines), with new tests for the audit options and the fallback parser.

Checklist

  • Tests pass (castor qa:phpunit:run)
  • Coding standards applied (castor qa:cs)
  • Static analysis passes (castor qa:phpstan)
  • Tests added or updated for the change
  • Documentation updated if needed

@xavierlacot
xavierlacot merged commit ff6ee4d into main Nov 22, 2026
7 checks passed
@xavierlacot
xavierlacot deleted the feat/to-rdf-from-rdf branch November 22, 2026 17:39
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