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

Version Path
activerdf-1.3.1 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.2.1 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.2.2 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.1 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.2.3 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.2 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.11 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.2 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.4 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.5 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.6 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.8 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.3 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.3 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.4 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.5 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.1 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.10 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6.9 lib/active_rdf/queryengine/query2jars2.rb
activerdf-1.6 lib/active_rdf/queryengine/query2jars2.rb