rdf-trig 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/trig/streaming_writer.rb +3 -3
- data/lib/rdf/trig/writer.rb +6 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc51044891f6ba181499a9e912b506a078386bfb6d51072e167c779de4e100b
|
4
|
+
data.tar.gz: e0f4c9e87e75ad036d04a8e24eb98ba17ba4bdd870dbc885a0ac670ccc0a857e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5df3fc5397cdfab6fc48592289583e9c5ba65b9e6e649bfbedfb845ad24c3253a18328faa49ec973e89d475ffba66f6f0b426d3216494dbc1ab53b27b09485f
|
7
|
+
data.tar.gz: 75b5cf8eb3e6dfe45cac008acef6837cc4f728c62d098697fff69b5eb2d9a1a97a6b2399c6fd8c1cdbc5679048d95715eab0694b1782905491e6f4dc4b9010bd
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1
|
@@ -15,16 +15,16 @@ module RDF::TriG
|
|
15
15
|
end
|
16
16
|
@streaming_graph, @streaming_subject, @streaming_predicate = statement.graph_name, statement.subject, statement.predicate
|
17
17
|
@output.write "#{format_term(statement.subject, options)} "
|
18
|
-
@output.write "#{format_term(statement.predicate, options)} "
|
18
|
+
@output.write "#{statement.predicate == RDF.type ? 'a' : format_term(statement.predicate, options)} "
|
19
19
|
elsif statement.subject != @streaming_subject
|
20
20
|
@output.puts " ." if @previous_statement
|
21
21
|
@output.write "#{indent(@streaming_subject ? 1 : 0)}"
|
22
22
|
@streaming_subject, @streaming_predicate = statement.subject, statement.predicate
|
23
23
|
@output.write "#{format_term(statement.subject, options)} "
|
24
|
-
@output.write "#{format_term(statement.predicate, options)} "
|
24
|
+
@output.write "#{statement.predicate == RDF.type ? 'a' : format_term(statement.predicate, options)} "
|
25
25
|
elsif statement.predicate != @streaming_predicate
|
26
26
|
@streaming_predicate = statement.predicate
|
27
|
-
@output.write ";\n#{indent(@streaming_subject ? 2 : 1)}#{format_term(statement.predicate, options)} "
|
27
|
+
@output.write ";\n#{indent(@streaming_subject ? 2 : 1)}#{statement.predicate == RDF.type ? 'a' : format_term(statement.predicate, options)} "
|
28
28
|
else
|
29
29
|
@output.write ",\n#{indent(@streaming_subject ? 3 : 2)}"
|
30
30
|
end
|
data/lib/rdf/trig/writer.rb
CHANGED
@@ -149,7 +149,8 @@ module RDF::TriG
|
|
149
149
|
preprocess
|
150
150
|
start_document
|
151
151
|
|
152
|
-
|
152
|
+
@graph_names = order_graphs
|
153
|
+
@graph_names.each do |graph_name|
|
153
154
|
log_depth do
|
154
155
|
log_debug {"graph_name: #{graph_name.inspect}"}
|
155
156
|
reset
|
@@ -170,7 +171,7 @@ module RDF::TriG
|
|
170
171
|
# that are present in more than one graph;
|
171
172
|
# these are legal, but can't be serialized as lists
|
172
173
|
@lists.reject! do |node, list|
|
173
|
-
ref_count(node) > 0 &&
|
174
|
+
ref_count(node) > 0 && prop_count(node) > 0 ||
|
174
175
|
list.subjects.any? {|elt| !resource_in_single_graph?(elt)}
|
175
176
|
end
|
176
177
|
|
@@ -190,8 +191,9 @@ module RDF::TriG
|
|
190
191
|
protected
|
191
192
|
|
192
193
|
# Add additional constraint that the resource must be in a single graph
|
193
|
-
|
194
|
-
|
194
|
+
# and must not be a graph name
|
195
|
+
def blankNodePropertyList?(resource, position)
|
196
|
+
super && resource_in_single_graph?(resource) && !@graph_names.include?(resource)
|
195
197
|
end
|
196
198
|
|
197
199
|
def resource_in_single_graph?(resource)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-trig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '3.0'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.0.
|
50
|
+
version: 3.0.3
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '3.0'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.0.
|
60
|
+
version: 3.0.3
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: json-ld
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|