Skip to content

Commit 0dbcf4d

Browse files
authored
Merge pull request #24 from piprate/json11-dec-2019
JSON-LD 1.1 Support
2 parents f0fdd01 + d988aff commit 0dbcf4d

File tree

1,461 files changed

+61150
-4011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,461 files changed

+61150
-4011
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# JSON-goLD Change Log
22

3+
## v0.3.0 - 2020-01-08
4+
5+
- Substantial conformance to the latest W3C Recommendation for JSON-LD 1.1 specification.
6+
- Default processing mode set to JSON-LD 1.1
7+
8+
### IMPORTANT NOTES
9+
10+
- JSON-LD 1.1 introduces several changes in internal (and some external) interfaces
11+
- JSON-LD 1.1 algorithms are considerably more complex than 1.0. Performance impact hasn't been evaluated yet. There were no attempts yet to optimise the implementation.
12+
313
## v0.2.0 - 2019-01-16
414

515
- JSON 1.1 support

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
.PHONY: all lint test fmt help
1+
.PHONY: all vet lint test fmt help
22

33
all: lint test
44

5-
lint:
5+
vet:
66
go vet github.com/piprate/json-gold/...
77

8-
test: lint
8+
test: vet
99
go test github.com/piprate/json-gold/...
1010

11+
lint:
12+
golangci-lint run
13+
1114
fmt:
1215
gofmt -s -w .
1316

@@ -17,7 +20,8 @@ help:
1720
@echo '--------------------------------------------------'
1821
@echo ' all - Run everything '
1922
@echo ' fmt - Format code '
20-
@echo ' lint - Run lint '
23+
@echo ' lint - Run golangci-lint '
24+
@echo ' vet - Run vet '
2125
@echo ' test - Run all tests '
2226
@echo '--------------------------------------------------'
2327
@echo ''

