rdf-trig 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7ce940c1194b8d974da285178e7ef433cfb03f0
4
- data.tar.gz: 3ff117c02554be9b45456e456c03982bf7ddd149
3
+ metadata.gz: b7b4720c71847712c74bec5ee24e11ac4e680865
4
+ data.tar.gz: f910a370ebbbd31303e83fe955141e8e010858af
5
5
  SHA512:
6
- metadata.gz: ae77f3090ab86e7f5ffad7aea1e383ebd04369a91214d874537ad55c73d294d6a61d00dd2f6c30450b92a31f0745541b94582ff341e100be4ac3a79b30014717
7
- data.tar.gz: afa52c8d340d799587baa864122a7b64fc28eff8d492f24439e9c3fdc4f522663587f697a27f09e896ff86e855c565d985a6ee0698a5177ee54848715cf1f7bd
6
+ metadata.gz: d7495a3be1df086ed1a442f5caf9385d0ba2f4d74b54252447cb7ab9a9ae5801d5593d3bbeacbe82b185c369bb7cb801fe88f1c799012c53b1ae31da67d9fc9d
7
+ data.tar.gz: 25374295795a6eebcb819e8b54593cf8d5b3ad42691ca2c585ebb3a413b6c1dcf7aa503fb6fe5528a1a55135c8a62de8125c045d25e4c5ac49c6cb0c1cf64b38
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -17,7 +17,8 @@ module RDF::TriG
17
17
  @output.write "#{format_term(statement.subject)} "
18
18
  @output.write "#{format_term(statement.predicate)} "
19
19
  elsif statement.subject != @streaming_subject
20
- @output.write " .\n#{indent(@streaming_subject ? 1 : 0)}"
20
+ @output.puts " ." if @previous_statement
21
+ @output.write "#{indent(@streaming_subject ? 1 : 0)}"
21
22
  @streaming_subject, @streaming_predicate = statement.subject, statement.predicate
22
23
  @output.write "#{format_term(statement.subject)} "
23
24
  @output.write "#{format_term(statement.predicate)} "
@@ -28,13 +29,18 @@ module RDF::TriG
28
29
  @output.write ",\n#{indent(@streaming_subject ? 3 : 2)}"
29
30
  end
30
31
  @output.write("#{format_term(statement.object)}")
32
+ @previous_statement = statement
31
33
  end
32
34
 
33
35
  ##
34
36
  # Complete open statements
35
37
  # @return [void] `self`
36
38
  def stream_epilogue
37
- @output.puts " }" if @streaming_context
39
+ case
40
+ when @previous_statement.nil? ;
41
+ when @streaming_context then @output.puts " }"
42
+ else @output.puts " ."
43
+ end
38
44
  end
39
45
 
40
46
  private
@@ -209,6 +209,23 @@ module RDF::TriG
209
209
  end
210
210
 
211
211
  protected
212
+
213
+ # Add additional constraint that the resource must be in a single context
214
+ def blankNodePropertyList?(subject)
215
+ super && resource_in_single_context?(subject)
216
+ end
217
+
218
+ # Add additional constraint that the resource must be in a single context
219
+ def p_squared?(resource, position)
220
+ super && resource_in_single_context?(resource)
221
+ end
222
+
223
+ def resource_in_single_context?(resource)
224
+ contexts = @repo.query(:subject => resource).map(&:context)
225
+ contexts += @repo.query(:object => resource).map(&:context)
226
+ contexts.length == 1
227
+ end
228
+
212
229
  # Order contexts for output
213
230
  def order_contexts
214
231
  debug("order_contexts") {@repo.contexts.to_a.inspect}
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: 1.1.1
4
+ version: 1.1.2
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-12-22 00:00:00.000000000 Z
11
+ date: 2013-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.7
19
+ version: 1.1.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.7
26
+ version: 1.1.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ebnf
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.9
47
+ version: 1.1.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.9
54
+ version: 1.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: open-uri-cached
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '>='
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '>='
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.1'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '>='
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: yard
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - '>='
130
130
  - !ruby/object:Gem::Version
131
- version: '1.0'
131
+ version: '1.1'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '>='
137
137
  - !ruby/object:Gem::Version
138
- version: '1.0'
138
+ version: '1.1'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rake
141
141
  requirement: !ruby/object:Gem::Requirement