Skip to content

Lookup

The lookup resource allows to lookup and fetch metadata based on the resource URI. This is intended to be used with reverse proxying where it is necessary to re-route external (sub)domains transparently. I.e., the impression to the metadata consumer is that the delivered data originates from the external resource URI; it is not obvious that EntryStore delivers the metadata.

The lookup mechanism can be used globally or per context. In the event of several matching entries, only one is returned.

The global lookup uses the Solr index and returns only entries whose metadata is publicly readable (Solr field public); it answers with 503 if Solr is not activated. The lookup in a context uses the context's resource URIs and the access rights of the requesting user, so authenticated users may also receive non-public metadata.

If no matching entry is found, the response is 404. A missing uri parameter or an invalid scope is answered with 400.

Usage

GET {baseurl}/[{context-id}/]lookup?uri={resource-uri}[&scope=all|local|external&format={format}]

The scope is either all, local or external, with all being default. In the case of all, and if available, both the local and the external metadata are merged in the returned graph. If no context ID is provided, the lookup is executed globally.

See next section for supported formats.

Supported formats

A specific format can be requested using either HTTP content negotiation or the format URL parameter.

The following RDF serialization formats are supported (the same as with the ordinary metadata resource):

  • application/rdf+xml
  • application/json
  • application/ld+json
  • application/rdf+json
  • text/turtle
  • text/n3 (text/rdf+n3 is accepted as an alias)
  • application/n-triples
  • application/trix
  • application/trig

The default format is RDF/XML. In 6.x an unsupported format is answered with 406, see HTTP caching and formats.

Examples

  • http://localhost:8181/lookup?uri=http%3A%2F%2Fdbpedia.org%2Fdata%2FThe_Lord_of_the_Rings
  • http://localhost:8181/lookup?uri=http%3A%2F%2Fdbpedia.org%2Fdata%2FThe_Lord_of_the_Rings&scope=all&format=application/json