Add OpenSearch
continuous-integration/drone/push Build is passing Details

This commit is contained in:
~lucidiot 2021-10-24 18:35:36 +02:00
parent e6f3bdbfb5
commit 13444d4f69
10 changed files with 1329 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>DuckDuckGo HTML</ShortName>
<Description>Search DuckDuckGo (HTML)</Description>
<InputEncoding>UTF-8</InputEncoding>
<LongName>DuckDuckGo Search (HTML, non-JS)</LongName>
<Image height="16" width="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB8lBMVEUAAADkRQzjPwPjQQXkRQ3iPwTiQQXgPQPeQgrcOwPVNgDVNQDWOgbTMwDRMgDQMwDSMwDRNwTQLgDRJgDSJwDSLgDSNwTjOgDiOADjOQDkPADhQAXzs5v+/fv////0vKbiRQvgPQHpdUr85NzuknPdKgDcIwDnZzj2w7HqeU/gPQLsimb/+PftjWn97Obpb0LdJQDeLQDtjmvsi2jgSBDnbULgOQD/39HgLQDeMgDpeFLgSBH0v670uqbaJQD2qImWvP/G1Ob5+/3u//+fvvXyp47dMwDaLwD0u6v0v6/aNQDiXi/aKQD3qozU7/8gSY2vvtg0ZK/OqLDaKQHYKgLgWTfaNADZMgDZMADZLADzqpD7//+xwdz//9H/5Bn/7Bn//ADofADYMADYMQDZOgPXLgDiZDj//97/0AD3tQDvlgHZOgbXLATXMADWMgDfXjLVLQD///z+0AD/3Rn/yRnwnQDcVjbVMQDyv67wuKTSJwDRHQD+8O/tg3/iQQDwhAHnawHWMADvtKfyva7XQxHga0bQGQD2vbH/u8LXIQCmPQzja07XQxLliGn99fPkcVHvhnGZ5VguvUU5wktBwCcAgxzydVv/8/XmiGngdlL+ysi3+I8LtCE80V6P3YmX4sDleljSNQLzr6D7sKPXNQTSIwAEAbMrAAAAF3RSTlMARqSkRvPz80PTpKRG3fPe3hio9/eoGP50jNsAAAABYktHRB5yCiArAAAAyElEQVQYGQXBvUqCYRiA4fu2V9Tn+UQddI3aCpxaOoU6iU4gcqqpoYbALXBuCuoYmttamqJDiEoh4YP+MOi6BNCh+uYKEGiOVNCXXxA2XDVV/UyfKbRCXTLQWAxbP2vt8Ue/uYDvfim91615sb2um6rqtrr/NFb1cUf1Ybd06areU6lSlYpK79jzK1SyJOkfhOl8JGEcqV5zoKrTRqO6yUzIzNu46ijdM1VV9bhuUJ/nZURExLRzUiPQm3kKXHi4BAEGOmOi78A/L1QoU/VHoTsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTQtMDEtMTlUMjA6MDE6MTEtMDU6MDAuET6cAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE0LTAxLTE5VDIwOjAxOjExLTA1OjAwX0yGIAAAAABJRU5ErkJggg==</Image>
<Url type="text/html" method="post" template="https://html.duckduckgo.com/html/">
<Param name="q" value="{searchTerms}" />
</Url>
<Url type="application/x-suggestions+json" rel="suggestions" template="https://duckduckgo.com/ac/?q={searchTerms}&amp;type=list" />
<Url type="application/opensearchdescription+xml" rel="self" template="https://envs.net/~lucidiot/opensearch/ddghtml.xml" />
</OpenSearchDescription>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>DuckDuckGo Lite</ShortName>
<Description>Search DuckDuckGo (Lite)</Description>
<InputEncoding>UTF-8</InputEncoding>
<LongName>DuckDuckGo Search (Lite, non-JS)</LongName>
<Image height="16" width="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB8lBMVEUAAAD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YXRlOm1vZGlmeQAyMDE0LTAxLTE5VDIwOjAxOjExLTA1OjAwX0yGIAAAAABJRU5ErkJggg==</Image>
<Url type="text/html" method="post" template="https://lite.duckduckgo.com/lite/">
<Param name="q" value="{searchTerms}" />
</Url>
<Url type="application/x-suggestions+json" rel="suggestions" template="https://duckduckgo.com/ac/?q={searchTerms}&amp;type=list" />
<Url type="application/opensearchdescription+xml" rel="self" template="https://envs.net/~lucidiot/opensearch/ddglite.xml" />
</OpenSearchDescription>

