summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-06-05 11:56:15 +0200
committergebele <gebele@in-silico.ch>2013-06-05 11:56:15 +0200
commitff7fb1ec3739903cb4229a30f175cab532225fae (patch)
treee1ef1d01d09d626934b93ecae65f08436411c71a
parent2fb52e758001899f83431960ab228ef013e36b2d (diff)
fixed dataset representation for html requests
-rw-r--r--lib/4store.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/4store.rb b/lib/4store.rb
index fddc785..578ce13 100644
--- a/lib/4store.rb
+++ b/lib/4store.rb
@@ -97,12 +97,12 @@ module OpenTox
prefixes = {:rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"}
['OT', 'DC', 'XSD', 'OLO'].each{|p| prefixes[p.downcase.to_sym] = eval("RDF::#{p}.to_s") }
# TODO: fails for large datasets?? multi_cell_call
- turtle = RDF::Turtle::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer|
- rdf.each{|statement| writer << statement}
+ turtle = RDF::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer|
+ writer << rdf
end
- regex = Regexp.new '(https?:\/\/[\S]+)([>"])'
- turtle = "<html><body>" + turtle.gsub( regex, '<a href="\1">\1</a>\2' ).gsub(/\n/,'<br/>') + "</body></html>" if mime_type =~ /html/ and !turtle.empty?
- turtle
+ #regex = Regexp.new '(https?:\/\/[\S]+)([>"])'
+ #turtle = "<html><body>" + turtle.gsub( regex, '<a href="\1">\1</a>\2' ).gsub(/\n/,'<br/>') + "</body></html>" if mime_type =~ /html/ and !turtle.empty?
+ turtle.to_html if mime_type =~ /html/ and !turtle.empty?
end
else
# TODO: check if this prevents SPARQL injections