All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opengis.cite.cat30.rnc.osd-1.1-draft5.rnc Maven / Gradle / Ivy

# RELAX NG grammar for OpenSearch 1.1 description documents
# See 

namespace os = "http://a9.com/-/spec/opensearch/1.1/"
namespace a = "http://relaxng.org/ns/compatibility/annotation/1.0"
namespace local = ""

start = osDocument

osDocument = element os:OpenSearchDescription {
    element os:ShortName { xsd:string {maxLength = "16"} }
    & element os:Description { xsd:string {maxLength = "1024"} }
    & element os:Url { osdUrlAttr, foreignAttribute*, foreignElement* }+
    & element os:Contact { xsd:string {pattern = ".+@.+"} }?  # addr-spec (RFC 5322)
    & element os:Tags { list { xsd:NCName+ } }?  # value has maxLength=256
    & element os:LongName { xsd:string {maxLength = "48"} }?
    & element os:Image { osdImage }*
    & element os:Query { foreignAttribute*, osQueryAttr }*
    & element os:Developer { xsd:string {maxLength = "64"} }?
    & element os:Attribution { xsd:string {maxLength = "256"} }?
    & element os:SyndicationRight { osdSyndicationRightValues }?
    & element os:AdultContent { "false" | "true" }?
    & element os:Language { xsd:string {pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*|\*"} }*
    # IANA character set, default is "UTF-8"
    & element os:InputEncoding { xsd:string {pattern = "[A-Za-z]([A-Za-z0-9._]|-)*"} }*
    # IANA character set, default is "UTF-8"
    & element os:OutputEncoding { xsd:string {pattern = "[A-Za-z]([A-Za-z0-9._]|-)*"} }*
    & foreignAttribute*
    & foreignElement*
}

osdUrlAttr = 
    attribute template { xsd:string },  # URL template syntax
    attribute type { xsd:string },  # valid media type
    [a:defaultValue = "results"]
    attribute rel { list { UrlRelToken+ } }?,
    [a:defaultValue = "1"]
    attribute indexOffset { xsd:positiveInteger }?,
    [a:defaultValue = "1"]
    attribute pageOffset { xsd:positiveInteger }?

osdImage = 
    attribute height {xsd:nonNegativeInteger}?, 
    attribute width {xsd:nonNegativeInteger}?,
    attribute type {xsd:string}?, 
    xsd:anyURI

osQueryAttr = 
    attribute role { osQueryRoleValues | xsd:QName },
    attribute title { xsd:string {maxLength = "256"} }?,
    attribute searchTerms { text }?,
    attribute totalResults { xsd:nonNegativeInteger }?,
    attribute count { xsd:nonNegativeInteger }?,
    attribute startIndex { xsd:int }?,
    attribute startPage { xsd:int }?,
    attribute inputEncoding { xsd:string {pattern = "[A-Za-z]([A-Za-z0-9._]|-)*"} }?, 
    attribute outputEncoding { xsd:string {pattern = "[A-Za-z]([A-Za-z0-9._]|-)*"} }?,
    attribute language { xsd:string {pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*|\*"} }?

osQueryRoleValues = "request" | "example" | "related" | "correction" | "subset" | "superset"
osdSyndicationRightValues = "open" | "limited" | "private" | "closed"  # case-insensitive
osdUrlRelToken = "results" | "suggestions" | "self" | "collection"
UrlRelToken = osdUrlRelToken | xsd:anyURI

# extensions
simpleExtensionElement = element * - os:* { text }
structuredExtensionElement = 
  element * - os:* {
  (attribute * { text }+, (text|anyElement)*) | (attribute * { text }*, (text?, anyElement+, (text|anyElement)*))
}
foreignElement = simpleExtensionElement | structuredExtensionElement
foreignAttribute = attribute * - (local:* | os:* ) { text }*
anyElement = element * { (attribute * { text } | text | anyElement)* }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy