sxp 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sxp/reader/sparql.rb +8 -6
- data/lib/sxp/version.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/lib/sxp/reader/sparql.rb
CHANGED
@@ -10,8 +10,8 @@ module SXP; class Reader
|
|
10
10
|
class SPARQL < Extended
|
11
11
|
BNODE_ID = /^_:([A-Za-z][A-Za-z0-9]*)/.freeze # FIXME
|
12
12
|
BNODE_NEW = /^_:$/.freeze
|
13
|
-
VARIABLE
|
14
|
-
URIREF
|
13
|
+
VARIABLE = /^\?([A-Za-z][A-Za-z0-9]*)/.freeze # FIXME
|
14
|
+
URIREF = /^<([^>]+)>/.freeze
|
15
15
|
|
16
16
|
##
|
17
17
|
# @return [Object]
|
@@ -36,7 +36,7 @@ module SXP; class Reader
|
|
36
36
|
{:datatype => read_rdf_uri} # TODO: support prefixed names
|
37
37
|
else {}
|
38
38
|
end
|
39
|
-
RDF::Literal
|
39
|
+
RDF::Literal(value, options)
|
40
40
|
end
|
41
41
|
|
42
42
|
##
|
@@ -44,11 +44,12 @@ module SXP; class Reader
|
|
44
44
|
def read_rdf_uri
|
45
45
|
buffer = String.new
|
46
46
|
skip_char # '<'
|
47
|
+
return :< if (char = peek_char).nil? || char !~ ATOM # FIXME: nasty special case for '< symbol
|
47
48
|
until peek_char == ?>
|
48
49
|
buffer << read_char # TODO: unescaping
|
49
50
|
end
|
50
51
|
skip_char # '>'
|
51
|
-
RDF::URI
|
52
|
+
RDF::URI(buffer)
|
52
53
|
end
|
53
54
|
|
54
55
|
##
|
@@ -56,8 +57,9 @@ module SXP; class Reader
|
|
56
57
|
def read_atom
|
57
58
|
case buffer = read_literal
|
58
59
|
when '.' then buffer.to_sym
|
59
|
-
when
|
60
|
-
when
|
60
|
+
when DECIMAL then RDF::Literal(Float(buffer))
|
61
|
+
when INTEGER then RDF::Literal(Integer(buffer))
|
62
|
+
when BNODE_ID then RDF::Node($1)
|
61
63
|
when BNODE_NEW then RDF::Node.new
|
62
64
|
when VARIABLE then RDF::Query::Variable.new($1)
|
63
65
|
else buffer.to_sym
|
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
|
+
- 7
|
9
|
+
version: 0.0.7
|
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-10-21 00:00:00 +02:00
|
18
18
|
default_executable: sxp2rdf
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|