200
assets/opensearch/geo.xsd Normal file
View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Geo Extension 1.0 Draft 2 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Geo Extension 1.0 Draft 2 at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Geo/1.0/Draft%202.wiki>
-->
<xs:schema
targetNamespace="http://a9.com/-/opensearch/extensions/geo/1.0/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/opensearch/extensions/geo/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="Latitude">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="-90" />
<xs:maxInclusive value="90" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Longitude">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="-180" />
<xs:maxInclusive value="180" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Box">
<xs:restriction base="xs:string">
<xs:pattern value="[+-]?(?:1(?:[0-7]\d|80)|0?\d{2})(?:.\d+)?,\s*[+-]?(?:[0-8][0-9]|90)(?:.\d+)?,\s*[+-]?(?:1(?:[0-7]\d|80)|0?\d{2})(?:.\d+)?,\s*[+-]?(?:[0-8][0-9]|90)(?:.\d+)?" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Polygon">
<xs:restriction base="xs:string">
<xs:pattern value="(?:[+-]?(?:[0-8][0-9]|90)(?:.\d+)?,[+-]?(?:1(?:[0-7]\d|80)|0?\d{2})(?:.\d+)?,)*[+-]?(?:[0-8][0-9]|90)(?:.\d+)?,[+-]?(?:1(?:[0-7]\d|80)|0?\d{2})(?:.\d+)?" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Geometry">
<xs:restriction base="xs:string">
<!--
XSD does not support defining reusable groups in regexes, so this uses some "manual variable expansion":
number: [+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)
non_empty_point: \(\s*number\s+number\s*\)
point: [Pp][Oo][Ii][Nn][Tt]\s*(?:\s+[Ee][Mm][Pp][Tt][Yy]|non_empty_point)
point_text: (?:[Ee][Mm][Pp][Tt][Yy]|non_empty_point)
linestring: [Ll][Ii][Nn][Ee][Ss][Tt][Rr][Ii][Nn][Gg]\s*(?:\s+[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:non_empty_point\s*,\s*)*non_empty_point\s*\))
linestring_text: (?:[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:non_empty_point\s*,\s*)*non_empty_point\s*\))
polygon: [Pp][Oo][Ll][Yy][Gg][Oo][Nn]\s*(?:\s+[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:linestring_text\s*,\s*)*linestring_text\s*\))
polygon_text: (?:[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:linestring_text\s*,\s*)*linestring_text\s*\))
multipoint: [Mm][Uu][Ll][Tt][Ii][Pp][Oo][Ii][Nn][Tt]\s*(?:\s+[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:point_text\s*,\s*)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\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s*\)\s*,\s*)*\(\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s*\)\s*\))\s*,\s*)*(?:[Ee][Mm][Pp][Tt][Yy]|\(\s*(?:\(\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s*\)\s*,\s*)*\(\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)\s*\)\s*\))\s*\))\s*\))" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Relation">
<xs:restriction base="xs:string">
<xs:enumeration value="intersects">
<xs:annotation>
<xs:documentation>
Return records that intersect with the query.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="contains">
<xs:annotation>
<xs:documentation>
Return records that contain the query entirely.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="disjoint">
<xs:annotation>
<xs:documentation>
Return records that do not intersect with the query.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:attributeGroup name="QueryAttributes">
<xs:annotation>
<xs:documentation>
Additional attributes defined by the OpenSearch Geo extension for the Query element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Replaced with a string describing the location (place name) to perform the search.
This location string will be parsed and geocoded by the search service.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="locationString" type="xs:string" use="prohibited">
<xs:annotation>
<xs:documentation>
Deprecated. Use the "name" parameter instead.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="lat" type="Latitude" use="optional">
<xs:annotation>
<xs:documentation>
Latitude in decimal degrees in EPSG:4326 (typical WGS84 coordinates as returned by a GPS receiver).
This parameter should also include a "radius" parameter that specifies the search radius, in meters.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="lon" type="Longitude" use="optional">
<xs:annotation>
<xs:documentation>
Longitude in decimal degrees in EPSG:4326 (typical WGS84 coordinates as returned by a GPS receiver).
This parameter should also include a "radius" parameter that specifies the search radius, in meters.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="radius" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Search distance from the point defined by `lat` and `lon`.
The distance is in meters along the Earth's surface.
If no radius is supplied, then the search service is free to use a default radius
but should specify this radius in the returned result.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="box" type="Box" use="optional">
<xs:annotation>
<xs:documentation>
Replaced with the bounding box to search for geospatial results within.
The box is defined by "west, south, east, north" coordinates of longitude, latitude, in EPSG 4236 decimal degrees.
This is also commonly referred to by minX, minY, maxX, maxY (where longitude is the X-axis, and latitude is the Y-axis),
or also SouthWest corner and NorthEast corner.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="geometry" type="Geometry" use="optional">
<xs:annotation>
<xs:documentation>
Replaced with a geometry defined using the Well Known Text (WKT) standard.
The following 2D geometric objects can be described:
POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON.
Note that the WKT coordinate pairs are in lon, lat order; opposite to GeoRSS.
Polygons are a collection of linear rings. The outer ring is expressed in counter-clockwise order.
Internal rings have the opposite orientation, appearing as clockwise
(see 6.1.11.1 in OGC Simple Features Specification v. 1.2.0).
Spaces must be URL encoded ('%20' or '+') in the request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="polygon" type="Polygon" use="prohibited">
<xs:annotation>
<xs:documentation>
Deprecated. Use the geometry parameter instead.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="relation" type="Relation" default="intersects">
<xs:annotation>
<xs:documentation>
The spatial relation of the search. By default the geo searches return the records that intersect the query.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uid" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
The identifier of the resource within the search engine context (local reference).
This parameter is used to query resources by their fragment identifier, unique within the search scope only.
It can be used to query local identifiers that are not URIs, including the support of GML identifiers.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>

View File

@ -0,0 +1,578 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch 1.1 Draft 6 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch 1.1 Draft 6 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/opensearch-1-1-draft-6.md>
-->
<xs:schema
targetNamespace="http://a9.com/-/spec/opensearch/1.1/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/"
xmlns:parameters="http://a9.com/-/spec/opensearch/extensions/parameters/1.0/"
xmlns:referrer="http://a9.com/-/opensearch/extensions/referrer/1.0/"
xmlns:suggestions="http://www.opensearch.org/specifications/opensearch/extensions/suggestions/1.1/"
xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:import
namespace="http://a9.com/-/opensearch/extensions/geo/1.0/"
schemaLocation="geo.xsd"
/>
<xs:import
namespace="http://a9.com/-/spec/opensearch/extensions/parameters/1.0/"
schemaLocation="parameters.xsd"
/>
<xs:import
namespace="http://a9.com/-/opensearch/extensions/referrer/1.0/"
schemaLocation="referrer.xsd"
/>
<xs:import
namespace="http://www.opensearch.org/specifications/opensearch/extensions/suggestions/1.1/"
schemaLocation="suggestions.xsd"
/>
<xs:import
namespace="http://a9.com/-/opensearch/extensions/time/1.0/"
schemaLocation="time.xsd"
/>
<xs:simpleType name="ShortName">
<xs:annotation>
<xs:documentation>
Contains a brief human-readable title that identifies this search engine.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Description">
<xs:annotation>
<xs:documentation>
Contains a human-readable text description of the search engine.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="1024" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="UrlRelToken">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="results">
<xs:annotation>
<xs:documentation>
Represents a request for search results in the specified format.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="suggestions">
<xs:annotation>
<xs:documentation>
Represents a request for search suggestions in the specified format.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="self">
<xs:annotation>
<xs:documentation>
Represents the canonical URL of this description document.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="collection">
<xs:annotation>
<xs:documentation>
Represents a request for a set of resources.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:pattern value="#[a-z][a-z-]+$" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="UrlRel">
<xs:annotation>
<xs:documentation>
Rel attribute strings can contain a space-delimited list of one or more semantically meaningful
rel value tokens. An empty rel attribute value should be treated by the client as if the rel
attribute was not present at all.
If a client does not recognize the semantic meaning of any rel value token, then the containing
Url should be ignored by the client.
</xs:documentation>
</xs:annotation>
<xs:list itemType="UrlRelToken" />
</xs:simpleType>
<xs:complexType name="Url">
<xs:annotation>
<xs:documentation>
Describes an interface by which a client can make requests for an external resource,
such as search results, search suggestions, or additional description documents.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Parameter" type="parameters:Parameter" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="template" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
The URL template to be processed according to the OpenSearch URL template syntax.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
The MIME type of the resource being described.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="rel" type="UrlRel" default="results">
<xs:annotation>
<xs:documentation>
The role of the resource being described in relation to the description document.
Contains a space-delimited list of valid rel value tokens.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="indexOffset" type="xs:integer" default="1">
<xs:annotation>
<xs:documentation>
The index number of the first search result.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="pageOffset" type="xs:integer" default="1">
<xs:annotation>
<xs:documentation>
The page number of the first set of search results.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="parameters:UrlAttributes" />
</xs:complexType>
<xs:simpleType name="Contact">
<xs:annotation>
<xs:documentation>
Contains an email address at which the maintainer of the description document can be reached.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Tags">
<xs:annotation>
<xs:documentation>
Contains a set of words that are used as keywords to identify and categorize this search content. Tags must be a single word and are delimited by the space character.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="256" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="LongName">
<xs:annotation>
<xs:documentation>
Contains an extended human-readable title that identifies this search engine.
Search clients should use the value of the ShortName element if this element is not available.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="48" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Image">
<xs:annotation>
<xs:documentation>
Contains a URL that identifies the location of an image that can be used in association with this search content.
Image sizes are offered as a hint to the search client.
The search client will choose the most appropriate image for the available space and should give preference
to those listed first in the OpenSearch description document. Square aspect ratios are recommended.
When possible, search engines should offer a 16x16 image of type "image/x-icon" or "image/vnd.microsoft.icon"
(the Microsoft ICO format) and a 64x64 image of type "image/jpeg" or "image/png".
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="height" type="xs:positiveInteger" use="optional">
<xs:annotation>
<xs:documentation>
Contains the height, in pixels, of this image.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="width" type="xs:positiveInteger" use="optional">
<xs:annotation>
<xs:documentation>
Contains the width, in pixels, of this image.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Contains the the MIME type of this image.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="QueryRole">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="request">
<xs:annotation>
<xs:documentation>
Represents the search query that can be performed to retrieve the same set of search results.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="example">
<xs:annotation>
<xs:documentation>
Represents a search query that can be performed to demonstrate the search engine.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="related">
<xs:annotation>
<xs:documentation>
Represents a search query that can be performed to retrieve similar but different search results.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="correction">
<xs:annotation>
<xs:documentation>
Represents a search query that can be performed to improve the result set, such as with a spelling correction.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="subset">
<xs:annotation>
<xs:documentation>
Represents a search query that will narrow the current set of search results.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="superset">
<xs:annotation>
<xs:documentation>
Represents a search query that will broaden the current set of search results.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:Name">
<xs:pattern value=":" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="QueryTitle">
<xs:restriction base="xs:string">
<xs:maxLength value="256" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Query">
<xs:annotation>
<xs:documentation>
Defines a search query that can be performed by search clients.
OpenSearch description documents should include at least one Query element of role="example"
that is expected to return search results. Search clients may use this example query to
validate that the search engine is working properly.
Search engines should include a Query element of role="request" in each search response
so that search clients can recreate the current search.
</xs:documentation>
</xs:annotation>
<xs:attribute name="role" type="QueryRole" use="required">
<xs:annotation>
<xs:documentation>
Contains a string identifying how the search client should interpret
the search request defined by this Query element.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="title" type="QueryTitle" use="optional">
<xs:annotation>
<xs:documentation>
Contains a human-readable plain text string describing the search request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="totalResults" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>
Contains the expected number of results to be found if the search request were made.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="searchTerms" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the searchTerms as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="count" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the count as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="startIndex" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the startIndex as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="startPage" type="xs:integer" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the startPage as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="language" type="Language" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the language as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="inputEncoding" type="InputEncoding" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the inputEncoding as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="outputEncoding" type="OutputEncoding" use="optional">
<xs:annotation>
<xs:documentation>
Contains the value representing the outputEncoding as an OpenSearch 1.1 parameter name.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="geo:QueryAttributes" />
<xs:attributeGroup ref="referrer:QueryAttributes" />
<xs:attributeGroup ref="suggestions:QueryAttributes" />
<xs:attributeGroup ref="time:QueryAttributes" />
</xs:complexType>
<xs:simpleType name="Developer">
<xs:annotation>
<xs:documentation>
Contains the human-readable name or identifier of the creator or maintainer of the description document.
The developer is the person or entity that created the description document,
and may or may not be the owner, author, or copyright holder of the source of the content itself.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Attribution">
<xs:annotation>
<xs:documentation>
Contains a list of all sources or entities that should be credited for the content contained in the search feed.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="256" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SyndicationRight">
<xs:annotation>
<xs:documentation>
Contains a value that indicates the degree to which the search results provided by this search engine
can be queried, displayed, and redistributed.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="open">
<xs:annotation>
<xs:documentation>
The search client may request search results.
The search client may display the search results to end users.
The search client may send the search results to other search clients.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="limited">
<xs:annotation>
<xs:documentation>
The search client may request search results.
The search client may display the search results to end users.
The search client may not send the search results to other search clients.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="private">
<xs:annotation>
<xs:documentation>
The search client may request search results.
The search client may not display the search results to end users.
The search client may not send the search results to other search clients.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="closed">
<xs:annotation>
<xs:documentation>
The search client may not request search results.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="AdultContent">
<xs:annotation>
<xs:documentation>
Contains a boolean value that should be set to true if the search results may contain material intended only for adults.
As there are no universally applicable guidelines as to what constitutes "adult" content,
the search engine should make a good faith effort to indicate when there is a possibility
that search results may contain material inappropriate for all audiences.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:annotation>
<xs:documentation>
The values "false", "FALSE", "0", "no", and "NO" will be considered boolean FALSE;
all other strings will be considered boolean TRUE.
</xs:documentation>
</xs:annotation>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Language">
<xs:annotation>
<xs:documentation>
Contains a string that indicates that the search engine supports search results in the specified language.
An OpenSearch description document should include one Language element for each language that the search engine supports.
If the search engine also supports queries for any arbitrary language then the OpenSearch description document
should include a Language element with a value of "*".
The "language" template parameter in the OpenSearch URL template can be used to allow the search client
to choose among the available languages.
</xs:documentation>
</xs:annotation>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:language" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="*">
<xs:annotation>
<xs:documentation>
The value of "*" signifies that the search engine does not restrict search results to any particular language.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="InputEncoding">
<xs:annotation>
<xs:documentation>
Contains a string that indicates that the search engine supports search requests encoded with
the specified character encoding.
An OpenSearch description document should include one InputEncoding element for each character encoding
that can be used to encode search requests. The "inputEncoding" template parameter in the OpenSearch URL
template can be used to require the search client to identify which encoding is being used to encode
the current search request.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="OutputEncoding">
<xs:annotation>
<xs:documentation>
Contains a string that indicates that the search engine supports search responses encoded with
the specified character encoding.
An OpenSearch description document should include one OutputEncoding element for each character encoding
that can be used to encode search responses. The "outputEncoding" template parameter in the OpenSearch URL
template can be used to allow the search client to choose a character encoding in the search response.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:complexType name="OpenSearchDescription">
<xs:annotation>
<xs:documentation>
The root node of the OpenSearch description document.
</xs:documentation>
</xs:annotation>
<!--
This is XSD 1.0; it is not possible to have a maxOccurs="unbounded" within xs:all,
so I use xs:choice instead but it means that any of the min/maxOccurs defined for
each xs:element will not be actually validated. They are just left here for
documentation purposes. XSD 1.1 would fix this situation, but is implemented by
almost nobody. It would be technically possible to use 8! xs:sequence elements
(8 being the amount of elements that are either present at least or no more than once),
but that would probably overload many validators.
-->
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="ShortName" type="ShortName" minOccurs="1" maxOccurs="1" />
<xs:element name="Description" type="Description" minOccurs="1" maxOccurs="1" />
<xs:element name="Contact" type="Contact" minOccurs="0" maxOccurs="1" />
<xs:element name="Url" type="Url" minOccurs="1" maxOccurs="unbounded" />
<xs:element name="LongName" type="LongName" minOccurs="0" maxOccurs="1" />
<xs:element name="Image" type="Image" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="Query" type="Query" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="Developer" type="Developer" minOccurs="0" maxOccurs="1" />
<xs:element name="SyndicationRight" type="SyndicationRight" minOccurs="0" maxOccurs="1" default="open" />
<xs:element name="AdultContent" type="AdultContent" minOccurs="0" maxOccurs="1" />
<xs:element name="Language" type="Language" minOccurs="0" maxOccurs="unbounded" default="*" />
<xs:element name="InputEncoding" type="InputEncoding" minOccurs="0" maxOccurs="unbounded" default="UTF-8" />
<xs:element name="OutputEncoding" type="OutputEncoding" minOccurs="0" maxOccurs="unbounded" default="UTF-8" />
</xs:choice>
</xs:complexType>
<xs:element name="OpenSearchDescription" type="OpenSearchDescription" />
</xs:schema>

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Parameter Extension 1.0 Draft 2 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Parameter Extension 1.0 Draft 2 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Parameter/1.0/Draft%202.wiki>
-->
<xs:schema
targetNamespace="http://a9.com/-/spec/opensearch/extensions/parameters/1.0/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/spec/opensearch/extensions/parameters/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="HTTPMethod">
<!--
This uses both enumerations and patterns to provide good autocompletion
in some XML editors as well as a case-insensitive validation to match
the specification.
-->
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="head" />
<xs:enumeration value="get" />
<xs:enumeration value="options" />
<xs:enumeration value="trace" />
<xs:enumeration value="post" />
<xs:enumeration value="put" />
<xs:enumeration value="patch" />
<xs:enumeration value="delete" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[Hh][Ee][Aa][Dd]" />
<xs:pattern value="[Gg][Ee][Tt]" />
<xs:pattern value="[Oo][Pp][Tt][Ii][Oo][Nn][Ss]" />
<xs:pattern value="[Tt][Rr][Aa][Cc][Ee]" />
<xs:pattern value="[Pp][Oo][Ss][Tt]" />
<xs:pattern value="[Pp][Uu][Tt]" />
<xs:pattern value="[Pp][Aa][Tt][Cc][Hh]" />
<xs:pattern value="[Dd][Ee][Ll][Ee][Tt][Ee]" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:attributeGroup name="UrlAttributes">
<xs:annotation>
<xs:documentation>
Additional attributes defined by the OpenSearch Parameters extension for the Url element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="method" type="HTTPMethod" default="get">
<xs:annotation>
<xs:documentation>
Contains a case-insensitive string that identifies the HTTP request method that the search client should use to perform the search request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="enctype" type="xs:string" default="application/x-www-form-urlencoded">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the content encoding the search client should use to perform the search request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<xs:simpleType name="Maximum">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="*">
<xs:annotation>
<xs:documentation>
The parameter may be repeated an arbitrary number of times.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="Title">
<xs:restriction base="xs:string">
<xs:maxLength value="1024" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="NumericOrDate">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:decimal" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:date" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:time" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:dateTime" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="Label">
<xs:restriction base="xs:string">
<xs:maxLength value="512" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Option">
<xs:annotation>
<xs:documentation>
Describes a value/label pair suggested to the client for the parent element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="value" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Contains a string with the value of the option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="label" type="Label" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that provides a label for the option.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Parameter">
<xs:annotation>
<xs:documentation>
Describes a name/value pair to be included in the search request.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Option" type="Option" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
Contains the name of the parameter.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="value" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that will be processed according to the rules of the OpenSearch URL template syntax.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minimum" type="xs:nonNegativeInteger" default="0">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the minimum number of times this parameter must be included in the search request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maximum" type="Maximum" default="1">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the maximum number of times this parameter must be included in the search request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="pattern" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that specifies a regular expression against which the parameter's value is validated.
When present the element should also include a title attribute to inform the client application of the format expected.
Must be a valid pattern according to the JavaScript Pattern production.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="title" type="Title" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string with advisory information for the format and valid values of the parameter, such as would be appropriate for a tooltip.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minExclusive" type="NumericOrDate" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the minimum value for the element that cannot be reached. Applies only to numeric and date types.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maxExclusive" type="NumericOrDate" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the maximum value for the element that cannot be reached. Applies only to numeric and date types.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="minInclusive" type="NumericOrDate" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the minimum value for the element that can be reached. Applies only to numeric and date types.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="maxInclusive" type="NumericOrDate" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the maximum value for the element that can be reached. Applies only to numeric and date types.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="step" type="NumericOrDate" use="optional">
<xs:annotation>
<xs:documentation>
Contains a string that identifies the granularity of the allowed values between the minimal and maximal range.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Referrer Extension 1.0 Draft 1 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Referrer Extension 1.0 Draft 1 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Referrer/1.0/Draft%201.wiki>
-->
<xs:schema
targetNamespace="http://a9.com/-/opensearch/extensions/referrer/1.0/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/opensearch/extensions/referrer/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:attributeGroup name="QueryAttributes">
<xs:annotation>
<xs:documentation>
Additional attributes defined by the OpenSearch Referrer extension for the Query element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="source" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
A string identifying the search client that performed the search request.
Search clients should make known and publish the list of values that they indend to send as a source parameter.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Relevance Extension 1.0 Draft 1 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Relevance Extension 1.0 Draft 1 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Relevance/1.0/Draft%201.wiki>
-->
<xs:schema
targetNamespace="http://a9.com/-/opensearch/extensions/relevance/1.0/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/opensearch/extensions/relevance/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="Score">
<xs:annotation>
<xs:documentation>
Contains a string indicating a relative assessment of relevance
for a particular search result with respect to the search query.
Decimal values less than 0 should be considered equal to 0.
Decimal values greater than 1 should be considered equal to 1.
Unparseable or empty values can be ignored by the client.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0" />
<xs:maxInclusive value="1" />
</xs:restriction>
</xs:simpleType>
<xs:element name="score" type="Score" />
</xs:schema>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Suggestions Extension 1.1 Draft 1 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Suggestions Extension 1.1 Draft 1 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Suggestions/1.0/Draft%201.wiki>
-->
<xs:schema
targetNamespace="http://www.opensearch.org/specifications/opensearch/extensions/suggestions/1.1/"
elementFormDefault="qualified"
xmlns="http://www.opensearch.org/specifications/opensearch/extensions/suggestions/1.1/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:attributeGroup name="QueryAttributes">
<xs:annotation>
<xs:documentation>
Additional attributes defined by the OpenSearch Suggestions extension for the Query element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="suggestionPrefix" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
The string used to generate the search suggestion, when the search query was generated as a result of a search suggestion.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="suggestionIndex" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation>
The location of the selected suggestion within the list, offset from 0, when the search query was generated as a result of a search suggestion.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
OpenSearch Time Extension 1.0 Draft 1 XML Schema
Copyright (c) 2021 ~lucidiot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This file was derived from the OpenSearch Time Extension 1.0 Draft 1 specification at
<https://github.com/dewitt/opensearch/blob/8446769af24e313f308beeb590173c1aca57de9f/mediawiki/Specifications/OpenSearch/Extensions/Time/1.0/Draft%201.wiki>
-->
<xs:schema
targetNamespace="http://a9.com/-/opensearch/extensions/time/1.0/"
elementFormDefault="qualified"
xmlns="http://a9.com/-/opensearch/extensions/time/1.0/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:attributeGroup name="QueryAttributes">
<xs:annotation>
<xs:documentation>
Additional attributes defined by the OpenSearch Time extension for the Query element.
</xs:documentation>
</xs:annotation>
<xs:attribute name="start" type="xs:dateTime" use="optional">
<xs:annotation>
<xs:documentation>
Beginning of the time slice of the search query.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="end" type="xs:dateTime" use="optional">
<xs:annotation>
<xs:documentation>
End of the time slice of the search query.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>

