rdf-rdfxml 1.1.4 → 1.1.5

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/rdfxml/reader.rb +20 -12
  4. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f0332cc835b70ad36d5ee0e1eb355bade399237
4
- data.tar.gz: 288a1e274067f6d24accdef8dcf942a38e9a3577
3
+ metadata.gz: a90f0decb2d5769b68f23c4a19a731c33eda92bf
4
+ data.tar.gz: 7ac194df96fa5ec2908f42677ec65d30ad978833
5
5
  SHA512:
6
- metadata.gz: ff585ff8d1613982db5cbbe3f1440b513692ab8fbacbbf58360d80d6f56cb5bcef3b89319d8a3c646585aa2284d6d29be357e97e4cd0173424f7814f42e98e43
7
- data.tar.gz: 84711dfeb7846737eaafa9aca1acdf90cdf3e743ac1abb87049238818a0dfcfd9e5112aa75fa19ad313e5ac2b12984c346a07029362601c38eb3750e43618b7a
6
+ metadata.gz: c6795af0c35adb59c6b19e5a21fe62acaaaadd0090abf9e18c11fa9dd323aad186541832cd773827b029335028222e1b4cf8be38ad2779a608401272cde4c7a3
7
+ data.tar.gz: 729224eb90c7ba48fffa67738c060fd06f7f2acfd6816775dfa45ad8cab793883b199655a72ef79ad7a0c27607ad99ef9f23913063a4c5a4b5bf8c51f69120cc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.4
1
+ 1.1.5
@@ -64,10 +64,11 @@ module RDF::RDFXML
64
64
 
65
65
  # Extract Evaluation Context from an element
66
66
  def extract_from_element(el, &cb)
67
- b = el.base
68
- lang = el.language
69
- self.base = self.base.join(b) if b
70
- self.language = lang if lang
67
+ self.language = el.language if el.language
68
+ if b = el.base
69
+ b = RDF::URI(b)
70
+ self.base = b.absolute? ? b : self.base.join(b)
71
+ end
71
72
  self.uri_mappings.merge!(extract_mappings(el, &cb))
72
73
  end
73
74
 
@@ -302,7 +303,7 @@ module RDF::RDFXML
302
303
  # If there is an attribute a in propertyAttr with a.URI == rdf:type
303
304
  # then u:=uri(identifier:=resolve(a.string-value))
304
305
  # and the following triple is added to the graph:
305
- u = ec.base.join(attr.value)
306
+ u = uri(ec.base, attr.value)
306
307
  add_triple(attr, subject, RDF.type, u)
307
308
  elsif is_propertyAttr?(attr)
308
309
  # Attributes not RDF.type
@@ -530,12 +531,12 @@ module RDF::RDFXML
530
531
  # Reification
531
532
  reify(id, child, subject, predicate, literal, child_ec) if id
532
533
  else
533
- if resourceAttr
534
- resource = ec.base.join(resourceAttr)
534
+ resource = if resourceAttr
535
+ uri(ec.base, resourceAttr)
535
536
  elsif nodeID
536
- resource = bnode(nodeID)
537
+ bnode(nodeID)
537
538
  else
538
- resource = RDF::Node.new
539
+ RDF::Node.new
539
540
  end
540
541
 
541
542
  # produce triples for attributes
@@ -605,7 +606,7 @@ module RDF::RDFXML
605
606
  when about
606
607
  about = RDF::NTriples.unescape(about.value)
607
608
  add_debug(el) {"parse_subject, about: #{about.inspect}"}
608
- ec.base.join(about)
609
+ uri(ec.base, about)
609
610
  else
610
611
  add_debug(el, "parse_subject, BNode")
611
612
  RDF::Node.new
@@ -687,8 +688,15 @@ module RDF::RDFXML
687
688
  end
688
689
 
689
690
  def uri(value, append = nil)
690
- value = RDF::URI.new(value)
691
- value = value.join(append) if append
691
+ append = RDF::URI(append)
692
+ value = RDF::URI(value)
693
+ value = if append.absolute?
694
+ value = append
695
+ elsif append
696
+ value = value.join(append)
697
+ else
698
+ value
699
+ end
692
700
  value.validate! if validate?
693
701
  value.canonicalize! if canonicalize?
694
702
  value = RDF::URI.intern(value) if intern?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-rdfxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-02 00:00:00.000000000 Z
12
+ date: 2015-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -133,14 +133,14 @@ dependencies:
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '3.0'
136
+ version: '3.2'
137
137
  type: :development
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: '3.0'
143
+ version: '3.2'
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: rspec-its
146
146
  requirement: !ruby/object:Gem::Requirement
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  requirements: []
255
255
  rubyforge_project: rdf-rdfxml
256
- rubygems_version: 2.4.3
256
+ rubygems_version: 2.4.5.1
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: RDF/XML reader/writer for RDF.rb.