Sha256: 206b959c0da4bbc4c57030d0ae711e07a30f469d67c713e0696bd12be5ca401d

Contents?: true

Size: 857 Bytes

Versions: 20

Compression:

Stored size: 857 Bytes

Contents

module Krikri
  ##
  # Implements SPARQL queries for finding RDF Resources by their PROV-O history.
  module ProvenanceQueryClient
    SPARQL_CLIENT = Repository.query_client

    module_function

    ##
    # Finds all entities generated or revised by the activity whose URI is
    # given.
    #
    # @param activity_uri [#to_uri] the URI of the activity to search
    #
    # @return [RDF::SPARQL::Query] a query object that, when executed, will
    #   give solutions containing the URIs for the resources in `#record`.
    def find_by_activity(activity_uri)
      raise ArgumentError, 'activity_uri must be an RDF::URI' unless
        activity_uri.respond_to? :to_uri
      SPARQL_CLIENT.select(:record)
        .where([:record,
                [RDF::PROV.wasGeneratedBy, '|', RDF::DPLA.wasRevisedBy],
                activity_uri])
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
krikri-0.8.2 lib/krikri/provenance_query_client.rb
krikri-0.8.1 lib/krikri/provenance_query_client.rb
krikri-0.8.0 lib/krikri/provenance_query_client.rb
krikri-0.7.6 lib/krikri/provenance_query_client.rb
krikri-0.7.5 lib/krikri/provenance_query_client.rb
krikri-0.7.4 lib/krikri/provenance_query_client.rb
krikri-0.7.3 lib/krikri/provenance_query_client.rb
krikri-0.7.2 lib/krikri/provenance_query_client.rb
krikri-0.7.1 lib/krikri/provenance_query_client.rb
krikri-0.7.0 lib/krikri/provenance_query_client.rb
krikri-0.6.0 lib/krikri/provenance_query_client.rb
krikri-0.5.7 lib/krikri/provenance_query_client.rb
krikri-0.5.6 lib/krikri/provenance_query_client.rb
krikri-0.5.5 lib/krikri/provenance_query_client.rb
krikri-0.5.4 lib/krikri/provenance_query_client.rb
krikri-0.5.3 lib/krikri/provenance_query_client.rb
krikri-0.5.2 lib/krikri/provenance_query_client.rb
krikri-0.5.1 lib/krikri/provenance_query_client.rb
krikri-0.5.0 lib/krikri/provenance_query_client.rb
krikri-0.4.0 lib/krikri/provenance_query_client.rb