diff options
Diffstat (limited to 'lib/4store.rb')
-rw-r--r-- | lib/4store.rb | 10 |
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 |