Augment Service
From n² wiki
Nearby: Platform API
- URI Pattern
- http://api.talis.com/stores/{store}/services/augment
- Allowed Methods
- GET
This service augments results from another search by examining content in the store and annotating the search with corresponding metadata. The augmentation does not change the number of results, but adds information to the individual results where possible. Each store can be configured with a set of rules for detecting items that can be augmented. These augmentations can be done in parallel and merged as RDF or in series, with each store adding a little more data to the results.
Note: currently there is no API access to change the configuration of this feature. Store administrators should contact Talis to request configuration changes.
[edit] GET
GETs to the augment service require the basic search capability.
If no parameters are supplied, this service responds with an HTML form to assist creating the correct set of parameters.
Augment service responses are RSS 1.0 documents
Optional Parameters
- data-uri - the URI of a set of search results in RSS 1.0 format. This service will fetch the results at this URI, following up to three redirects. This fetch request will include an accept header of application/rss+xml only.
- xsl - the URI of an XSLT stylesheet that should be applied to the augment results
- content-type - a media type that should be used in the Content-Type header of the response when a stylesheet has been applied to the results.
[edit] Example
As an example, here's a search result document from a store
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://purl.org/rss/1.0/" > <channel rdf:about="http://api.talis.com/stores/bibstore/items/?query=author:vonnegut+title:breakfast"> <title>Bigfoot Search Results</title> <link>http://api.talis.com/stores/bibstore/items/?query=author:vonnegut+title:breakfast</link> <description>query returned 1 item in 65ms</description> <items> <rdf:Seq rdf:about="http://api.talis.com/stores/bibstore/items/results/00112233-4455-6677-8899-aabbccddeeff"> <rdf:li resource="http://api.talis.com/stores/bibstore/items/foo"/> </rdf:Seq> </items> <opensearch:totalResults>1</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> </channel> <item rdf:about="http://api.talis.com/stores/bibstore/items/foo"> <title>Breakfast Of Champions</title> <link>http://api.talis.com/stores/bibstore/items/foo</link> <dc:title>Breakfast Of Champions</dc:title> <dc:creator>Kurt Vonnegut Jr.</dc:creator> <dc:identifier>urn:isbn:0099842602</dc:identifier> </item> </rdf:RDF>
Suppose another store contains holdings information and is configured to detect the dc:identifier containing an ISBN. It augments the results with holdings information:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:aug="http://example.com/augmentation#" xmlns:hold="http://example.com/holdings#" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://purl.org/rss/1.0/" > <channel rdf:about="http://api.talis.com/stores/bibstore/items?query=author:vonnegut+title:breakfast"> <title>Bigfoot Search Results</title> <link>http://api.talis.com/stores/bibstore/items/?query=author:vonnegut+title:breakfast</link> <description>query returned 1 item in 65ms</description> <items> <rdf:Seq rdf:about="http://api.talis.com/stores/bibstore/items/results/00112233-4455-6677-8899-aabbccddeeff"> <rdf:li resource="http://api.talis.com/stores/bibstore/items/foo"/> </rdf:Seq> </items> <opensearch:totalResults>1</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> <aug:augmentation rdf:resource="foo:aug1"/> </channel> <item rdf:about="http://api.talis.com/stores/bibstore/items/foo"> <title>Breakfast Of Champions</title> <link>http://api.talis.com/stores/bibstore/items/foo</link> <dc:title>Breakfast Of Champions</dc:title> <dc:creator>Kurt Vonnegut Jr.</dc:creator> <dc:identifier>urn:isbn:0099842602</dc:identifier> <hold:heldBy> <hold:Institution rdf:about="http://directory.talis.com/res/institutions/bar"> <dc:title>First Collection</dc:title> <dc:identifier>0000.inst</dc:identifier> </hold:Institution> </hold:heldBy> <hold:heldBy> <hold:Institution rdf:about="http://directory.talis.com/res/institutions/baz"> <dc:title>Second Library Collection</dc:title> <dc:identifier>0001.inst</dc:identifier> </hold:Institution> </hold:heldBy> </item> <aug:Augmentation rdf:about="foo:aug1"> <aug:source rdf:resource="http://api.talis.com/stores/holdings"/> </aug:Augmentation> </rdf:RDF>
and this one adds image information:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:aug="http://example.com/aug#" xmlns:rich="http://example.com/enrichments#" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://purl.org/rss/1.0/" > <channel rdf:about="http://api.talis.com/stores/bibstore/items?query=author:vonnegut+title:breakfast"> <title>Bigfoot Search Results</title> <link>http://api.talis.com/stores/bibstore/items/?query=author:vonnegut+title:breakfast</link> <description>query returned 1 item in 65ms</description> <items> <rdf:Seq rdf:about="http://api.talis.com/stores/bibstore/items/results/00112233-4455-6677-8899-aabbccddeeff"> <rdf:li resource="http://api.talis.com/stores/bibstore/items/foo"/> </rdf:Seq> </items> <opensearch:totalResults>1</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> <aug:augmentation rdf:resource="bla:aug1"/> </channel> <item rdf:about="http://api.talis.com/stores/bibstore/items/foo"> <title>Breakfast Of Champions</title> <link>http://api.talis.com/stores/bibstore/items/foo</link> <dc:title>Breakfast Of Champions</dc:title> <dc:creator>Kurt Vonnegut Jr.</dc:creator> <dc:identifier>urn:isbn:0099842602</dc:identifier> <rich:enrichment> <rich:Image rdf:about="http://api.talis.com/stores/images/boc_thumbnail.jpg"> <rich:imageWidth>80</rich:imageWidth> <rich:imageHeight>160</rich:imageHeight> </rich:Image> </rich:enrichment> <rich:enrichment> <rich:Image rdf:about="http://api.talis.com/stores/images/boc_large.jpg"> <rich:imageWidth>200</rich:imageWidth> <rich:imageHeight>400</rich:imageHeight> </rich:Image> </rich:enrichment> </item> <aug:Augmentation rdf:about="bla:aug1"> <aug:source rdf:resource="http://api.talis.com/stores/images"/> </aug:Augmentation> </rdf:RDF>
The final merged result might look like this:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:aug="http://example.com/augmentation#" xmlns:hold="http://example.com/holdings#" xmlns:rich="http://example.com/enrichments#" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://purl.org/rss/1.0/" > <channel rdf:about="http://api.talis.com/stores/bibstore/items?query=author:vonnegut+title:breakfast"> <title>Bigfoot Search Results</title> <link>http://api.talis.com/stores/bibstore/items/?query=author:vonnegut+title:breakfast</link> <description>query returned 1 item in 65ms</description> <items> <rdf:Seq rdf:about="http://api.talis.com/stores/bibstore/items/results/00112233-4455-6677-8899-aabbccddeeff"> <rdf:li resource="http://api.talis.com/stores/bibstore/items/foo"/> </rdf:Seq> </items> <opensearch:totalResults>1</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> <aug:augmentation rdf:resource="foo:aug1"/> <aug:augmentation rdf:resource="bla:aug1"/> </channel> <item rdf:about="http://api.talis.com/stores/bibstore/items/foo"> <title>Breakfast Of Champions</title> <link>http://api.talis.com/stores/bibstore/items/foo</link> <dc:title>Breakfast Of Champions</dc:title> <dc:creator>Kurt Vonnegut Jr.</dc:creator> <dc:identifier>urn:isbn:0099842602</dc:identifier> <hold:heldBy> <hold:Institution rdf:about="http://directory.talis.com/res/institutions/bar"> <dc:title>First Collection</dc:title> <dc:identifier>0000.inst</dc:identifier> </hold:Institution> </hold:heldBy> <hold:heldBy> <hold:Institution rdf:about="http://directory.talis.com/res/institutions/baz"> <dc:title>Second Library Collection</dc:title> <dc:identifier>0001.inst</dc:identifier> </hold:Institution> </hold:heldBy> <rich:enrichment> <rich:Image rdf:about="http://api.talis.com/stores/images/boc_thumbnail.jpg"> <rich:imageWidth>80</rich:imageWidth> <rich:imageHeight>160</rich:imageHeight> </rich:Image> </rich:enrichment> <rich:enrichment> <rich:Image rdf:about="http://api.talis.com/stores/images/boc_large.jpg"> <rich:imageWidth>200</rich:imageWidth> <rich:imageHeight>400</rich:imageHeight> </rich:Image> </rich:enrichment> </item> <aug:Augmentation rdf:about="foo:aug1"> <aug:source rdf:resource="http://api.talis.com/stores/holdings"/> </aug:Augmentation> <aug:Augmentation rdf:about="bla:aug1"> <aug:source rdf:resource="http://api.talis.com/stores/images"/> </aug:Augmentation> </rdf:RDF>