README.md

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,50 @@ This library aims to pass the official [test suite](https://json-ld.org/test-sui
2020
- [JSON-LD 1.0 Processing Algorithms and API](http://www.w3.org/TR/2014/REC-json-ld-api-20140116/),
2121
W3C Recommendation,
2222
2014-01-16, and any [errata](http://www.w3.org/2014/json-ld-errata)
23-
- [JSON-LD 1.1](https://json-ld.org/spec/FCGS/json-ld/20180607/),
24-
Final Community Group Report,
25-
2018-06-07 or [newer JSON-LD latest](https://json-ld.org/spec/latest/json-ld/)
26-
- [JSON-LD 1.1 Processing Algorithms and API](https://json-ld.org/spec/ED/json-ld-api/20180215/),
27-
W3C Editor's Draft,
28-
2018-12-15 or [newer <JSON-LD Processing Algorithms and API latest](https://json-ld.org/spec/latest/json-ld-api/)
29-
- [JSON-LD Framing 1.1](https://json-ld.org/spec/latest/json-ld-framing/)
30-
Draft Community Group Report
31-
2018-09-05 or newer
32-
33-
As of April 30th, 2019:
34-
35-
* 89.9% of tests from the [official JSON-LD test suite](https://github.com/json-ld/json-ld.org/tree/master/test-suite) pass. The failing tests are related to HTML based checks and the most recently added features of JSON 1.1 spec.
23+
- [JSON-LD 1.1](https://www.w3.org/TR/2019/CR-json-ld11-20191212/),
24+
W3C Candidate Recommendation,
25+
2019-12-12 or [newer JSON-LD latest](https://json-ld.org/spec/latest/json-ld/)
26+
- [JSON-LD 1.1 Processing Algorithms and API](https://www.w3.org/TR/2019/CR-json-ld11-api-20191212/),
27+
W3C Candidate Recommendation,
28+
2019-12-12 or [newer JSON-LD Processing Algorithms and API latest](https://www.w3.org/TR/json-ld11-api/)
29+
- [JSON-LD Framing 1.1](https://www.w3.org/TR/2019/CR-json-ld11-framing-20191212/)
30+
W3C Candidate Recommendation
31+
2019-12-12 or [newer](https://www.w3.org/TR/json-ld11-framing/)
32+
33+
### Current JSON-LD 1.1 Conformance Status
34+
35+
This library provides comprehensive support of JSON-LD 1.1 specification, except in the areas mentioned below:
36+
37+
#### Expansion
38+
39+
Good coverage.
40+
41+
#### Compaction
42+
43+
Good coverage, except:
44+
45+
- `@included` directive not supported
46+
47+
#### RDF Serialization/Deserialization
48+
49+
Good coverage, except:
50+
51+
- JSON literals (`@json`) aren't supported
52+
- `rdfDirection` option is not yet supported (including _i18n-datatype_ and _compound-literal_ forms)
53+
54+
#### HTML based processing
55+
56+
Not supported.
57+
58+
### Current JSON-LD 1.1 Framing Conformance Status
59+
60+
Not supported. The current implementation is still based on an earlier version of JSON-LD 1.1 Framing specification.
61+
62+
### Official 1.1 Test Suite
63+
64+
As of January 8th, 2020:
65+
66+
* 88.7% of tests from the [official JSON-LD test suite](https://github.com/json-ld/json-ld.org/tree/master/test-suite) pass.
3667
* all RDF Dataset Normalisation tests from the [current test suite](https://json-ld.github.io/normalization/tests/index.html) pass
3768

3869
## Examples ##
@@ -74,8 +105,6 @@ See complete code in [examples/compact.go](examples/compact.go).
74105
```go
75106
proc := ld.NewJsonLdProcessor()
76107
options := ld.NewJsonLdOptions("")
77-
// add the processing mode explicitly if you need JSON-LD 1.1 features
78-
options.ProcessingMode = ld.JsonLd_1_1
79108

80109
doc := map[string]interface{}{
81110
"@id": "http://example.org/test#book",
@@ -105,8 +134,6 @@ See complete code in [examples/flatten.go](examples/flatten.go).
105134
```go
106135
proc := ld.NewJsonLdProcessor()
107136
options := ld.NewJsonLdOptions("")
108-
// add the processing mode explicitly if you need JSON-LD 1.1 features
109-
options.ProcessingMode = ld.JsonLd_1_1
110137

111138
doc := map[string]interface{}{
112139
"@context": []interface{}{
@@ -138,8 +165,6 @@ See complete code in [examples/frame.go](examples/frame.go).
138165
```go
139166
proc := ld.NewJsonLdProcessor()
140167
options := ld.NewJsonLdOptions("")
141-
// add the processing mode explicitly if you need JSON-LD 1.1 features
142-
options.ProcessingMode = ld.JsonLd_1_1
143168

144169
doc := map[string]interface{}{
145170
"@context": map[string]interface{}{
@@ -193,8 +218,6 @@ See complete code in [examples/to_rdf.go](examples/to_rdf.go).
193218
```go
194219
proc := ld.NewJsonLdProcessor()
195220
options := ld.NewJsonLdOptions("")
196-
// add the processing mode explicitly if you need JSON-LD 1.1 features
197-
options.ProcessingMode = ld.JsonLd_1_1
198221
options.Format = "application/n-quads"
199222

200223
// this JSON-LD document was taken from http://json-ld.org/test-suite/tests/toRdf-0028-in.jsonld
@@ -227,8 +250,6 @@ See complete code in [examples/from_rdf.go](examples/from_rdf.go).
227250
```go
228251
proc := ld.NewJsonLdProcessor()
229252
options := ld.NewJsonLdOptions("")
230-
// add the processing mode explicitly if you need JSON-LD 1.1 features
231-
options.ProcessingMode = ld.JsonLd_1_1
232253

233254
triples := `
234255
<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
@@ -248,8 +269,6 @@ See complete code in [examples/normalize.go](examples/normalize.go).
248269
```go
249270
proc := ld.NewJsonLdProcessor()
250271
options := ld.NewJsonLdOptions("")
251-
// add the processing mode explicitly if you need JSON-LD 1.1 features
252-
options.ProcessingMode = ld.JsonLd_1_1
253272
options.Format = "application/n-quads"
254273
options.Algorithm = "URDNA2015"
255274

@@ -269,7 +288,7 @@ normalizedTriples, err := proc.Normalize(doc, options)
269288

270289
## Inspiration ##
271290

272-
This implementation was heavily influenced by [JSONLD-Java](https://github.com/jsonld-java/jsonld-java) with some techniques borrowed from [PyLD](https://github.com/digitalbazaar/pyld) and [gojsonld](https://github.com/linkeddata/gojsonld). Big thank you to the contributors of the forementioned libraries for figuring out implementation details of the core algorithms.
291+
This implementation was influenced by [Ruby JSON-LD reader/writer](https://github.com/ruby-rdf/json-ld), [JSONLD-Java](https://github.com/jsonld-java/jsonld-java) with some techniques borrowed from [PyLD](https://github.com/digitalbazaar/pyld) and [gojsonld](https://github.com/linkeddata/gojsonld). Big thank you to the contributors of the aforementioned libraries for figuring out implementation details of the core algorithms.
273292

274293
## History ##
275294

0 commit comments

Comments
 (0)