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 +4 -0
- data/lib/scrappy.rb +1 -1
- data/lib/scrappy/agent/extractor.rb +5 -4
- data/scrappy.gemspec +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/lib/scrappy.rb
CHANGED
@@ -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
|
+
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-
|
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
|
-
-
|
9
|
-
version: 0.1.
|
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-
|
17
|
+
date: 2010-12-09 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|