rdf-n3 1.1.0.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/rdf/n3/writer.rb +9 -8
  4. metadata +62 -56
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bde49398d0b9fdf810f8a1bbadb05a3445866fb
4
- data.tar.gz: 9500aab28d6873b4653ce5d945bbcdeac963d5dc
3
+ metadata.gz: 995b8be3bfe211680ed83a57b52cae6d6e11b4f5
4
+ data.tar.gz: b40ed881bbd1645be390be541ae7422a64db3145
5
5
  SHA512:
6
- metadata.gz: d7a3e5bef3cfaa6c2bcaf818345a98a8fb73e76dd45d25e25ed07558b13615e70ef997ece4e3119dd62a3249b630abf936a1b31b40e77f019ba716ce8466e10c
7
- data.tar.gz: 12fb0eba083f823772410ddc07cd8bbf39fbc245ba58db9636bf8811c4529c7f3a5201574f25bc6af6b6caf0b11c4f6785e2e26f5ad106e4e9bbddf0856c54b4
6
+ metadata.gz: b8494636f459a20bfbd829d0eb1e35f2717814cab326a0cf904ccdaab0797ccc6af75c88d3c9b3262d656b3a6eacf028b2e9bae9093a983ac610ed774d72e6ad
7
+ data.tar.gz: 98e6b501afcc1ea8d8101f3bce9646fbef7f55a67a25d257242e7883a6f31821bad9671771634c666f187fc87dfc98e2fa8a5fb0911e232e0eb3fbd8e354029b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0.1
1
+ 1.1.1
@@ -78,6 +78,8 @@ module RDF::N3
78
78
  # Add standard prefixes to @prefixes, if necessary.
79
79
  # @option options [String] :default_namespace (nil)
80
80
  # URI to use as default namespace, same as prefixes[nil]
81
+ # @option options [Boolean] :unique_bnodes (false)
82
+ # Use unique node identifiers, defaults to using the identifier which the node was originall initialized with (if any).
81
83
  # @yield [writer] `self`
82
84
  # @yieldparam [RDF::Writer] writer
83
85
  # @yieldreturn [void]
@@ -156,7 +158,7 @@ module RDF::N3
156
158
  def get_qname(resource)
157
159
  case resource
158
160
  when RDF::Node
159
- return resource.to_s
161
+ return options[:unique_bnodes] ? resource.to_unique_base : resource.to_base
160
162
  when RDF::URI
161
163
  uri = resource.to_s
162
164
  else
@@ -261,7 +263,7 @@ module RDF::N3
261
263
  # @param [Hash{Symbol => Object}] options
262
264
  # @return [String]
263
265
  def format_node(node, options = {})
264
- "_:%s" % node.id
266
+ options[:unique_bnodes] ? node.to_unique_base : node.to_base
265
267
  end
266
268
 
267
269
  protected
@@ -322,7 +324,7 @@ module RDF::N3
322
324
  # Sort subjects by resources over bnodes, ref_counts and the subject URI itself
323
325
  recursable = @subjects.keys.
324
326
  select {|s| !seen.include?(s)}.
325
- map {|r| [r.is_a?(RDF::Node) ? 1 : 0, ref_count(r), r]}.
327
+ map {|r| [r.node? ? 1 : 0, ref_count(r), r]}.
326
328
  sort
327
329
 
328
330
  add_debug {"subjects3: #{subjects.inspect}"}
@@ -445,7 +447,7 @@ module RDF::N3
445
447
  end
446
448
 
447
449
  def p_squared?(node, position)
448
- node.is_a?(RDF::Node) &&
450
+ node.node? &&
449
451
  !@serialized.has_key?(node) &&
450
452
  ref_count(node) <= 1
451
453
  end
@@ -466,7 +468,7 @@ module RDF::N3
466
468
 
467
469
  def p_default(node, position)
468
470
  #add_debug {"p_default: #{node.inspect}, #{position}"}
469
- l = (position == :subject ? "" : " ") + format_value(node)
471
+ l = (position == :subject ? "" : " ") + format_value(node, options)
470
472
  @output.write(l)
471
473
  end
472
474
 
@@ -514,8 +516,7 @@ module RDF::N3
514
516
  prop_list.each_with_index do |prop, i|
515
517
  begin
516
518
  @output.write(";\n#{indent(2)}") if i > 0
517
- prop[0, 2] == "_:"
518
- verb(prop[0, 2] == "_:" ? RDF::Node.new(prop.split(':').last) : RDF::URI.intern(prop))
519
+ verb(prop[0, 2] == "_:" ? RDF::Node.intern(prop.split(':').last) : RDF::URI.intern(prop))
519
520
  object_list(properties[prop])
520
521
  rescue Addressable::URI::InvalidURIError => e
521
522
  add_debug {"Predicate #{prop.inspect} is an invalid URI: #{e.message}"}
@@ -524,7 +525,7 @@ module RDF::N3
524
525
  end
525
526
 
526
527
  def s_squared?(subject)
527
- ref_count(subject) == 0 && subject.is_a?(RDF::Node) && !is_valid_list(subject)
528
+ ref_count(subject) == 0 && subject.node? && !is_valid_list(subject)
528
529
  end
529
530
 
530
531
  def s_squared(subject)
metadata CHANGED
@@ -1,134 +1,140 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-n3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg
8
8
  - Kellogg
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-23 00:00:00.000000000 Z
12
+ date: 2014-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
16
- version_requirements: !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.1'
21
- requirement: !ruby/object:Gem::Requirement
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.1.4
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
22
27
  requirements:
