scrappy 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.6 2010-12-09
2
+
3
+ * Added sc:superclass to sc:Fragments
4
+
1
5
  === 0.1.5 2010-11-29
2
6
 
3
7
  * Better map-reduce-based design
data/lib/scrappy.rb CHANGED
@@ -19,7 +19,7 @@ require 'scrappy/agent/agent'
19
19
  Namespace :sc, 'http://lab.gsi.dit.upm.es/scraping.rdf#'
20
20
 
21
21
  module Scrappy
22
- VERSION = '0.1.5'
22
+ VERSION = '0.1.6'
23
23
  end
24
24
 
25
25
  # Require selectors
@@ -41,7 +41,7 @@ module Scrappy
41
41
  nodes.each do |node|
42
42
  # Build the object
43
43
  object = if fragment.sc::type.first == Node('rdf:Literal')
44
- value = doc[:value].strip
44
+ value = doc[:value].to_s.strip
45
45
  if options[:referenceable]
46
46
  bnode = Node(nil)
47
47
  bnode.rdf::value = value
@@ -51,10 +51,11 @@ module Scrappy
51
51
  else
52
52
  value
53
53
  end
54
- elsif fragment.sc::type.first
55
- options[:triples] << [node, Node('rdf:type'), fragment.sc::type.first]
56
- node
57
54
  else
55
+ if fragment.sc::type.first and fragment.sc::type.first != Node('rdf:Resource')
56
+ options[:triples] << [node, Node('rdf:type'), fragment.sc::type.first]
57
+ end
58
+ fragment.sc::superclass.each { |superclass| options[:triples] << [node, Node('rdfs:subClassOf'), superclass] }
58
59
  node
59
60
  end
60
61
  fragment.sc::relation.each { |relation| options[:triples] << [options[:parent], relation, object] }
data/scrappy.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{scrappy}
5
- s.version = "0.1.5"
5
+ s.version = "0.1.6"
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{2010-11-29}
9
+ s.date = %q{2010-12-09}
10
10
  s.default_executable = %q{scrappy}
11
11
  s.description = %q{RDF web scraper}
12
12
  s.email = %q{joseignacio.fernandez@gmail.com}
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
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: 2010-11-29 00:00:00 +01:00
17
+ date: 2010-12-09 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency