• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RDFLib / rdflib / 10109888947
90%
master: 91%

Build:
Build:
LAST BUILD BRANCH: dependabot/pip/pyparsing-3.3.1
DEFAULT BRANCH: master
Ran 26 Jul 2024 10:37AM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
10109888947

push

github

web-flow
Add JSON-LD extraction from HTML (#2692) (#2804)

See https://w3c.github.io/json-ld-syntax/#embedding-json-ld-in-html-documents
and https://www.w3.org/TR/json-ld11-api/#html-content-algorithms .

Implementation summary:

rdflib.plugins.parsers.jsonld.JsonLDParser.parse
* add docstring
* change parameter list from **kwargs to explicit list
* add optional extract_all_scripts parameter
* get the fragment identifier from source.getSystemId()
* add fragment_id and extract_all_scripts parameters to the call to source_to_json

rdflib.plugins.shared.jsonld.util.source_to_json
* add docstring
* add optional fragment_id and extract_all_scripts parameters
* change the return value to a tuple with the extracted JSON document and value of the HTML base element
* if source.content_type is "text/html" or "application/xhtml+xml" then parse source as HTML and extract the appropriate script element(s) and the HTML base element

Testing

test/jsonld/test_onedotone.py
* enable all existing html tests (except html/f004-in)
* if inputpath ends with ".html" (with optional fragment identifier) then invoke runner.do_test_html

For more information on the failing html/f004-in test, see https://lists.w3.org/Archives/Public/public-json-ld-wg/2024May/0000.html .

test/jsonld/runner.py
* add new do_test_html function

Note that the html test cases from the JSON-LD Test Suite combine testing
for JSON-LD extraction from the HTML with testing for other algorithms (e.g. compact/flatten),
which rdflib does not currently support. In order to test extraction only and ignore
the compact/flatten algorithms, do_test_html performs a graph comparison using
rdflib.compare.isomorphic, without serializing back to JSON .

Co-authored-by: Ashley Sommer <ashleysommer@gmail.com>
Co-authored-by: Nicholas Car <nick@kurrawong.net>
Source Files on build 10109888947
Detailed source file information is not available for this build.
  • Back to Repo
  • 08534670 on github
  • Prev Build on main (#10086359983)
  • Next Build on main (#10135533349)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc