Skip to content

Commit c8b2fe7

Browse files
committed
Finish 3.1.8
2 parents 65dd9c0 + 24ef570 commit c8b2fe7

Some content is hidden

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

41 files changed

+1514
-154
lines changed

.coveralls.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repo_token: EUv9wY2KnN7lYmiGWUFhEKH73Ndwtok1A

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
- 2.5
3232
- 2.6
3333
- 2.7
34-
# - ruby-head # net-http-persistent
34+
- 3.0
35+
- ruby-head
3536
- jruby
3637
steps:
3738
- name: Clone repository

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source "https://rubygems.org"
2-
gem "nokogiri", '~> 1.8'
2+
gem "nokogiri", '~> 1.10'
33
gem "nokogumbo", platforms: :mri
44

55
gemspec

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[![Gem Version](https://badge.fury.io/rb/json-ld.png)](https://rubygems.org/gems/json-ld)
66
[![Build Status](https://secure.travis-ci.org/ruby-rdf/json-ld.png?branch=develop)](https://github.com/ruby-rdf/json-ld/actions?query=workflow%3ACI)
7-
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/json-ld/badge.svg)](https://coveralls.io/github/ruby-rdf/json-ld)
7+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/json-ld/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/json-ld?branch=develop)
88
[![Gitter chat](https://badges.gitter.im/ruby-rdf.png)](https://gitter.im/gitterHQ/gitter)
99

1010
## Features
@@ -17,7 +17,7 @@ JSON::LD can now be used to create a _context_ from an RDFS/OWL definition, and
1717
* If available, uses [Nokogiri][] and/or [Nokogumbo][] for parsing HTML, falls back to REXML otherwise.
1818
* Provisional support for [JSON-LD*][JSON-LD*].
1919

20-
[Implementation Report](file.earl.html)
20+
[Implementation Report](https://ruby-rdf.github.io/json-ld/etc/earl.html)
2121

2222
Install with `gem install json-ld`
2323

@@ -39,7 +39,7 @@ The [MultiJson](https://rubygems.org/gems/multi_json) gem is used for parsing JS
3939

4040
### JSON-LD* (RDFStar)
4141

42-
The {JSON::LD::API.toRdf} and {JSON::LD::API.fromRdf} API methods, along with the {JSON::LD::Reader} and {JSON::LD::Writer}, include provisional support for [JSON-LD*][JSON-LD*].
42+
The {JSON::LD::API.expand}, {JSON::LD::API.compact}, {JSON::LD::API.toRdf}, and {JSON::LD::API.fromRdf} API methods, along with the {JSON::LD::Reader} and {JSON::LD::Writer}, include provisional support for [JSON-LD*][JSON-LD*].
4343

4444
Internally, an `RDF::Statement` is treated as another resource, along with `RDF::URI` and `RDF::Node`, which allows an `RDF::Statement` to have a `#subject` or `#object` which is also an `RDF::Statement`.
4545

@@ -55,6 +55,19 @@ In JSON-LD, with the `rdfstar` option set, the value of `@id`, in addition to an
5555
"ex:certainty": 0.9
5656
}
5757

58+
Additionally, the `@annotation` property (or alias) may be used on a node object or value object to annotate the statement for which the associated node is the object of a triple.
59+
60+
{
61+
"@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
62+
"@id": "bob",
63+
"foaf:age" 23,
64+
"@annotation": {
65+
"ex:certainty": 0.9
66+
}
67+
}
68+
69+
In the first case, the embedded node is not asserted, and only appears as the subject of a triple. In the second case, the triple is asserted and used as the subject in another statement which annotates it.
70+
5871
**Note: This feature is subject to change or elimination as the standards process progresses.**
5972

6073
#### Serializing a Graph containing embedded statements

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.7
1+
3.1.8

bin/jsonld

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run(input, options, parser_options)
2424

2525
start = Time.new
2626
if options[:expand]
27-
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.has_key?(:context)
27+
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.key?(:context)
2828
input = JSON::LD::API.fromRdf(reader) if reader
2929
output = JSON::LD::API.expand(input, parser_options)
3030
secs = Time.new - start
@@ -49,7 +49,7 @@ def run(input, options, parser_options)
4949
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
5050
STDERR.puts "Framed in #{secs} seconds." unless options[:quiet]
5151
else
52-
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.has_key?(:context)
52+
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.key?(:context)
5353
parser_options[:standard_prefixes] = true
5454
reader ||= JSON::LD::Reader.new(input, parser_options)
5555
num = 0
@@ -181,7 +181,7 @@ opts.each do |opt, arg|
181181
end
182182

183183
# Hack
184-
if !(options.keys & [:expand, :compact, :flatten, :frame]).empty? &&
184+
if !(options.keys & %i{expand compact flatten frame}).empty? &&
185185
(parser_options[:stream] || options[:output_format] != :jsonld)
186186
STDERR.puts "Incompatible options"
187187
exit(1)

etc/doap.ttl

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
99

1010
<> a doap:Project;
11+
doap:name "JSON::LD"^^xsd:string;
12+
doap:shortdesc "JSON-LD support for Ruby."@en;
13+
doap:description "JSON::LD parses and serializes JSON-LD into RDF and implements expansion, compaction and framing API interfaces for the Ruby RDF.rb library suite."@en;
1114
dc:creator <https://greggkellogg.net/foaf#me>;
1215
doap:blog <https://greggkellogg.net/>;
1316
doap:bug-database <https://github.com/ruby-rdf/json-ld/issues>;
1417
doap:created "2011-05-07"^^xsd:date;
15-
doap:description "RDF.rb extension for parsing/serializing JSON-LD data."@en;
1618
doap:developer <https://greggkellogg.net/foaf#me>;
1719
doap:documenter <https://greggkellogg.net/foaf#me>;
1820
doap:homepage <https://github.com/ruby-rdf/json-ld/>;
@@ -21,9 +23,7 @@
2123
<https://www.w3.org/TR/json-ld11-framing/>;
2224
doap:license <https://unlicense.org/1.0/>;
2325
doap:maintainer <https://greggkellogg.net/foaf#me>;
24-
doap:name "JSON::LD"^^xsd:string;
2526
doap:programming-language "Ruby";
26-
doap:shortdesc "JSON-LD support for RDF.rb."@en;
2727
foaf:maker <https://greggkellogg.net/foaf#me> .
2828

2929
<https://greggkellogg.net/foaf#me> a foaf:Person;

etc/template.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
%dd{rel: "doap:developer"}
103103
- subject['developer'].each do |dev|
104104
%div{resource: dev['@id'], typeof: Array(dev['@type']).join(" ")}
105-
- if dev.has_key?('@id')
105+
- if dev.key?('@id')
106106
%a{href: dev['@id']}
107107
%span{property: "foaf:name"}<
108108
~ CGI.escapeHTML dev['foaf:name'].to_s
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"@context": {
3+
"id": "@id",
4+
"type": {"@id": "@type", "@container": "@set"},
5+
"@vocab": "http://www.w3.org/ns/shacl#",
6+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7+
"shacl": "http://www.w3.org/ns/shacl#",
8+
"sh": "http://www.w3.org/ns/shacl#",
9+
"xsd": "http://www.w3.org/2001/XMLSchema#",
10+
"and": {"@type": "@id", "@container": "@list"},
11+
"annotationProperty": {"@type": "@id"},
12+
"class": {"@type": "@id"},
13+
"comment": "http://www.w3.org/2000/01/rdf-schema#comment",
14+
"condition": {"@type": "@id"},
15+
"datatype": {"@type": "@vocab"},
16+
"declare": {"@type": "@id"},
17+
"disjoint": {"@type": "@id"},
18+
"disjoint": {"@type": "@id"},
19+
"entailment": {"@type": "@id"},
20+
"equals": {"@type": "@id"},
21+
"ignoredProperties": {"@type": "@id", "@container": "@list"},
22+
"in": {"@type": "@none", "@container": "@list"},
23+
"inversePath": {"@type": "@id"},
24+
"label": "http://www.w3.org/2000/01/rdf-schema#label",
25+
"languageIn": {"@container": "@list"},
26+
"lessThan": {"@type": "@id"},
27+
"lessThanOrEquals": {"@type": "@id"},
28+
"nodeKind": {"@type": "@vocab"},
29+
"or": {"@type": "@id", "@container": "@list"},
30+
"path": {"@type": "@none"},
31+
"property": {"@type": "@id"},
32+
"severity": {"@type": "@vocab"},
33+
"targetClass": {"@type": "@id"},
34+
"targetNode": {"@type": "@none"},
35+
"xone": {"@type": "@id", "@container": "@list"}
36+
},
37+
"@requireAll": false,
38+
"@type": ["NodeShape", "PropertyShape"],
39+
"property": {},
40+
"targetClass": {},
41+
"targetNode": {},
42+
"targetObjectsOf": {},
43+
"targetSubjectsOf": {}
44+
}
+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
[
2+
{
3+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#InvalidResource1",
4+
"http://datashapes.org/sh/tests/core/misc/severity-002.test#property": [
5+
{
6+
"@value": true
7+
}
8+
]
9+
},
10+
{
11+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#TestShape1",
12+
"http://www.w3.org/ns/shacl#nodeKind": [
13+
{
14+
"@id": "http://www.w3.org/ns/shacl#BlankNode"
15+
}
16+
],
17+
"http://www.w3.org/ns/shacl#property": [
18+
{
19+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#TestShape2"
20+
}
21+
],
22+
"http://www.w3.org/ns/shacl#severity": [
23+
{
24+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#MySeverity"
25+
}
26+
],
27+
"http://www.w3.org/ns/shacl#targetNode": [
28+
{
29+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#InvalidResource1"
30+
}
31+
]
32+
},
33+
{
34+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#TestShape2",
35+
"http://www.w3.org/ns/shacl#path": [
36+
{
37+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#property"
38+
}
39+
],
40+
"http://www.w3.org/ns/shacl#datatype": [
41+
{
42+
"@id": "http://www.w3.org/2001/XMLSchema#integer"
43+
}
44+
],
45+
"http://www.w3.org/ns/shacl#severity": [
46+
{
47+
"@id": "http://www.w3.org/ns/shacl#Info"
48+
}
49+
]
50+
},
51+
{
52+
"@id": "urn:x-shacl-test:/core/misc/severity-002.ttl",
53+
"@type": [
54+
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#Manifest"
55+
],
56+
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#entries": [
57+
{
58+
"@list": [
59+
{
60+
"@id": "urn:x-shacl-test:/core/misc/severity-002"
61+
}
62+
]
63+
}
64+
]
65+
},
66+
{
67+
"@id": "urn:x-shacl-test:/core/misc/severity-002",
68+
"@type": [
69+
"http://www.w3.org/ns/shacl-test#Validate"
70+
],
71+
"http://www.w3.org/2000/01/rdf-schema#label": [
72+
{
73+
"@value": "Test of sh:severity 002"
74+
}
75+
],
76+
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action": [
77+
{
78+
"@id": "_:g451300"
79+
}
80+
],
81+
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result": [
82+
{
83+
"@id": "_:g451320"
84+
}
85+
],
86+
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#status": [
87+
{
88+
"@id": "http://www.w3.org/ns/shacl-test#approved"
89+
}
90+
]
91+
},
92+
{
93+
"@id": "_:g451300",
94+
"http://www.w3.org/ns/shacl-test#dataGraph": [
95+
{
96+
"@id": "urn:x-shacl-test:/core/misc/severity-002.ttl"
97+
}
98+
],
99+
"http://www.w3.org/ns/shacl-test#shapesGraph": [
100+
{
101+
"@id": "urn:x-shacl-test:/core/misc/severity-002.ttl"
102+
}
103+
]
104+
},
105+
{
106+
"@id": "_:g451320",
107+
"@type": [
108+
"http://www.w3.org/ns/shacl#ValidationReport"
109+
],
110+
"http://www.w3.org/ns/shacl#conforms": [
111+
{
112+
"@value": false
113+
}
114+
],
115+
"http://www.w3.org/ns/shacl#result": [
116+
{
117+
"@id": "_:g451340"
118+
},
119+
{
120+
"@id": "_:g451360"
121+
}
122+
]
123+
},
124+
{
125+
"@id": "_:g451340",
126+
"@type": [
127+
"http://www.w3.org/ns/shacl#ValidationResult"
128+
],
129+
"http://www.w3.org/ns/shacl#focusNode": [
130+
{
131+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#InvalidResource1"
132+
}
133+
],
134+
"http://www.w3.org/ns/shacl#resultPath": [
135+
{
136+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#property"
137+
}
138+
],
139+
"http://www.w3.org/ns/shacl#resultSeverity": [
140+
{
141+
"@id": "http://www.w3.org/ns/shacl#Info"
142+
}
143+
],
144+
"http://www.w3.org/ns/shacl#sourceConstraintComponent": [
145+
{
146+
"@id": "http://www.w3.org/ns/shacl#DatatypeConstraintComponent"
147+
}
148+
],
149+
"http://www.w3.org/ns/shacl#sourceShape": [
150+
{
151+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#TestShape2"
152+
}
153+
],
154+
"http://www.w3.org/ns/shacl#value": [
155+
{
156+
"@value": true
157+
}
158+
]
159+
},
160+
{
161+
"@id": "_:g451360",
162+
"@type": [
163+
"http://www.w3.org/ns/shacl#ValidationResult"
164+
],
165+
"http://www.w3.org/ns/shacl#focusNode": [
166+
{
167+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#InvalidResource1"
168+
}
169+
],
170+
"http://www.w3.org/ns/shacl#resultSeverity": [
171+
{
172+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#MySeverity"
173+
}
174+
],
175+
"http://www.w3.org/ns/shacl#sourceConstraintComponent": [
176+
{
177+
"@id": "http://www.w3.org/ns/shacl#NodeKindConstraintComponent"
178+
}
179+
],
180+
"http://www.w3.org/ns/shacl#sourceShape": [
181+
{
182+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#TestShape1"
183+
}
184+
],
185+
"http://www.w3.org/ns/shacl#value": [
186+
{
187+
"@id": "http://datashapes.org/sh/tests/core/misc/severity-002.test#InvalidResource1"
188+
}
189+
]
190+
}
191+
]

json-ld.gemspec

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |gem|
1111
gem.homepage = "https://github.com/ruby-rdf/json-ld"
1212
gem.license = 'Unlicense'
1313
gem.summary = "JSON-LD reader/writer for Ruby."
14-
gem.description = "JSON::LD parses and serializes JSON-LD into RDF and implements expansion, compaction and framing API interfaces."
14+
gem.description = "JSON::LD parses and serializes JSON-LD into RDF and implements expansion, compaction and framing API interfaces for the Ruby RDF.rb library suite."
1515

1616
gem.authors = ['Gregg Kellogg']
1717
gem.email = '[email protected]'

0 commit comments

Comments
 (0)