Skip to content

Preparing a fallback for ml/json-ld dependency#65

Merged
k00ni merged 12 commits intomasterfrom
fallback/json-ld-php8
Jan 7, 2026
Merged

Preparing a fallback for ml/json-ld dependency#65
k00ni merged 12 commits intomasterfrom
fallback/json-ld-php8

Conversation

@k00ni
Copy link
Copy Markdown
Member

@k00ni k00ni commented Sep 5, 2025

In case lanthaler/JsonLD#113 is getting stale we can switch to https://github.com/sweetrdf/json-ld fork to get rid of these deprecations/warnings in the test suite, for instance:

2) D:\a\easyrdf\easyrdf\vendor\ml\json-ld\Processor.php:2235
ML\JsonLD\Processor::listToRdf(): Implicitly marking parameter $graph as nullable is deprecated, 
the explicit nullable type must be used instead

Triggered by:

* Tests\EasyRdf\GraphTest::testIssue47GraphLoadRdfFile
  D:\a\easyrdf\easyrdf\tests\EasyRdf\GraphTest.php:401

https://github.com/sweetrdf/easyrdf/actions/runs/16901087466/job/48798402444#step:5:811

@k00ni k00ni self-assigned this Sep 5, 2025
@k00ni k00ni added the tests label Sep 5, 2025
in the Github action it complains:

1) Tests\ExampleTest\FoafinfoTest::testNjh
Exception: Failed to run script (255): PHP Warning:  fsockopen(): Unable
to connect to ssl://www.aelius.com:443 (Connection timed out) in
/home/runner/work/easyrdf/easyrdf/lib/Http/Client.php on line 435
PHP Fatal error:  Uncaught EasyRdf\Exception: Unable to connect to
ssl://www.aelius.com:443 (Connection timed out) in
/home/runner/work/easyrdf/easyrdf/lib/Http/Client.php:437
Stack trace:
EasyRdf\Http\Client->request()
EasyRdf\Graph->load()
EasyRdf\Graph::newAndLoad()
require('...')
thrown in /home/runner/work/easyrdf/easyrdf/lib/Http/Client.php on
line 437
<html>
<head><title>EasyRdf FOAF Info Example</title></head>
<body>
<h1>EasyRdf FOAF Info Example</h1>

<form method="get"
action="/home/runner/work/easyrdf/easyrdf/test/cli_example_wrapper.php"><input
type="text" name="uri" id="uri"
value="https://www.aelius.com/njh/foaf.rdf" size="50" /><input
type="submit" value="Submit" /></form>

/home/runner/work/easyrdf/easyrdf/test/TestHelper.php:134
/home/runner/work/easyrdf/easyrdf/tests/ExampleTest/FoafinfoTest.php:57
@k00ni k00ni changed the title Preparing a fallback for ml/json-ld dependency Preparing a fallback for ml/json-ld dependency + fixed failing tests (only examples) Sep 5, 2025
@k00ni k00ni marked this pull request as ready for review September 5, 2025 08:27
@k00ni
Copy link
Copy Markdown
Member Author

k00ni commented Oct 3, 2025

I fixed failing tests and PHP 8.5 deprecations separately (#66). This PR will remain as a fallback option as long as Json-LD library is still not PHP 8 ready.

@k00ni k00ni changed the title Preparing a fallback for ml/json-ld dependency + fixed failing tests (only examples) Preparing a fallback for ml/json-ld dependency Oct 3, 2025
@k00ni
Copy link
Copy Markdown
Member Author

k00ni commented Jan 7, 2026

Unfortunately sweetrdf/json-ld requires at least 8.1, but EasyRdf supports 8.0 too. I added 2 scripts which adapt composer,json when PHP 8.0 is found in a Workflow run. This way ml/json-ld is used instead of sweetrdf/json-ld. Because it is only in require-dev we can ignore this fact for our users.

@k00ni k00ni merged commit e1d60a7 into master Jan 7, 2026
11 of 26 checks passed
@k00ni k00ni deleted the fallback/json-ld-php8 branch January 7, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant