Sha256: 375574e21ac85fd8b7509fed9b17e90c54d64f58ab571dc4bf19e2a79590d26e

Contents?: true

Size: 1.84 KB

Versions: 16

Compression:

Stored size: 1.84 KB

Contents

RdfNamespacesHelper.instance_methods.each do |meth|
  namespaces = send(meth)
  document.namespaces(namespaces) if namespaces.is_a?(Hash)
end

document.namespaces(
  :search => url_for(request.query_parameters.merge(:page => @results && @results.current_page, :lang => nil, :only_path => false, :anchor => "")),
  :sdc => "http://sindice.com/vocab/search#"
)

document << IqRdf.build_full_uri_subject(URI.parse(url_for(request.query_parameters.merge(:page => nil, :lang => nil, :only_path => false))), IqRdf::Sdc::build_uri('Query')) do |query|
  query.Sdc::totalResults(@results.total_count)
  query.Sdc::itemsPerPage(@results.limit_value)
  query.Sdc::searchTerms(params[:query])
  query.Sdc::first(URI.parse(url_for(request.query_parameters.merge(:page => 1, :lang => nil, :only_path => false))))
  query.Sdc::last(URI.parse(url_for(request.query_parameters.merge(:page => @results.num_pages, :lang => nil, :only_path => false))))
  i = 0
  @results.each do
    query.Sdc::result(IqRdf::Search::build_uri("result#{i+=1}"))
  end
end

document << IqRdf.build_full_uri_subject(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page, :lang => nil, :only_path => false))), IqRdf::Sdc::build_uri('Page')) do |page|
  page.Sdc::startIndex((@results.current_page - 1) * @results.limit_value + 1)
  page.Sdc::previous(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page - 1, :lang => nil, :only_path => false)))) if @results.current_page > 1
  page.Sdc::next(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page + 1, :lang => nil, :only_path => false)))) if @results.current_page < @results.num_pages
end

i = 0
@results.each do |result|
  document << IqRdf::Search::build_uri("result#{i+=1}", IqRdf::Sdc::build_uri('Result')) do |result_node|
    result.build_search_result_rdf(document, result_node)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
iqvoc-4.12.1 app/views/search_results/index.iqrdf
iqvoc-4.12.0 app/views/search_results/index.iqrdf
iqvoc-4.11.1 app/views/search_results/index.iqrdf
iqvoc-4.11.0 app/views/search_results/index.iqrdf
iqvoc-4.10.0 app/views/search_results/index.iqrdf
iqvoc-4.9.0 app/views/search_results/index.iqrdf
iqvoc-4.8.2 app/views/search_results/index.iqrdf
iqvoc-4.8.1 app/views/search_results/index.iqrdf
iqvoc-4.8.0 app/views/search_results/index.iqrdf
iqvoc-4.7.0 app/views/search_results/index.iqrdf
iqvoc-4.6.1 app/views/search_results/index.iqrdf
iqvoc-4.5.2 app/views/search_results/index.iqrdf
iqvoc-4.6.0 app/views/search_results/index.iqrdf
iqvoc-4.5.1 app/views/search_results/index.iqrdf
iqvoc-4.5.0 app/views/search_results/index.iqrdf
iqvoc-4.4.0 app/views/search_results/index.iqrdf