Module: Krikri::ProvenanceQueryClient

Defined in:
lib/krikri/provenance_query_client.rb

Overview

Implements SPARQL queries for finding RDF Resources by their PROV-O history.

Constant Summary collapse

SPARQL_CLIENT =
Repository.query_client

Class Method Summary collapse

Class Method Details

.find_by_activity(activity_uri) ⇒ Object

Raises:

  • (ArgumentError)

9
10
11
12
13
14
# File 'lib/krikri/provenance_query_client.rb', line 9

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, activity_uri])
end