app/models/trait_bank.rb
# Returns an Set (not an array!) of which uris DO exist.
Returns an Set (not an array!) of which uris DO exist.
Returns an Set ( not an array! ) of which uris DO exist .
def group_exists?(uris)
      exist = Set.new
      uris.to_a.in_groups_of(1000, false) do |group|
        begin
          resp = connection.query("SELECT DISTINCT(?s) { ?s ?o ?p . "\
            "FILTER ( ?s IN (<#{uris.join(">,<")}>) ) }")
          exist += resp.map { |u| u[:s].to_s }
        rescue EOL::Exceptions::SparqlDataEmpty => e
        end
      end
      exist
    end
def group_exists? ( uris ) exist = Set . new uris . to_a . in_groups_of ( 1000 , false ) do | group | begin resp = connection . query ( "SELECT DISTINCT(?s) { ?s ?o ?p . " "FILTER ( ?s IN (<#{uris.join(">,<")}>) ) }" ) exist += resp . map { | u | u [ :s ] . to_s } rescue EOL :: Exceptions :: SparqlDataEmpty => e end end exist end
Returns an Set (not an array!)
Returns an Set ( not an array! )
# Nothing to add.
uris
<not_specific>