Permalink
Browse files

Given the appropriate version of SXP, use SXP::Generator to output SSE.

  • Loading branch information...
1 parent 6f3d4dc commit fd3f1aac8b5e2ce3c96263d4095440916885abc8 @gkellogg gkellogg committed Jul 5, 2012
Showing with 41 additions and 24 deletions.
  1. +2 −2 .gemspec
  2. +1 −0 Gemfile
  3. +30 −20 Gemfile.lock
  4. +1 −1 bin/sparql
  5. +7 −1 lib/sparql/algebra/extensions.rb
View
@@ -50,9 +50,9 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'open-uri-cached', '>= 0.0.4'
gem.add_development_dependency 'equivalent-xml', '>= 0.2.8' if RUBY_ENGINE == "ruby"
gem.add_development_dependency 'nokogiri' , '>= 1.5.0' if RUBY_ENGINE == "ruby"
- gem.add_development_dependency 'rspec', '>= 2.8.0'
+ gem.add_development_dependency 'rspec', '>= 2.10.0'
gem.add_development_dependency 'spira', '>= 0.0.12'
- gem.add_development_dependency 'yard' , '>= 0.7.5'
+ gem.add_development_dependency 'yard' , '>= 0.8.2'
gem.add_runtime_dependency 'backports' if RUBY_VERSION < "1.9"
gem.post_install_message = nil
end
View
@@ -1,6 +1,7 @@
source "http://rubygems.org"
gemspec :name => ""
+gem 'sxp', :git => "git://github.com/gkellogg/sxp-ruby.git", :branch => "gkellogg-master"
group :development do
gem 'shotgun'
View
@@ -1,3 +1,11 @@
+GIT
+ remote: git://github.com/gkellogg/sxp-ruby.git
+ revision: 8458dbf53a84612579bee9f435415e6ec0ef1694
+ branch: gkellogg-master
+ specs:
+ sxp (0.1.0)
+ json (>= 1.5.1)
+
PATH
remote: .
specs:
@@ -13,15 +21,17 @@ GEM
remote: http://rubygems.org/
specs:
addressable (2.2.8)
+ backports (2.6.1)
builder (3.0.0)
diff-lcs (1.1.3)
equivalent-xml (0.2.9)
nokogiri (>= 1.4.3)
- haml (3.1.5)
+ haml (3.1.6)
htmlentities (4.3.1)
json (1.7.3)
json (1.7.3-java)
- json-ld (0.1.2)
+ json-ld (0.1.4)
+ backports
json (>= 1.6.5)
rdf (>= 0.3.5)
json_pure (1.7.3)
@@ -37,17 +47,17 @@ GEM
rdf-trig (>= 0.1.1)
rdf-trix (>= 0.3.0)
rdf-turtle (>= 0.1.1)
- net-http-persistent (1.4.1)
- nokogiri (1.5.2)
- nokogiri (1.5.2-java)
+ net-http-persistent (2.7)
+ nokogiri (1.5.5)
+ nokogiri (1.5.5-java)
open-uri-cached (0.0.5)
promise (0.3.0)
rack (1.4.1)
rack-protection (1.2.0)
rack
rack-test (0.6.1)
rack (>= 1.0)
- rdf (0.3.5.2)
+ rdf (0.3.7)
addressable (>= 2.2.6)
rdf-isomorphic (0.3.4)
rdf (>= 0.2.3)
@@ -61,12 +71,12 @@ GEM
rdf-xsd (>= 0.3.4)
rdf-n3 (0.3.7)
rdf (>= 0.3.4)
- rdf-rdfa (0.3.12)
- haml (>= 3.0.0)
+ rdf-rdfa (0.3.14)
+ haml (>= 3.1.6)
htmlentities (>= 4.3.0)
- rdf (>= 0.3.3)
- rdf-xsd (>= 0.3.5)
- rdf-rdfxml (0.3.7)
+ rdf (>= 0.3.5)
+ rdf-xsd (>= 0.3.7)
+ rdf-rdfxml (0.3.8)
rdf (>= 0.3.4)
rdf-xsd (>= 0.3.5)
rdf-spec (0.3.5.1)
@@ -78,14 +88,15 @@ GEM
rdf (~> 0.3.0)
rdf-turtle (0.1.2)
rdf (>= 0.3.4)
- rdf-xsd (0.3.6)
+ rdf-xsd (0.3.7)
+ backports
nokogiri (>= 1.5.0)
rdf (>= 0.3.4)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
rspec-mocks (~> 2.10.0)
- rspec-core (2.10.0)
+ rspec-core (2.10.1)
rspec-expectations (2.10.0)
diff-lcs (~> 1.1.3)
rspec-mocks (2.10.1)
@@ -95,19 +106,17 @@ GEM
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
- sparql-client (0.1.0)
+ sparql-client (0.1.1.1)
json_pure (>= 1.6.5)
- net-http-persistent (~> 1.4.1)
+ net-http-persistent (>= 1.4.1)
rdf (>= 0.3.5)
spira (0.0.12)
promise (>= 0.3.0)
rdf (>= 0.2.3)
rdf-isomorphic (>= 0.3.0)
- sxp (0.0.14)
- json (>= 1.5.1)
tilt (1.3.3)
wirble (0.1.3)
- yard (0.8.1)
+ yard (0.8.2.1)
PLATFORMS
java
@@ -121,10 +130,11 @@ DEPENDENCIES
rack (>= 1.4.1)
rack-test (>= 0.6.1)
rdf-spec (>= 0.3.5)
- rspec (>= 2.8.0)
+ rspec (>= 2.10.0)
shotgun
sinatra (>= 1.3.2)
sparql!
spira (>= 0.0.12)
+ sxp!
wirble
- yard (>= 0.7.5)
+ yard (>= 0.8.2)
View
@@ -24,7 +24,7 @@ def run(input, options = {})
SPARQL::Algebra.parse(input, {:debug => options[:debug]})
else
# Only do grammar debugging if we're generating SSE
- SPARQL::Grammar.parse(input, options.merge(:debug => options.has_key?(:to_sse)))
+ SPARQL::Grammar.parse(input, options)
end
puts ("\nSSE:\n" + query.to_sse) if options[:debug] || options[:to_sse]
@@ -13,8 +13,14 @@ def to_sxp_bin
##
# Make sure the object is in SXP form and transform it to a string form
+ # @return String
def to_sse
- self.to_sxp_bin.to_sxp
+ if SXP::VERSION::MAJOR.to_i >= 1 || SXP::VERSION::MINOR.to_i >= 1
+ # FIXME: Right now, this depends on un-merged request, so requires bundler to work
+ SXP::Generator.write(STDOUT, self.to_sxp_bin)
+ else
+ self.to_sxp_bin.to_sxp
+ end
end
end

0 comments on commit fd3f1aa

Please sign in to comment.