23
- - - ~>
28
+ - - "~>"
24
29
  - !ruby/object:Gem::Version
25
30
  version: '1.1'
26
- prerelease: false
27
- type: :runtime
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.4
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: open-uri-cached
30
- version_requirements: !ruby/object:Gem::Requirement
36
+ requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
- - - ~>
38
+ - - "~>"
33
39
  - !ruby/object:Gem::Version
34
40
  version: '0.0'
35
- - - '>='
41
+ - - ">="
36
42
  - !ruby/object:Gem::Version
37
43
  version: 0.0.5
38
- requirement: !ruby/object:Gem::Requirement
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
39
47
  requirements:
40
- - - ~>
48
+ - - "~>"
41
49
  - !ruby/object:Gem::Version
42
50
  version: '0.0'
43
- - - '>='
51
+ - - ">="
44
52
  - !ruby/object:Gem::Version
45
53
  version: 0.0.5
46
- prerelease: false
47
- type: :development
48
54
  - !ruby/object:Gem::Dependency
49
55
  name: json-ld
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.1'
55
56
  requirement: !ruby/object:Gem::Requirement
56
57
  requirements:
57
- - - ~>
58
+ - - "~>"
58
59
  - !ruby/object:Gem::Version
59
60
  version: '1.1'
60
- prerelease: false
61
61
  type: :development
62
- - !ruby/object:Gem::Dependency
63
- name: rspec
62
+ prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
- - - ~>
65
+ - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '2.14'
67
+ version: '1.1'
68
+ - !ruby/object:Gem::Dependency
69
+ name: rspec
69
70
  requirement: !ruby/object:Gem::Requirement
70
71
  requirements:
71
- - - ~>
72
+ - - "~>"
72
73
  - !ruby/object:Gem::Version
73
74
  version: '2.14'
74
- prerelease: false
75
75
  type: :development
76
- - !ruby/object:Gem::Dependency
77
- name: rdf-spec
76
+ prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - ~>
79
+ - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '1.1'
81
+ version: '2.14'
82
+ - !ruby/object:Gem::Dependency
83
+ name: rdf-spec
83
84
  requirement: !ruby/object:Gem::Requirement
84
85
  requirements:
85
- - - ~>
86
+ - - "~>"
86
87
  - !ruby/object:Gem::Version
87
88
  version: '1.1'
88
- prerelease: false
89
89
  type: :development
90
- - !ruby/object:Gem::Dependency
91
- name: rdf-rdfxml
90
+ prerelease: false
92
91
  version_requirements: !ruby/object:Gem::Requirement
93
92
  requirements:
94
- - - ~>
93
+ - - "~>"
95
94
  - !ruby/object:Gem::Version
96
95
  version: '1.1'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rdf-rdfxml
97
98
  requirement: !ruby/object:Gem::Requirement
98
99
  requirements:
99
- - - ~>
100
+ - - "~>"
100
101
  - !ruby/object:Gem::Version
101
102
  version: '1.1'
102
- prerelease: false
103
103
  type: :development
104
- - !ruby/object:Gem::Dependency
105
- name: rdf-isomorphic
104
+ prerelease: false
106
105
  version_requirements: !ruby/object:Gem::Requirement
107
106
  requirements:
108
- - - ~>
107
+ - - "~>"
109
108
  - !ruby/object:Gem::Version
110
109
  version: '1.1'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rdf-isomorphic
111
112
  requirement: !ruby/object:Gem::Requirement
112
113
  requirements:
113
- - - ~>
114
+ - - "~>"
114
115
  - !ruby/object:Gem::Version
115
116
  version: '1.1'
116
- prerelease: false
117
117
  type: :development
118
- - !ruby/object:Gem::Dependency
119
- name: yard
118
+ prerelease: false
120
119
  version_requirements: !ruby/object:Gem::Requirement
121
120
  requirements:
122
- - - ~>
121
+ - - "~>"
123
122
  - !ruby/object:Gem::Version
124
- version: '0.8'
123
+ version: '1.1'
124
+ - !ruby/object:Gem::Dependency
125
+ name: yard
125
126
  requirement: !ruby/object:Gem::Requirement
126
127
  requirements:
127
- - - ~>
128
+ - - "~>"
128
129
  - !ruby/object:Gem::Version
129
130
  version: '0.8'
130
- prerelease: false
131
131
  type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '0.8'
132
138
  description: RDF::N3 is an Notation-3 reader/writer for the RDF.rb library suite.
133
139
  email: public-rdf-ruby@w3.org
134
140
  executables: []
@@ -154,24 +160,24 @@ homepage: http://ruby-rdf.github.com/rdf-n3
154
160
  licenses:
155
161
  - Public Domain
156
162
  metadata: {}
157
- post_install_message:
163
+ post_install_message:
158
164
  rdoc_options: []
159
165
  require_paths:
160
166
  - lib
161
167
  required_ruby_version: !ruby/object:Gem::Requirement
162
168
  requirements:
163
- - - '>='
169
+ - - ">="
164
170
  - !ruby/object:Gem::Version
165
171
  version: 1.9.2
166
172
  required_rubygems_version: !ruby/object:Gem::Requirement
167
173
  requirements:
168
- - - '>='
174
+ - - ">="
169
175
  - !ruby/object:Gem::Version
170
176
  version: '0'
171
177
  requirements: []
172
178
  rubyforge_project: rdf-n3
173
179
  rubygems_version: 2.2.2
174
- signing_key:
180
+ signing_key:
175
181
  specification_version: 4
176
182
  summary: Notation3 reader/writer for RDF.rb.
177
183
  test_files: []