lib/activerdf_sparql-1.3.6/lib/activerdf_sparql/sparql_sesame_api.rb
def query(query, &block)
    puts "Quering .. #{@title} "
    qs = Query2SPARQL.translate(query)

    if !(@title.include?'INTERNAL' and qs.to_s.include? "http://www.tecweb.inf.puc-rio.br")
      if @caching
        if is_into_cache(qs)
          $activerdflog.debug "cache hit for query #{qs}"
          return  query_cache(qs)
        end
      end
    end

    result = execute_sparql_query(qs, &block)
    #   puts result
    add_to_cache(qs, result) if @caching
    result = [] if result == "timeout"
    puts @title
    puts qs.to_s
    return result
  end
# query datastore with query string (SPARQL), returns array with query results
# may be called with a block
query datastore with query string (SPARQL), returns array with query results
may be called with a block
query datastore with query string ( SPARQL ) returns array with query results may be called with a block
def query(query, &block)
    puts "Quering .. #{@title} "
    qs = Query2SPARQL.translate(query)
    if !(@title.include?'INTERNAL' and qs.to_s.include? "http://www.tecweb.inf.puc-rio.br")
      if @caching
        if is_into_cache(qs)
          $activerdflog.debug "cache hit for query #{qs}"
          return  query_cache(qs)
        end
      end
    end
    result = execute_sparql_query(qs, &block)
    add_to_cache(qs, result) if @caching
    result = [] if result == "timeout"
    puts @title
    puts qs.to_s
    return result
  end
def query ( query , & block ) puts "Quering .. #{@title} " qs = Query2SPARQL . translate ( query ) if ! ( @title . include? 'INTERNAL' and qs . to_s . include? "http://www.tecweb.inf.puc-rio.br" ) if @caching if is_into_cache ( qs ) $activerdflog . debug "cache hit for query #{qs}" return query_cache ( qs ) end end end result = execute_sparql_query ( qs , & block ) add_to_cache ( qs , result ) if @caching result = [ ] if result == "timeout" puts @title puts qs . to_s return result end
query datastore with query string (SPARQL), returns array with query results
may be called with a block
query datastore with query string ( SPARQL ) returns array with query results may be called with a block
#   puts result
query
block