rdf-turtle 1.1.0p2 → 1.1.0p3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/rdf/turtle/meta.rb +1 -26
- data/lib/rdf/turtle/reader.rb +21 -2
- data/lib/rdf/turtle/streaming_writer.rb +52 -0
- data/lib/rdf/turtle/writer.rb +56 -31
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmNhNDYwMWEyY2VhYTY4MzE1OTk2Mjk3ODA0YjFhNjgwZDhmN2U0NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmEzYTM0MGUzMjVmNzg2NWI2NDljNzNiZjU2ZWJjN2JkYmY2NmVhZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2UxYTFhODg2YWFhMDlmYjU3ZDJlOThjOGU0NGI0Yzc0Mzc1ZTJmZDliMGVl
|
10
|
+
MjAzMWZhZGQwNWRhNTI2YTRhYTY2ZGNmOTk3YzM0YWIyZjIwZjM4ZjYzZGRm
|
11
|
+
OTRkZjdhNmUzMWYwOGI5YzM1NDhjNDEwYzIwZDUwNzE4N2Y0OWQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTliNWU3ZjJmNTk2YmYzOTQ2NzJkZWYyYTllODJmNmY1MTAxNzI3YjI3OTA5
|
14
|
+
NDMxNTc1ZDE4ZmZmMzg1MTM5YWIyZjI3ODYxYTNjMDQwNzJkYmFkNzUxYTY3
|
15
|
+
YTVlODYwZmZjMWNhNWU5NjJlNGViNjc3MzFkYWRkZWE2NWZkZjE=
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ Install with `gem install rdf-turtle`
|
|
16
16
|
* 100% free and unencumbered [public domain](http://unlicense.org/) software.
|
17
17
|
* Implements a complete parser for [Turtle][].
|
18
18
|
* Compatible with Ruby >= 1.9.2.
|
19
|
+
* Optional streaming writer, to serialize large graphs
|
19
20
|
|
20
21
|
## Usage
|
21
22
|
Instantiate a reader from a local file:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.0p3
|
data/lib/rdf/turtle/meta.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# This file is automatically generated by /Users/gregg/.rvm/gems/ruby-1.9.3-
|
1
|
+
# This file is automatically generated by /Users/gregg/.rvm/gems/ruby-1.9.3-p429/bundler/gems/ebnf-3f823030418a/bin/ebnf
|
2
2
|
# BRANCH derived from etc/turtle.bnf
|
3
3
|
module RDF::Turtle::Meta
|
4
4
|
START = :turtleDoc
|
@@ -197,7 +197,6 @@ module RDF::Turtle::Meta
|
|
197
197
|
:PNAME_NS => [:iri],
|
198
198
|
},
|
199
199
|
:predicateObjectList => {
|
200
|
-
"A" => [:verb, :objectList, :_predicateObjectList_1],
|
201
200
|
:IRIREF => [:verb, :objectList, :_predicateObjectList_1],
|
202
201
|
:PNAME_LN => [:verb, :objectList, :_predicateObjectList_1],
|
203
202
|
:PNAME_NS => [:verb, :objectList, :_predicateObjectList_1],
|
@@ -217,7 +216,6 @@ module RDF::Turtle::Meta
|
|
217
216
|
:_predicateObjectList_4 => {
|
218
217
|
"." => [],
|
219
218
|
";" => [],
|
220
|
-
"A" => [:_predicateObjectList_5],
|
221
219
|
:IRIREF => [:_predicateObjectList_5],
|
222
220
|
:PNAME_LN => [:_predicateObjectList_5],
|
223
221
|
:PNAME_NS => [:_predicateObjectList_5],
|
@@ -225,7 +223,6 @@ module RDF::Turtle::Meta
|
|
225
223
|
"a" => [:_predicateObjectList_5],
|
226
224
|
},
|
227
225
|
:_predicateObjectList_5 => {
|
228
|
-
"A" => [:verb, :objectList],
|
229
226
|
:IRIREF => [:verb, :objectList],
|
230
227
|
:PNAME_LN => [:verb, :objectList],
|
231
228
|
:PNAME_NS => [:verb, :objectList],
|
@@ -296,7 +293,6 @@ module RDF::Turtle::Meta
|
|
296
293
|
},
|
297
294
|
:_triples_3 => {
|
298
295
|
"." => [],
|
299
|
-
"A" => [:predicateObjectList],
|
300
296
|
:IRIREF => [:predicateObjectList],
|
301
297
|
:PNAME_LN => [:predicateObjectList],
|
302
298
|
:PNAME_NS => [:predicateObjectList],
|
@@ -325,7 +321,6 @@ module RDF::Turtle::Meta
|
|
325
321
|
"[" => [:statement, :turtleDoc],
|
326
322
|
},
|
327
323
|
:verb => {
|
328
|
-
"A" => ["A"],
|
329
324
|
:IRIREF => [:predicate],
|
330
325
|
:PNAME_LN => [:predicate],
|
331
326
|
:PNAME_NS => [:predicate],
|
@@ -338,7 +333,6 @@ module RDF::Turtle::Meta
|
|
338
333
|
",",
|
339
334
|
".",
|
340
335
|
";",
|
341
|
-
"A",
|
342
336
|
:ANON,
|
343
337
|
:BASE,
|
344
338
|
:BLANK_NODE_LABEL,
|
@@ -411,7 +405,6 @@ module RDF::Turtle::Meta
|
|
411
405
|
:blankNodePropertyList => [
|
412
406
|
"["],
|
413
407
|
:_blankNodePropertyList_1 => [
|
414
|
-
"A",
|
415
408
|
"a",
|
416
409
|
:IRIREF,
|
417
410
|
:PNAME_LN,
|
@@ -581,7 +574,6 @@ module RDF::Turtle::Meta
|
|
581
574
|
:PNAME_LN,
|
582
575
|
:PNAME_NS],
|
583
576
|
:predicateObjectList => [
|
584
|
-
"A",
|
585
577
|
"a",
|
586
578
|
:IRIREF,
|
587
579
|
:PNAME_LN,
|
@@ -595,13 +587,11 @@ module RDF::Turtle::Meta
|
|
595
587
|
";"],
|
596
588
|
:_predicateObjectList_4 => [
|
597
589
|
:_eps,
|
598
|
-
"A",
|
599
590
|
"a",
|
600
591
|
:IRIREF,
|
601
592
|
:PNAME_LN,
|
602
593
|
:PNAME_NS],
|
603
594
|
:_predicateObjectList_5 => [
|
604
|
-
"A",
|
605
595
|
"a",
|
606
596
|
:IRIREF,
|
607
597
|
:PNAME_LN,
|
@@ -628,7 +618,6 @@ module RDF::Turtle::Meta
|
|
628
618
|
";"],
|
629
619
|
:_predicateObjectList_8 => [
|
630
620
|
:_eps,
|
631
|
-
"A",
|
632
621
|
"a",
|
633
622
|
:IRIREF,
|
634
623
|
:PNAME_LN,
|
@@ -708,20 +697,17 @@ module RDF::Turtle::Meta
|
|
708
697
|
"["],
|
709
698
|
:_triples_3 => [
|
710
699
|
:_eps,
|
711
|
-
"A",
|
712
700
|
"a",
|
713
701
|
:IRIREF,
|
714
702
|
:PNAME_LN,
|
715
703
|
:PNAME_NS],
|
716
704
|
:_triples_4 => [
|
717
|
-
"A",
|
718
705
|
"a",
|
719
706
|
:IRIREF,
|
720
707
|
:PNAME_LN,
|
721
708
|
:PNAME_NS],
|
722
709
|
:_triples_5 => [
|
723
710
|
:_eps,
|
724
|
-
"A",
|
725
711
|
"a",
|
726
712
|
:IRIREF,
|
727
713
|
:PNAME_LN,
|
@@ -759,7 +745,6 @@ module RDF::Turtle::Meta
|
|
759
745
|
:PNAME_LN,
|
760
746
|
:PNAME_NS],
|
761
747
|
:verb => [
|
762
|
-
"A",
|
763
748
|
"a",
|
764
749
|
:IRIREF,
|
765
750
|
:PNAME_LN,
|
@@ -767,7 +752,6 @@ module RDF::Turtle::Meta
|
|
767
752
|
}.freeze
|
768
753
|
FOLLOW = {
|
769
754
|
:BlankNode => [
|
770
|
-
"A",
|
771
755
|
"a",
|
772
756
|
")",
|
773
757
|
",",
|
@@ -835,7 +819,6 @@ module RDF::Turtle::Meta
|
|
835
819
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
836
820
|
:STRING_LITERAL_LONG_QUOTE],
|
837
821
|
:PrefixedName => [
|
838
|
-
"A",
|
839
822
|
"a",
|
840
823
|
:IRIREF,
|
841
824
|
:BLANK_NODE_LABEL,
|
@@ -1038,7 +1021,6 @@ module RDF::Turtle::Meta
|
|
1038
1021
|
:PNAME_NS],
|
1039
1022
|
:blankNodePropertyList => [
|
1040
1023
|
".",
|
1041
|
-
"A",
|
1042
1024
|
"a",
|
1043
1025
|
")",
|
1044
1026
|
",",
|
@@ -1062,7 +1044,6 @@ module RDF::Turtle::Meta
|
|
1062
1044
|
:STRING_LITERAL_LONG_QUOTE],
|
1063
1045
|
:_blankNodePropertyList_1 => [
|
1064
1046
|
".",
|
1065
|
-
"A",
|
1066
1047
|
"a",
|
1067
1048
|
")",
|
1068
1049
|
",",
|
@@ -1086,7 +1067,6 @@ module RDF::Turtle::Meta
|
|
1086
1067
|
:STRING_LITERAL_LONG_QUOTE],
|
1087
1068
|
:_blankNodePropertyList_2 => [
|
1088
1069
|
".",
|
1089
|
-
"A",
|
1090
1070
|
"a",
|
1091
1071
|
")",
|
1092
1072
|
",",
|
@@ -1109,7 +1089,6 @@ module RDF::Turtle::Meta
|
|
1109
1089
|
:STRING_LITERAL_LONG_SINGLE_QUOTE,
|
1110
1090
|
:STRING_LITERAL_LONG_QUOTE],
|
1111
1091
|
:collection => [
|
1112
|
-
"A",
|
1113
1092
|
"a",
|
1114
1093
|
")",
|
1115
1094
|
",",
|
@@ -1137,7 +1116,6 @@ module RDF::Turtle::Meta
|
|
1137
1116
|
:_collection_2 => [
|
1138
1117
|
")"],
|
1139
1118
|
:_collection_3 => [
|
1140
|
-
"A",
|
1141
1119
|
"a",
|
1142
1120
|
")",
|
1143
1121
|
",",
|
@@ -1163,7 +1141,6 @@ module RDF::Turtle::Meta
|
|
1163
1141
|
:_collection_4 => [
|
1164
1142
|
")"],
|
1165
1143
|
:_collection_5 => [
|
1166
|
-
"A",
|
1167
1144
|
"a",
|
1168
1145
|
")",
|
1169
1146
|
",",
|
@@ -1198,7 +1175,6 @@ module RDF::Turtle::Meta
|
|
1198
1175
|
:PNAME_LN,
|
1199
1176
|
:PNAME_NS],
|
1200
1177
|
:iri => [
|
1201
|
-
"A",
|
1202
1178
|
"a",
|
1203
1179
|
:IRIREF,
|
1204
1180
|
:BLANK_NODE_LABEL,
|
@@ -1441,7 +1417,6 @@ module RDF::Turtle::Meta
|
|
1441
1417
|
:PNAME_LN,
|
1442
1418
|
:PNAME_NS],
|
1443
1419
|
:subject => [
|
1444
|
-
"A",
|
1445
1420
|
"a",
|
1446
1421
|
:IRIREF,
|
1447
1422
|
:PNAME_LN,
|
data/lib/rdf/turtle/reader.rb
CHANGED
@@ -72,15 +72,16 @@ module RDF::Turtle
|
|
72
72
|
when 'A', 'a' then input[:resource] = RDF.type
|
73
73
|
when 'true', 'false' then input[:resource] = RDF::Literal::Boolean.new(token.value)
|
74
74
|
when '@base', '@prefix' then input[:lang] = token.value[1..-1]
|
75
|
+
when '.' then input[:terminated] = true
|
75
76
|
else input[:string] = token.value
|
76
77
|
end
|
77
78
|
end
|
78
79
|
|
79
80
|
terminal(:PREFIX, PREFIX) do |prod, token, input|
|
80
|
-
input[:string_value] = token.value
|
81
|
+
input[:string_value] = token.value
|
81
82
|
end
|
82
83
|
terminal(:BASE, BASE) do |prod, token, input|
|
83
|
-
input[:string_value] = token.value
|
84
|
+
input[:string_value] = token.value
|
84
85
|
end
|
85
86
|
|
86
87
|
terminal(:LANGTAG, LANGTAG) do |prod, token, input|
|
@@ -92,14 +93,32 @@ module RDF::Turtle
|
|
92
93
|
production(:prefixID) do |input, current, callback|
|
93
94
|
prefix = current[:prefix]
|
94
95
|
iri = current[:resource]
|
96
|
+
lexical = current[:string_value]
|
97
|
+
terminated = current[:terminated]
|
95
98
|
debug("prefixID") {"Defined prefix #{prefix.inspect} mapping to #{iri.inspect}"}
|
99
|
+
if lexical.start_with?('@') && lexical != '@prefix'
|
100
|
+
error(:prefixID, "should be downcased")
|
101
|
+
elsif lexical == '@prefix'
|
102
|
+
error(:prefixID, "directive not terminated") unless terminated
|
103
|
+
else
|
104
|
+
error(:prefixID, "directive should not be terminated") if terminated
|
105
|
+
end
|
96
106
|
prefix(prefix, iri)
|
97
107
|
end
|
98
108
|
|
99
109
|
# [5] base set base_uri
|
100
110
|
production(:base) do |input, current, callback|
|
101
111
|
iri = current[:resource]
|
112
|
+
lexical = current[:string_value]
|
113
|
+
terminated = current[:terminated]
|
102
114
|
debug("base") {"Defined base as #{iri}"}
|
115
|
+
if lexical.start_with?('@') && lexical != '@base'
|
116
|
+
error(:base, "should be downcased")
|
117
|
+
elsif lexical == '@base'
|
118
|
+
error(:base, "directive not terminated") unless terminated
|
119
|
+
else
|
120
|
+
error(:base, "directive should not be terminated") if terminated
|
121
|
+
end
|
103
122
|
options[:base_uri] = iri
|
104
123
|
end
|
105
124
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'rdf/turtle/terminals'
|
2
|
+
|
3
|
+
module RDF::Turtle
|
4
|
+
##
|
5
|
+
# Streaming writer interface
|
6
|
+
# @author [Gregg Kellogg](http://greggkellogg.net/)
|
7
|
+
module StreamingWriter
|
8
|
+
##
|
9
|
+
# Write out declarations
|
10
|
+
# @return [void] `self`
|
11
|
+
def stream_prologue
|
12
|
+
if @options[:standard_prefixes]
|
13
|
+
RDF::Vocabulary.each do |vocab|
|
14
|
+
pfx = vocab.__name__.to_s.split('::').last.downcase
|
15
|
+
prefix(pfx, vocab.to_uri)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
preprocess
|
19
|
+
start_document
|
20
|
+
@output.puts ""
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# Write out a statement, retaining current
|
26
|
+
# `subject` and `predicate` to create more compact output
|
27
|
+
# @return [void] `self`
|
28
|
+
def stream_statement(statement)
|
29
|
+
if statement.subject != @streaming_subject
|
30
|
+
@output.puts ' .' if @streaming_subject
|
31
|
+
@streaming_subject, @streaming_predicate = statement.subject, statement.predicate
|
32
|
+
@output.write "#{format_term(statement.subject)} "
|
33
|
+
@output.write "#{format_term(statement.predicate)} "
|
34
|
+
elsif statement.predicate != @streaming_predicate
|
35
|
+
@streaming_predicate = statement.predicate
|
36
|
+
@output.write ";\n#{indent(1)}#{format_term(statement.predicate)} "
|
37
|
+
else
|
38
|
+
@output.write ",\n#{indent(2)}"
|
39
|
+
end
|
40
|
+
@output.write("#{format_term(statement.object)}")
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Complete open statements
|
45
|
+
# @return [void] `self`
|
46
|
+
def stream_epilogue
|
47
|
+
@output.puts ' .' if @streaming_subject
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
end
|
52
|
+
end
|
data/lib/rdf/turtle/writer.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'rdf/turtle/terminals'
|
2
|
+
require 'rdf/turtle/streaming_writer'
|
2
3
|
|
3
4
|
module RDF::Turtle
|
4
5
|
##
|
@@ -34,6 +35,13 @@ module RDF::Turtle
|
|
34
35
|
# end
|
35
36
|
# end
|
36
37
|
#
|
38
|
+
# @example Serializing RDF statements to a string in streaming mode
|
39
|
+
# RDF::Turtle::Writer.buffer(:stream => true) do |writer|
|
40
|
+
# graph.each_statement do |statement|
|
41
|
+
# writer << statement
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
#
|
37
45
|
# The writer will add prefix definitions, and use them for creating @prefix definitions, and minting QNames
|
38
46
|
#
|
39
47
|
# @example Creating @base and @prefix definitions in output
|
@@ -48,12 +56,11 @@ module RDF::Turtle
|
|
48
56
|
#
|
49
57
|
# @author [Gregg Kellogg](http://greggkellogg.net/)
|
50
58
|
class Writer < RDF::Writer
|
59
|
+
include StreamingWriter
|
51
60
|
format RDF::Turtle::Format
|
52
61
|
|
53
62
|
# @return [Graph] Graph of statements serialized
|
54
63
|
attr_accessor :graph
|
55
|
-
# @return [URI] Base URI used for relativizing URIs
|
56
|
-
attr_accessor :base_uri
|
57
64
|
|
58
65
|
##
|
59
66
|
# Initializes the Turtle writer instance.
|
@@ -74,6 +81,8 @@ module RDF::Turtle
|
|
74
81
|
# Maximum depth for recursively defining resources, defaults to 3
|
75
82
|
# @option options [Boolean] :standard_prefixes (false)
|
76
83
|
# Add standard prefixes to @prefixes, if necessary.
|
84
|
+
# @option options [Boolean] :stream (false)
|
85
|
+
# Do not attempt to optimize graph presentation, suitable for streaming large graphs.
|
77
86
|
# @option options [String] :default_namespace (nil)
|
78
87
|
# URI to use as default namespace, same as `prefixes[nil]`
|
79
88
|
# @yield [writer] `self`
|
@@ -82,10 +91,11 @@ module RDF::Turtle
|
|
82
91
|
# @yield [writer]
|
83
92
|
# @yieldparam [RDF::Writer] writer
|
84
93
|
def initialize(output = $stdout, options = {}, &block)
|
94
|
+
reset
|
95
|
+
@graph = RDF::Graph.new
|
96
|
+
@uri_to_pname = {}
|
97
|
+
@uri_to_prefix = {}
|
85
98
|
super do
|
86
|
-
@graph = RDF::Graph.new
|
87
|
-
@uri_to_pname = {}
|
88
|
-
@uri_to_prefix = {}
|
89
99
|
if block_given?
|
90
100
|
case block.arity
|
91
101
|
when 0 then instance_eval(&block)
|
@@ -95,21 +105,18 @@ module RDF::Turtle
|
|
95
105
|
end
|
96
106
|
end
|
97
107
|
|
98
|
-
##
|
99
|
-
# Write whole graph
|
100
|
-
#
|
101
|
-
# @param [Graph] graph
|
102
|
-
# @return [void]
|
103
|
-
def write_graph(graph)
|
104
|
-
@graph = graph
|
105
|
-
end
|
106
|
-
|
107
108
|
##
|
108
109
|
# Adds a statement to be serialized
|
109
110
|
# @param [RDF::Statement] statement
|
110
111
|
# @return [void]
|
111
112
|
def write_statement(statement)
|
112
|
-
|
113
|
+
case
|
114
|
+
when @options[:stream]
|
115
|
+
stream_statement(statement)
|
116
|
+
else
|
117
|
+
# Add to local graph and output in epilogue
|
118
|
+
@graph.insert(statement)
|
119
|
+
end
|
113
120
|
end
|
114
121
|
|
115
122
|
##
|
@@ -118,10 +125,19 @@ module RDF::Turtle
|
|
118
125
|
# @param [RDF::URI] predicate
|
119
126
|
# @param [RDF::Value] object
|
120
127
|
# @return [void]
|
121
|
-
# @raise [NotImplementedError] unless implemented in subclass
|
122
|
-
# @abstract
|
123
128
|
def write_triple(subject, predicate, object)
|
124
|
-
|
129
|
+
write_statement(Statement.new(subject, predicate, object))
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Write out declarations
|
134
|
+
# @return [void] `self`
|
135
|
+
def write_prologue
|
136
|
+
case
|
137
|
+
when @options[:stream]
|
138
|
+
stream_prologue
|
139
|
+
else
|
140
|
+
end
|
125
141
|
end
|
126
142
|
|
127
143
|
##
|
@@ -130,19 +146,23 @@ module RDF::Turtle
|
|
130
146
|
# @return [void]
|
131
147
|
# @see #write_triple
|
132
148
|
def write_epilogue
|
133
|
-
|
134
|
-
|
149
|
+
case
|
150
|
+
when @options[:stream]
|
151
|
+
stream_epilogue
|
152
|
+
else
|
153
|
+
@max_depth = @options[:max_depth] || 3
|
135
154
|
|
136
|
-
|
155
|
+
self.reset
|
137
156
|
|
138
|
-
|
157
|
+
debug("\nserialize") {"graph: #{@graph.size}"}
|
139
158
|
|
140
|
-
|
141
|
-
|
159
|
+
preprocess
|
160
|
+
start_document
|
142
161
|
|
143
|
-
|
144
|
-
|
145
|
-
|
162
|
+
order_subjects.each do |subject|
|
163
|
+
unless is_done?(subject)
|
164
|
+
statement(subject)
|
165
|
+
end
|
146
166
|
end
|
147
167
|
end
|
148
168
|
end
|
@@ -300,8 +320,8 @@ module RDF::Turtle
|
|
300
320
|
|
301
321
|
# Start with base_uri
|
302
322
|
if base_uri && @subjects.keys.include?(base_uri)
|
303
|
-
subjects << base_uri
|
304
|
-
seen[base_uri] = true
|
323
|
+
subjects << RDF::URI(base_uri)
|
324
|
+
seen[RDF::URI(base_uri)] = true
|
305
325
|
end
|
306
326
|
|
307
327
|
# Add distinguished classes
|
@@ -328,11 +348,16 @@ module RDF::Turtle
|
|
328
348
|
(@options[:prefixes] || {}).each_pair do |k, v|
|
329
349
|
@uri_to_prefix[v.to_s] = k
|
330
350
|
end
|
331
|
-
@options[:prefixes] = {} # Will define actual used when matched
|
332
351
|
|
333
352
|
prefix(nil, @options[:default_namespace]) if @options[:default_namespace]
|
334
353
|
|
335
|
-
|
354
|
+
case
|
355
|
+
when @options[:stream]
|
356
|
+
else
|
357
|
+
@options[:prefixes] = {} # Will define actual used when matched
|
358
|
+
|
359
|
+
@graph.each {|statement| preprocess_statement(statement)}
|
360
|
+
end
|
336
361
|
end
|
337
362
|
|
338
363
|
# Perform any statement preprocessing required. This is used to perform reference counts and determine required
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-turtle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.0p3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/rdf/turtle/freebase_reader.rb
|
152
152
|
- lib/rdf/turtle/meta.rb
|
153
153
|
- lib/rdf/turtle/reader.rb
|
154
|
+
- lib/rdf/turtle/streaming_writer.rb
|
154
155
|
- lib/rdf/turtle/terminals.rb
|
155
156
|
- lib/rdf/turtle/version.rb
|
156
157
|
- lib/rdf/turtle/writer.rb
|
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
176
|
version: 1.3.1
|
176
177
|
requirements: []
|
177
178
|
rubyforge_project: rdf-turtle
|
178
|
-
rubygems_version: 2.0.
|
179
|
+
rubygems_version: 2.0.5
|
179
180
|
signing_key:
|
180
181
|
specification_version: 4
|
181
182
|
summary: Turtle reader/writer for Ruby.
|