Thingpedia - Consider support for generic opensearch discovery / translation to thingpedia query devices
CloCkWeRX opened this issue · 0 comments
Not sure if there is a better place for ideas/discussion.
https://almond.stanford.edu/doc/thingpedia-intro.md talks about the support for RSS
https://developer.mozilla.org/en-US/docs/Web/OpenSearch is an existing standard for discovering simple search controls; autocomplete suggestions and similar.
An example use case: openfoodfacts.org provides a simple opensearch implementation.
Opensearch:
<link rel="search" href="https://world.openfoodfacts.org/cgi/opensearch.pl" type="application/opensearchdescription+xml" title="Open Food Facts">
which produces:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Open Food Facts</ShortName>
<LongName>Open Food Facts EN</LongName>
<Description>Open Food Facts product search</Description>
<Contact>contact@openfoodfacts.org</Contact>
<SyndicationRight>open</SyndicationRight>
<AdultContent>false</AdultContent>
<Language>en</Language>
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://static.openfoodfacts.org/images/favicon/favicon.ico</Image>
<Url type="text/html" method="GET" template="https://world.openfoodfacts.org/cgi/search.pl?search_terms={searchTerms}&search_simple=1&action=process" />
<Url type="application/rss+xml" method="GET" template="https://world.openfoodfacts.org/cgi/search.pl?search_terms={searchTerms}&search_simple=1&action=process&page={startPage?}&page_size={count?}&rss=1" />
<Url type="application/opensearchdescription+xml" rel="self" template="https://world.openfoodfacts.org/cgi/opensearch.pl" />
</OpenSearchDescription>
The individual search results tend to be very basic, but are presented in an RSS like structure.
https://world.openfoodfacts.org/cgi/search.pl?search_terms=cadbury+chocolate&search_simple=1&action=process&page=1&page_size=1&rss=1
It's not clear just how widely spread implementations of Opensearch are, but off the top of my head it would be:
- All mediawiki installations
- Many libraries (https://www.loc.gov/standards/sru/resources/osru.html)
- Github
- Openstreetmap.org
- Ecommerce engines like https://www.aliexpress.com
etc.
Having support to create a thingpedia device that supports a basic query from an opensearch description would lower the barrier to entry