module Riddl::Utils::Turtle

Public Class Methods

implementation(tf) click to toggle source
# File lib/ruby/riddl/utils/turtle.rb, line 21
def self::implementation(tf)
  Proc.new do
    if ::File.mtime(tf.url) > tf.changed
      tf.data = ""
      ::File.open(tf.url,"r") do |f|
        f.each_line do |line|
          tf.data += line
        end
      end
      tf.changed = ::File.mtime(tf.url)
    end
    run Show, tf.data, tf.changed if get
    run Query, tf.url if get 'query'
    on resource do
      run GetQuery, tf.url if get 
    end
  end
end