sxp 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CREDITS +0 -0
- data/VERSION +1 -1
- data/lib/sxp/reader/sparql.rb +4 -2
- data/lib/sxp/version.rb +1 -1
- metadata +4 -3
data/CREDITS
ADDED
File without changes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/lib/sxp/reader/sparql.rb
CHANGED
@@ -8,6 +8,8 @@ module SXP; class Reader
|
|
8
8
|
#
|
9
9
|
# @see http://openjena.org/wiki/SSE
|
10
10
|
class SPARQL < Extended
|
11
|
+
EXPONENT = /[eE][+-]?[0-9]+/
|
12
|
+
DECIMAL = /^[+-]?(\d*)?\.\d*#{EXPONENT}?$/
|
11
13
|
BNODE_ID = /^_:([A-Za-z][A-Za-z0-9]*)/ # FIXME
|
12
14
|
BNODE_NEW = /^_:$/
|
13
15
|
VAR_ID = /^\?([A-Za-z][A-Za-z0-9]*)/ # FIXME
|
@@ -47,7 +49,7 @@ module SXP; class Reader
|
|
47
49
|
buffer = String.new
|
48
50
|
skip_char # '<'
|
49
51
|
return :< if (char = peek_char).nil? || char.chr !~ ATOM # FIXME: nasty special case for the '< symbol
|
50
|
-
return :<= if peek_char.chr.eql?(
|
52
|
+
return :<= if peek_char.chr.eql?(?=.chr) && read_char # FIXME: nasty special case for the '<= symbol
|
51
53
|
until peek_char == ?>
|
52
54
|
buffer << read_char # TODO: unescaping
|
53
55
|
end
|
@@ -60,7 +62,7 @@ module SXP; class Reader
|
|
60
62
|
def read_atom
|
61
63
|
case buffer = read_literal
|
62
64
|
when '.' then buffer.to_sym
|
63
|
-
when DECIMAL then RDF::Literal(Float(buffer + '0'))
|
65
|
+
when DECIMAL then RDF::Literal(Float(buffer[-1].eql?(?.) ? buffer + '0' : buffer))
|
64
66
|
when INTEGER then RDF::Literal(Integer(buffer))
|
65
67
|
when BNODE_ID then RDF::Node($1)
|
66
68
|
when BNODE_NEW then RDF::Node.new
|
data/lib/sxp/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 11
|
9
|
+
version: 0.0.11
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Arto Bendiken
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-01 00:00:00 +01:00
|
18
18
|
default_executable: sxp2rdf
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -58,6 +58,7 @@ extra_rdoc_files: []
|
|
58
58
|
|
59
59
|
files:
|
60
60
|
- AUTHORS
|
61
|
+
- CREDITS
|
61
62
|
- README
|
62
63
|
- UNLICENSE
|
63
64
|
- VERSION
|