json_ld_procossor

所属分类:WEB开发
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2023-10-06 12:38:28
上 传 者sh-1993
说明:  Json LD处理器用纯飞镖编写,
(Json-LD Processor written in pure dart,)

文件列表:
.idea/ (0, 2023-07-06)
.idea/libraries/ (0, 2023-07-06)
.idea/libraries/Dart_Packages.xml (14932, 2023-07-06)
.idea/libraries/Dart_SDK.xml (1626, 2023-07-06)
.idea/misc.xml (172, 2023-07-06)
.idea/modules.xml (274, 2023-07-06)
.idea/vcs.xml (180, 2023-07-06)
CHANGELOG.md (190, 2023-07-06)
LICENSE (1495, 2023-07-06)
analysis_options.yaml (1038, 2023-07-06)
example/ (0, 2023-07-06)
example/json_ld_processor_example.dart (2080, 2023-07-06)
json_ld_processor.iml (618, 2023-07-06)
lib/ (0, 2023-07-06)
lib/json_ld_processor.dart (228, 2023-07-06)
lib/src/ (0, 2023-07-06)
lib/src/compact.dart (30436, 2023-07-06)
lib/src/constants.dart (1403, 2023-07-06)
lib/src/context_processing.dart (30955, 2023-07-06)
lib/src/expansion.dart (32197, 2023-07-06)
lib/src/flatten.dart (12938, 2023-07-06)
lib/src/json_ld_processor_base.dart (21399, 2023-07-06)
lib/src/normalize.dart (12211, 2023-07-06)
lib/src/to_rdf.dart (6390, 2023-07-06)
lib/src/utils.dart (12193, 2023-07-06)
pubspec.yaml (344, 2023-07-06)
test/ (0, 2023-07-06)
test/json_ld_processor_test.dart (14980, 2023-07-06)

# Json LD Processing Library This package implements the [JSON-LD Processing algorithms 1.1](https://www.w3.org/TR/json-ld11-api/) and the [URDNA2015 Canonicalization](https://w3c-ccg.github.io/rdf-dataset-canonicalization/spec/) algorithm in pure Dart. **Important Note**: This package is work-in-progress. Not all algorithms are implemented for now and not everything works perfect (See Implementation Status). But in general it works. ## Usage ```Dart Map input = {}; //a valid Json-ld document //expansion var expanded = await JsonLdProcessor.expand(input); //flattening var flattened = await JsonLdProcessor.flatten(input); //toRdf var rdf = await JsonLdProcessor.toRdf(input); //normalize (URDNA2015) with additional options var normalized = await JsonLdProcessor.normalize(input, options: JsonLdOptions(safeMode: true)); ``` ## SafeMode Option As the implementor of the normalization algorithms URDNA2015 and URGNA2012 in java [showed in his repo](https://github.com/setl/rdf-urdna/tree/master/jsonld-warnings), using json-ld and normalization for signing there are some security flaws. In some cases the documents could be manipulated and the signatures stays correct. One reasons for this can be found in the expansion algorithm. If a property of the input document can't be expanded to an IRI or keyword, it is dropped and so not included in the normalized dataset.To be able to throw an exception in this case, there is a safeMode option. It is default set to false. But if it is true, the exception is thrown. If not, the property is dropped as standardized. I recommend setting it to true, if you normalize a json-ld document before signing. **Note:** The idea introducing this option is borrowed from the [JavaScript implementation](https://github.com/digitalbazaar/jsonld.js/) which powers the [JSON-LD Playground](https://json-ld.org/playground/) as well. This option is not part of the standard yet. ## Implementation Status and Test Coverage | Algorithm | Tests passed | Tests failed | Notes | |------|--------------|--------------|-----------------------------------------------------| | expand | 363 | 8 | | | flatten | 55 | 1 | one failed, because of missing compaction algorithm | compact | 94 | 149 | needs bugfixing | | fromRdf | 0 | 0 | not implemented yet | | toRdf | 406 | 30 | rdfDirection option is not implemented yet | | normalize | 62 | 1 | | ### Run tests The test data is taken from [here](https://github.com/w3c/json-ld-api/) for json-ld api test and [here](https://github.com/w3c-ccg/rdf-dataset-canonicalization) for normalization tests. Therefore you need to clone these two repos next to this, if you would like to run the tests. ## Future Plans - remove bugs - implement Compaction and fromRdf - support [framing](https://www.w3.org/TR/json-ld11-framing/)

近期下载者

相关文件


收藏者