- Use explicit
NoneorFalsefor context checks. Fixes an issue while framing with an empty context.
- Fix deprecation warnings due to invalid escape sequences.
- Fix inverse context cache indexing to use the uuid field.
- Improve EARL output.
- This release adds JSON-LD 1.1 support. Significant thanks goes to Gregg Kellogg!
- BREAKING: It is highly recommended to do proper testing when upgrading from the previous version. The framing API in particular now follows the 1.1 spec and some of the defaults changed.
- BREAKING: Versions of Python before 3.6 are no longer supported.
- Update conformance docs.
- Add all keywords and update options.
- Default
processingModetojson-ld-1.1. - Implement logic for marking tests as pending, so that it will fail if a pending test passes.
- Consolidate
documentLoaderoption and defaults into aload_documentmethod to also handle JSON (eventually HTML) parsing. - Add support for
rel=alternatefor non-JSON-LD docs. - Use
lxml.htmlto load HTML and parse inload_html.- For HTML, the API base option can be updated from base element.
- Context processing:
- Support
@propagatein context processing and propagate option. - Support for
@import. (Some issues confusing recursion errors for invalid contexts). - Make
override_protectedandpropagateoptional arguments to_create_term_definitionand_process_contextinstead of using option argument. - Improve management of previous contexts.
- Imported contexts must resolve to an object.
- Do remote context processing from within
_process_contexts, as logic is too complicated for pre-loading. Removes_find_context_urlsand_retrieve_context_urls. - Added a
ContextResolverwhich can use a shared LRU cache for storing externally retrieved contexts, and the result of processing them relative to a particular active context. - Return a
frozendictfrom context processing and reduce deepcopies. - Store inverse context in an LRU cache rather than trying to modify a frozen context.
- Don't set
@basein initial context and don't resolve a relative IRI when setting@basein a context, so that the document location can be kept separate from the context itself. - Use static initial contexts composed of just
mappingsandprocessingModeto enhance preprocessed context cachability.
- Support
- Create Term Definition:
- Allow
@typeas a term under certain circumstances. - Reject and warn on keyword-like terms.
- Support protected term definitions.
- Look for keyword patterns and warn/return.
- Look for terms that are compact IRIs that don't expand to the same thing.
- Basic support for
@jsonand@noneas values of@type. - If
@containerincludes@type,@typemust be@idor@vocab. - Support
@indexand@direction. - Corner-case checking for
@prefix. - Validate scoped contexts even if not used.
- Support relative vocabulary IRIs.
- Fix check that term has the form of an IRI.
- Delay adding mapping to end of
_create_term_definition. - If a scoped context is null, wrap it in an array so it doesn't seem to be undefined.
- Allow
- IRI Expansion:
- Find keyword patterns.
- Don't treat terms starting with a colon as IRIs.
- Only return a resulting IRI if it is absolute.
- Fix
_is_absolute_irito use a reasonable regular expression and some other_expand_iri issues. - Fix to detecting relative IRIs.
- Fix special case where relative path should not have a leading '/'
- Pass in document location (through 'base' option) and use when resolving document-relative IRIs.
- IRI Compaction:
- Pass in document location (through 'base' option) and use when compacting document-relative IRIs.
- Compaction:
- Compact
@direction. - Compact
@type:@none. - Compact
@included. - Honor
@container:@seton@type. - Lists of Lists.
- Improve handling of scoped contexts and propagate.
- Improve map compaction, including indexed properties.
- Catch Absolute IRI confused with prefix.
- Compact
- Expansion:
- Updates to expansion algorithm.
_expand_valueadds@directionfrom term definition.- JSON Literals.
- Support
@directionwhen expanding. - Support lists of lists.
- Support property indexes.
- Improve graph container expansion.
- Order types when applying scoped contexts.
- Use
type_scoped_ctxwhen expanding values of@type. - Use propagate and
override_protectedproperly when creating expansion contexts.
- Flattening:
- Rewrite
_create_node_mapbased on 1.1 algorithm. - Flatten
@included. - Flatten lists of lists.
- Update
merge_node_mapsfor@type.
- Rewrite
- Framing:
- Change default for
requireAllfrom True to False. - Change default for 'embed' from '@last' to '@once'.
- Add defaults for
omitGraphandpruneBlankNodeIdentifiersbased on processing mode. - Change
_remove_preserveto_cleanup_preservewhich happens before compaction. - Add
_cleanup_nullwhich happens after compaction. - Update frame matching to 1.1 spec.
- Support
@included.
- Change default for
- ToRdf:
- Support for I18N direction.
- Support for Lists of Lists.
- Partial support for JSON canonicalization of JSON literals.
- Includes local copy of JCS library, but doesn't load.
- Lists of Lists.
- Text Direction 'i18n-datatype'.
- Testing
- Switched to argparse.
- BREAKING: Removed
-dand-mtest runner options in favor of just listing as arguments. - If no test manifests or directories are specified, default to sibling directories for json-ld-api, json-ld-framing, and normalization.
- Use
returninstead ofraise StopIterationto terminate generator.
- Accept N-Quads upper case language tag.
- Reorder code to avoid undefined symbols.
- Missing error parameter.
- Include document loaders in distribution.
- 1.0.0!
- Semantic Versioning is now past the "initial development" 0.x.y stage (after 6+ years!).
- Conformance:
- JSON-LD 1.0 + JSON-LD 1.0 errata
- JSON-LD 1.1 drafts
- Thanks to the JSON-LD and related communities and the many many people over the years who contributed ideas, code, bug reports, and support!
- Don't always use arrays for
@graph. Fixes 1.0 compatibility issue. - Process @type term contexts before key iteration.
- BREAKING: A dependency of pyld will not pull in Requests anymore.
One needs to define a dependency to
pyld[requests]or create an explicit dependency onrequestsseperately. Usepyld[aiohttp]for aiohttp. - The default document loader is set to
request_document_loader. If Requests is not available,aiohttp_document_loaderis used. When aiohttp is not availabke, adummy_document_loaderis used. - Use the W3C standard MIME type for N-Quads of "application/n-quads". Accept "application/nquads" for compatibility.
- Support for asynchronous document loader library aiohttp.
- Added
dummy_document_loaderwhich allows libraries to depend on pyld without depending on Requests or aiohttp. - The test runner contains an additional parameter
-lto specify the default document loader. - Expansion and Compaction using scoped contexts on property and
@typeterms. - Expansion and Compaction of nested properties.
- Index graph containers using
@idand@index, with@setvariations. - Index node objects using
@idand@type, with@setvariations. - Framing default and named graphs in addition to merged graph.
- Value patterns when framing, allowing a subset of values to appear in the output.
- Use default document loader for older exposed
load_documentAPI.
- Use
__about__.pyto hold versioning and other meta data. Load file insetup.pyandjsonld.py. Fixes testing and installation issues.
- BREAKING: Default http (80) and https (443) ports removed from URLs. This matches test suite behavior and other processing libs such as jsonld.js.
- BREAKING: Fix path normalization to pass test suite RFC 3984 tests. This could change output for various relative URL edge cases.
- Allow empty lists to be compacted to any
@listcontainer term. (Port from jsonld.js)
- BREAKING: Remove older document loader code. SSL/SNI support wasn't working well with newer Pythons.
- BREAKING: Switch to Requests for document loading. Some behavior could slightly change. Better supported in Python 2 and Python 3.
- Support for test suite using http or https.
- Easier to create a custom Requests document loader with the
requests_document_loadercall. Adds asecureflag to always use HTTPS. Can pass in keywords that Requests understands.verifyto disable SSL verification or use custom cert bundles.certto use client certs.timeoutto fail on timeouts (important for production use!). See Requests docs for more info.
- See git history for changes.