ogc.opensearchgeo.1.0.schemas.atomtime.rnc Maven / Gradle / Ivy
# -*- rnc -*-
# RELAX NG Compact Syntax Grammar for
# ATOM encoding and foreign elements as defined in OGC 10-032
# for the time extension
#
# OGC OpenSearch Geo and Time Extensions 1.0 is an OGC Standard.
# Copyright (c) 2014 Open Geospatial Consortium.
# To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ .
#
# Version: 1.0.1
#
namespace atom = "http://www.w3.org/2005/Atom"
namespace os = "http://a9.com/-/spec/opensearch/1.1/"
namespace dc="http://purl.org/dc/elements/1.1/"
namespace time = "http://a9.com/-/opensearch/extensions/time/1.0/"
namespace s = "http://purl.oclc.org/dsdl/schematron"
namespace local = ""
# Define date time interval
datetimeInterval= xsd:string { pattern ="\s*[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[\+\-][0-9]{2}:[0-9]{2})?(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[\+\-][0-9]{2}:[0-9]{2})|)\s*"}
# Redefine atom:entry to include new OGC10-032 elements
atomEntryConstruct &= element dc:date { datetimeInterval }?
include "time.rnc"
# Replacing definitions on RFC4287 plus OpenSearch
# relative path schemas/opensearch/1.1/ folder
include "osatom.rnc"{
undefinedAttribute = attribute * - (xml:base | xml:lang | local:* | time:*) {text}
# Redefine the Simple Extension to exclude os and time extension elements
simpleExtensionElement = element * - (atom:* | dc:date | os:*) { text }
# Redefine the Structured Extension to exclude os and time extension elements
structuredExtensionElement = element * -
(atom:* | dc:date | os:* ) { (attribute * { text }+,(text|anyElement)*)
| (attribute * { text }*, (text?, anyElement+, (text|anyElement)*))}
# Redefine Atom rules
atomFeed = [
]
element atom:feed { atomFeedConstruct }
atomEntry =[
s:pattern [ name="Check for HTML Content"
s:rule [ context = "atom:entry" s:assert [ test = "atom:content"
"An atom:entry must have one atom:content MUST have content "
~ "element in a format understandable by generic Atom readers"
~ " ( @type equal to 'html' is recommended)"]]]
]
element atom:entry { atomEntryConstruct }
}
# EOF