lightrdf 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.2.1 2011-03-07
2
+
3
+ * Corrected bug when building a graph out of triples.
4
+
1
5
  === 0.2.0 2011-03-03
2
6
 
3
7
  * Instantiation of RDF data as Ruby objects (with methods and so on)
@@ -35,7 +35,7 @@ module RDF
35
35
  end
36
36
  def triples= triples
37
37
  self.clear
38
- triples.each { |s, p, o| self[s][p] += [o] }
38
+ triples.each { |s, p, o| self[s][p] += [o.is_a?(Symbol) ? Node(o) : o] }
39
39
  end
40
40
  def select &block
41
41
  values.select &block
data/lib/lightrdf.rb CHANGED
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module RDF
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
 
8
8
  require 'rubygems'
data/lightrdf.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{lightrdf}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jose Ignacio"]
9
- s.date = %q{2011-03-03}
9
+ s.date = %q{2011-03-07}
10
10
  s.default_executable = %q{yarfp}
11
11
  s.description = %q{RDF library}
12
12
  s.email = %q{joseignacio.fernandez@gmail.com}
@@ -90,6 +90,14 @@ class TestLightRDF < Test::Unit::TestCase
90
90
  assert a.foaf::weblog?(Node('http://www.awesomeweblogfordummies.com'))
91
91
  end
92
92
 
93
+ def test_triples
94
+ a = Node('ex:bob')
95
+ a.foaf::weblog = Node('http://www.awesomeweblogfordummies.com')
96
+ g = RDF::Graph.new a.triples
97
+ p a.foaf::weblog
98
+ assert g[Node('ex:bob')].foaf::weblog?(Node('http://www.awesomeweblogfordummies.com'))
99
+ end
100
+
93
101
  def test_graph_merge
94
102
  a = Node('ex:bob')
95
103
  a.foaf::name = "Bob"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jose Ignacio
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-03 00:00:00 +01:00
17
+ date: 2011-03-07 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency