Class: RDF::Query::Solution

Inherits:
Object
  • Object
show all
Defined in:
lib/rdf/n3/extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_sxp_binArray

Transform Statement into an SXP

Returns:

  • (Array)


173
174
175
176
177
178
179
180
# File 'lib/rdf/n3/extensions.rb', line 173

def to_sxp_bin
  [:solution] + bindings.map do |k, v|
    existential = k.to_s.end_with?('ext')
    k = k.to_s.sub(/_(?:und)?ext$/, '').to_sym
    distinguished = !k.to_s.end_with?('undext')
    Query::Variable.new(k, v, existential: existential, distinguished: distinguished).to_sxp_bin
  end
end