Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add signal support, remove legacy code, fix blanknodes. #77

Merged
merged 27 commits into from
Sep 19, 2023

Conversation

davidlehn
Copy link
Member

  • Add AbortSignal signal option for complexity control via timeouts, manual abort, or other condition.
  • Add similar timeout to private sync version.
  • Remove legacy dataset support.
  • Update test runner.
  • Remove use of _: prefix in BlankNodes to improve compatibility with RDF/JS tooling. (Need to test what other tooling issues this may cause, for instance in jsonld.js.)

A 1000ms default timeout is set here. I'm not sure if that's the best approach or have no abort signal here and let other libraries and apps add a default that fits their use case.

Breaking change to remove the deprecated legacy dataset format.
- Async: Add `signal` option for an `AbortSignal`.
- Sync: Add `timeout` option for common timeout use case.
- Add docs.
- Reordering and renumbering, no functional change.
- Flatten hot-path function argument.
- Match async/sync code formatting for easier comparison.
- Support `rdfc:RDFC10NegativeEvalTest`.
- Support `rdfc:RDFC10MapTest`.
- Cleanups.
**BREAKING**: Change dataset handling of `BlankNodes` to match the
[RDF/JS: Data model specification](https://rdf.js.org/data-model-spec/).
The `_:` prefix is no longer used in the `BlankNode` `value` field. This
should improve compatibility with other RDF/JS tooling but may cause
compatibility issues with existing code. The previous behavior is
historical and may predate the RDF/JS spec.
- Add large graph creation utilities.
- Add timeout test.
- Add maxDeepIteration test.
- Add developer playground for large graph tests.
- Add `messageDigestAlgorithm` option to API.
- Add support for SHA-256, SHA-384, and SHA-512 name variations to
  `MessageDigests`.
- Updates tests to handle `hashAlgorithm` option if present.
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Merging #77 (7882db1) into main-with-3.4.0 (7ea0b02) will increase coverage by 4.89%.
The diff coverage is 94.84%.

@@                 Coverage Diff                 @@
##           main-with-3.4.0      #77      +/-   ##
===================================================
+ Coverage            90.08%   94.97%   +4.89%     
===================================================
  Files                   10       10              
  Lines                  625      637      +12     
===================================================
+ Hits                   563      605      +42     
+ Misses                  62       32      -30     
Files Changed Coverage Δ
lib/RDFC10Sync.js 97.63% <88.88%> (ø)
lib/index.js 63.79% <93.75%> (+5.30%) ⬆️
lib/MessageDigest-webcrypto.js 84.61% <100.00%> (+1.28%) ⬆️
lib/MessageDigest.js 100.00% <100.00%> (ø)
lib/NQuads.js 98.19% <100.00%> (+15.99%) ⬆️
lib/RDFC10.js 98.85% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ea0b02...7882db1. Read the comment docs.

davidlehn and others added 15 commits September 19, 2023 16:33
**BREAKING**: Check output `format` parameter. Must be omitted, falsey,
or "application/n-quads".
- Remove advanced "useNative" example.
- Add common N-Quads input example.
- Add `maxWorkFactor` to calculate `maxDeepIterations` based on
  non-unique blank nodes. Default to `1`.
- If `maxDeepIterations` is >= 0 then use it explicitly.
- Remove default timeout signal.
- Add docs.
- Add tests.
- Update async and sync versions.
- Update tests to handle `computationalComplexity` test paramter and map
  it to `maxWorkFactor` adjustments.
- Improve negative test handling.
Add support for generalized RDF `BlankNode` predicate during N-Quads
serialization.
Co-authored-by: Dave Longley <dlongley@digitalbazaar.com>
- Fix maxWorkFactor === 0 use case.
- Improve error if N-Quads input not a string.
- Fix calls without options.
- Test error messages to ensure correct errors are thrown.
- Remove default options not needed for testing.
- Add various tests for complexity controls, edge cases, and coverage.
- Add simple duplicate quads test.
- Rename `URDNA2015.js` to `RDFC10.js`.
- Rename 'URDNA2015` class to `RDFC10`.
- Rename `URDNA2015Sync.js` to `RDFC10Sync.js`.
- Rename 'URDNA2015Sync` class to `RDFC10Sync`.
@davidlehn davidlehn merged commit dff263d into main-with-3.4.0 Sep 19, 2023
7 checks passed
@davidlehn davidlehn deleted the add-signal-support branch September 19, 2023 20:36
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.

None yet

2 participants