100
content/opensearch/index.md Normal file
View File

@ -0,0 +1,100 @@
---
title: OpenSearch
header-includes:
- |
```{=html}
<link
rel="search"
type="application/opensearchdescription+xml"
title="DuckDuckGo Lite"
href="./ddglite.xml"
/>
<link
rel="search"
type="application/opensearchdescription+xml"
title="DuckDuckGo HTML"
href="./ddghtml.xml"
/>
```
---
> "We want OpenSearch to do for search what RSS has done for content."
> —[A9][quote]
OpenSearch has two meanings, because the preferred way to name anything
when it comes to computers is to make it as confusing as possible:
- OpenSearch was a specification for an XML description of search
engines which was particularly used to allow auto-discovery of search
engines by web browsers before it got unnecessarily replaced by
Chrome's WebExtensions.
- OpenSearch is a search engine software licensed under Apache 2.0.
The OpenSearch specification used to be hosted by an Amazon subsidiary
called A9, and you can still see a trace of it in the XML namespace URL:
`http://a9.com/-/spec/opensearch/1.1/`. It then has been hosted on
opensearch.org before the domain name got stolen by the search engine
software.
- [GitHub repo][github] linked on the Wikipedia page
with a backup of the OpenSearch site
- [Latest archived version at OpenSearch][opensearch-spec]
- [Latest archived version at A9][a9]
- [Latest archived version of OpenSearch][opensearch]
(the spec was moved to GitHub before the site died)
I discovered this specification by trying to find out why the official
DuckDuckGo Lite and HTML search engines on the SeaMonkey add-ons site
were not working properly. If you have gone through other articles on
this wiki you probably already know that if there's an XML somewhere,
I ought to find or create an XSD for it.
A developer at Microsoft seemed to have the same mindset as me in 2008
and [announced an XSD][xsd-blog] on his blog. The linked schema in the
blog article points to [a file on Windows Live SkyDrive][xsd-skydrive],
and while the file's listing has been archived, the file itself has not,
so we are back to square one. So I went ahead and just wrote my own
XSDs for OpenSearch, including all of its extensions.
## XSD
* [OpenSearch 1.1 Draft 6](./opensearch.xsd)
* [OpenSearch Geo Extension 1.0 Draft 2](./geo.xsd)
* [OpenSearch Parameter Extension 1.0 Draft 2](./parameters.xsd)
* [OpenSearch Referrer Extension 1.0 Draft 1](./referrer.xsd)
* [OpenSearch Relevance Extension 1.0 Draft 1](./relevance.xsd)
* [OpenSearch Suggestions Extension 1.1 Draft 1](./suggestions.xsd)
* [OpenSearch Time Extension 1.0 Draft 1](./time.xsd)
## OpenSearch descriptions
I wrote some OpenSearch descriptions myself and am hosting them on this
site. If you are using a browser that supports OpenSearch description
autodiscovery, you should be able to just click a button near your
browser's search features to pick between the available search engines.
Some browsers might even be able to automatically update the files if I
ever need to change them. If your browser doesn't support
autodiscovery, well you can just grab the XML files yourself here:
* [DuckDuckGo Lite](./ddglite.xml)
* [DuckDuckGo HTML](./ddghtml.xml)
## To-do
- Try to retrieve all the search engines that were known to A9 and see
if they are still working, or maybe just document their existence
<http://web.archive.org/web/20090131091222/http://a9.com/-/opensearch/searches.jsp>
- Look around the search engine directories that were known to OpenSearch.org
<http://web.archive.org/web/20120301211959/http://www.opensearch.org/Community/OpenSearch_search_engine_directories>
- Learn more about the poorly documented Mozilla extensions to
OpenSearch descriptions such as `Param` and `SearchForm`
[quote]: http://web.archive.org/web/20050828043300/http://opensearch.a9.com/
[a9]: http://web.archive.org/web/20060821195444/http://a9.com/-/spec/opensearch/1.1/
[opensearch]: http://web.archive.org/web/20191007035316/http://www.opensearch.org:80/Home
[opensearch-spec]: http://web.archive.org/web/20180325164414/http://www.opensearch.org:80/Specifications/OpenSearch/1.1
[github]: https://github.com/dewitt/opensearch/
[xsd-blog]: https://weblogs.asp.net/wkriebel/opensearch-xsd
[xsd-skydrive]: http://web.archive.org/web/20080828085900/http://cid-fd2e2af28bb0e3b9.skydrive.live.com/self.aspx/Public/OpenSearch.xsd