From 03f28939761738194dd27fc8a2f642f99e01b602 Mon Sep 17 00:00:00 2001 From: hsolbrig Date: Wed, 26 May 2021 10:14:04 -0500 Subject: [PATCH 1/2] Clarify documentation on runing Earl reports --- CONTRIBUTING.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 87e32c75..8093ecfe 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -44,14 +44,23 @@ Implementation Report Process As of early 2020, the process to generate an EARL report for the official `JSON-LD Processor Conformance`_ page is: +* Check out a local copy of the test suites:: + + > mkdir ../w3c + > cd ../w3c + > git clone https://github.com/w3c/json-ld-api.git + > git clone https://github.com/w3c/json-ld-framing.git + > cd ../pyld + + * Run the tests on the ``json-ld-api`` and ``json-ld-framing`` test repos to generate a ``.jsonld`` test report: - * ``python tests/runtests.py ../json-ld-api/tests/ ../json-ld-framing/tests/ -e pyld-earl.jsonld`` + > ``python tests/runtests.py ..w3c/json-ld-api/tests/ ../w3c/json-ld-framing/tests/ -e pyld-earl.jsonld`` * Use the rdf_ tool to generate a ``.ttl``: - * ``rdf serialize pyld-earl.jsonld --output-format turtle -o pyld-earl.ttl`` + > ``rdf serialize pyld-earl.jsonld --output-format turtle -o pyld-earl.ttl`` * Optionally follow the `report instructions`_ to generate the HTML report for inspection. From 8e9ef40a56831cd6ef0d24dfd63064a6eec024d2 Mon Sep 17 00:00:00 2001 From: hsolbrig Date: Wed, 26 May 2021 10:32:50 -0500 Subject: [PATCH 2/2] Relative IRI's w/ '@' have './' prepended --- lib/pyld/jsonld.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/pyld/jsonld.py b/lib/pyld/jsonld.py index 49d62122..22e0257b 100644 --- a/lib/pyld/jsonld.py +++ b/lib/pyld/jsonld.py @@ -514,6 +514,10 @@ def prepend_base(base, iri): if rval == '': rval = './' + # Relative IRIs must not have the form a of keyword + elif rval[0] == '@': + rval = './' + rval + return rval @@ -559,6 +563,10 @@ def remove_base(base, iri): # prepend remaining segments rval += '/'.join(iri_segments) + # Relative IRIs must not have the form a of keyword + if rval and rval[0] == '@': + rval = './' + rval + return unparse_url((None, None, rval, rel.query, rel.fragment)) or './'