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