Sha256: 6646229890ec5f1633e281e44116a7945cca46ce95a1c7d2edca6b7bd7f350c9
Contents?: true
Size: 805 Bytes
Versions: 20
Compression:
Stored size: 805 Bytes
Contents
require 'active_rdf' # Translates abstract query into jars2 query. # (ignores ASK queries) class Query2Jars2 def self.translate(query) str = "" if query.select? # concatenate each where clause using space: s p o # and then concatenate the clauses using dot: s p o . s2 p2 o2 . str << "#{query.where_clauses.collect{|w| w.collect{|w| '?'+w.to_s}.join(' ')}.join(" .\n")} ." # TODO: should we maybe reverse the order on the where_clauses? it depends # on Andreas' answer of the best order to give to jars2. Users would # probably put the most specific stuff first, and join to get the # interesting information. Maybe we should not touch it and let the user # figure it out. end $activerdflog.debug "Query2Jars2: translated #{query} to #{str}" return str end end
Version data entries
20 entries across 20 versions & 1 rubygems