broadcast.rng 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. indeed, a relative default namespace. Unorthodox but useful to avoid a central server
  4. and still enable GRDDL.
  5. Find the RelaxNG schema at http://purl.mro.name/recorder/pbmi2003-recmod2012/broadcast.rnc
  6. About RelaxNG see http://purl.mro.name/relaxng
  7. -->
  8. <grammar ns="../../../../../assets/2013/radio-pi.rdf" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  9. <start>
  10. <a:documentation>Copyright (c) 2013-2016 Marcus Rohrmoser, http://purl.mro.name/recorder
  11. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
  12. associated documentation files (the "Software"), to deal in the Software without restriction,
  13. including without limitation the rights to use, copy, modify, merge, publish, distribute,
  14. sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
  15. furnished to do so, subject to the following conditions:
  16. The above copyright notice and this permission notice shall be included in all copies or
  17. substantial portions of the Software.
  18. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
  19. NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  20. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
  21. OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. MIT License http://opensource.org/licenses/MIT</a:documentation>
  24. <a:documentation>Dublin Core PBMI http://dcpapers.dublincore.org/pubs/article/view/749
  25. not: Ontology for Media Resources 1.0 http://www.w3.org/TR/mediaont-10/
  26. not: EBU http://tech.ebu.ch/lang/en/MetadataEbuCore
  27. use e.g.
  28. $ xmllint --noout --relaxng http://purl.mro.name/recorder/pbmi2003-recmod2012/broadcast.rng htdocs/stations/*/????/??/??/*.xml 2&gt;&amp;1 | grep fail
  29. </a:documentation>
  30. <choice>
  31. <ref name="broadcast">
  32. <a:documentation>either a single broadcast (without 'modified' attribute)</a:documentation>
  33. </ref>
  34. <element name="broadcasts">
  35. <attribute name="date">
  36. <ref name="isoDate"/>
  37. </attribute>
  38. <zeroOrMore>
  39. <ref name="broadcast">
  40. <a:documentation>or multiple broadcast elements (with 'modified' attribute each)</a:documentation>
  41. </ref>
  42. </zeroOrMore>
  43. </element>
  44. </choice>
  45. </start>
  46. <define name="isoDate">
  47. <a:documentation>subset of http://www.w3.org/TR/xmlschema-2/#date-lexical-representation</a:documentation>
  48. <data type="date">
  49. <param name="pattern">\d{4}-\d{2}-\d{2}</param>
  50. </data>
  51. </define>
  52. <define name="isoDateTime">
  53. <a:documentation>compliant to atom feed timestamps, http://www.faqs.org/rfcs/rfc3339.html
  54. Subset of http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation</a:documentation>
  55. <choice>
  56. <data type="dateTime">
  57. <param name="pattern">\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+\-]\d{2}:\d{2}</param>
  58. </data>
  59. <!-- xsd:date { pattern = "\d{4}-\d{2}-\d{2}" }, -->
  60. <data type="string">
  61. <a:documentation>I want to allow 24:00:00 conforming http://www.w3.org/TR/xmlschema-2/#dateTime-lexical-representation.
  62. But xmllint v20900 refuses to validate. So I rather sacrifice the date check and do a mere lexical check
  63. than see 24:00 invalid in such cases.</a:documentation>
  64. <param name="pattern">\d{4}-\d{2}-\d{2}T24:00:00[+\-]\d{2}:\d{2}</param>
  65. </data>
  66. </choice>
  67. </define>
  68. <define name="broadcast">
  69. <element name="broadcast">
  70. <optional>
  71. <attribute name="modified">
  72. <ref name="isoDateTime"/>
  73. </attribute>
  74. </optional>
  75. <optional>
  76. <attribute name="xml:lang">
  77. <data type="NCName">
  78. <param name="pattern">[a-z]{2}</param>
  79. <a:documentation>ISO 639-1 2-letter language code</a:documentation>
  80. </data>
  81. </attribute>
  82. </optional>
  83. <ref name="meta.DC.identifier"/>
  84. <ref name="meta.DC.scheme"/>
  85. <ref name="meta.DC.language"/>
  86. <ref name="meta.DC.title"/>
  87. <optional>
  88. <ref name="meta.DC.title.series"/>
  89. </optional>
  90. <optional>
  91. <ref name="meta.DC.title.episode"/>
  92. </optional>
  93. <optional>
  94. <ref name="meta.DC.subject"/>
  95. </optional>
  96. <ref name="meta.DC.format.timestart"/>
  97. <ref name="meta.DC.format.timeend"/>
  98. <ref name="meta.DC.format.duration"/>
  99. <optional>
  100. <ref name="meta.DC.image"/>
  101. </optional>
  102. <optional>
  103. <ref name="meta.DC.description"/>
  104. </optional>
  105. <optional>
  106. <ref name="meta.DC.author"/>
  107. </optional>
  108. <optional>
  109. <ref name="meta.DC.publisher"/>
  110. </optional>
  111. <optional>
  112. <ref name="meta.DC.creator"/>
  113. </optional>
  114. <optional>
  115. <ref name="meta.DC.copyright"/>
  116. </optional>
  117. <optional>
  118. <ref name="meta.DC.source"/>
  119. </optional>
  120. </element>
  121. </define>
  122. <define name="meta.DC.identifier">
  123. <element name="meta">
  124. <attribute name="name">
  125. <value>DC.identifier</value>
  126. </attribute>
  127. <attribute name="content">
  128. <data type="string">
  129. <a:documentation>define extremely rigid for now, may become more relaxed one day.
  130. internal use only.</a:documentation>
  131. <param name="pattern">[^/]+/\d{4}/\d{2}/\d{2}/\d{4}( .+)?</param>
  132. </data>
  133. </attribute>
  134. </element>
  135. </define>
  136. <define name="meta.DC.scheme">
  137. <element name="meta">
  138. <a:documentation>Dublin Core PBMI http://dcpapers.dublincore.org/pubs/article/view/749</a:documentation>
  139. <attribute name="name">
  140. <value>DC.scheme</value>
  141. </attribute>
  142. <attribute name="content">
  143. <value>/app/pbmi2003-recmod2012/</value>
  144. </attribute>
  145. </element>
  146. </define>
  147. <define name="meta.DC.language">
  148. <element name="meta">
  149. <attribute name="name">
  150. <value>DC.language</value>
  151. </attribute>
  152. <attribute name="content">
  153. <data type="NCName">
  154. <a:documentation>ISO 639-1 2-letter language code</a:documentation>
  155. <param name="pattern">[a-z]{2}</param>
  156. </data>
  157. </attribute>
  158. </element>
  159. </define>
  160. <define name="meta.DC.title">
  161. <element name="meta">
  162. <attribute name="name">
  163. <value>DC.title</value>
  164. </attribute>
  165. <attribute name="content"/>
  166. </element>
  167. </define>
  168. <define name="meta.DC.title.series">
  169. <element name="meta">
  170. <attribute name="name">
  171. <value>DC.title.series</value>
  172. </attribute>
  173. <attribute name="content"/>
  174. </element>
  175. </define>
  176. <define name="meta.DC.title.episode">
  177. <element name="meta">
  178. <attribute name="name">
  179. <value>DC.title.episode</value>
  180. </attribute>
  181. <attribute name="content"/>
  182. </element>
  183. </define>
  184. <define name="meta.DC.subject">
  185. <element name="meta">
  186. <attribute name="name">
  187. <value>DC.subject</value>
  188. </attribute>
  189. <attribute name="content">
  190. <data type="anyURI"/>
  191. </attribute>
  192. </element>
  193. </define>
  194. <define name="meta.DC.format.timestart">
  195. <element name="meta">
  196. <attribute name="name">
  197. <value>DC.format.timestart</value>
  198. </attribute>
  199. <attribute name="content">
  200. <ref name="isoDateTime"/>
  201. </attribute>
  202. </element>
  203. </define>
  204. <define name="meta.DC.format.timeend">
  205. <element name="meta">
  206. <attribute name="name">
  207. <value>DC.format.timeend</value>
  208. </attribute>
  209. <attribute name="content">
  210. <ref name="isoDateTime"/>
  211. </attribute>
  212. </element>
  213. </define>
  214. <define name="meta.DC.format.duration">
  215. <element name="meta">
  216. <attribute name="name">
  217. <value>DC.format.duration</value>
  218. </attribute>
  219. <attribute name="content">
  220. <data type="string">
  221. <param name="pattern">(\d+(\.0)?)|(PT\d+M)</param>
  222. </data>
  223. </attribute>
  224. </element>
  225. </define>
  226. <define name="meta.DC.image">
  227. <element name="meta">
  228. <attribute name="name">
  229. <value>DC.image</value>
  230. </attribute>
  231. <attribute name="content">
  232. <data type="anyURI"/>
  233. </attribute>
  234. </element>
  235. </define>
  236. <define name="meta.DC.description">
  237. <element name="meta">
  238. <attribute name="name">
  239. <value>DC.description</value>
  240. </attribute>
  241. <attribute name="content"/>
  242. </element>
  243. </define>
  244. <define name="meta.DC.author">
  245. <element name="meta">
  246. <attribute name="name">
  247. <value>DC.author</value>
  248. </attribute>
  249. <attribute name="content"/>
  250. </element>
  251. </define>
  252. <define name="meta.DC.publisher">
  253. <element name="meta">
  254. <attribute name="name">
  255. <value>DC.publisher</value>
  256. </attribute>
  257. <attribute name="content"/>
  258. </element>
  259. </define>
  260. <define name="meta.DC.creator">
  261. <element name="meta">
  262. <attribute name="name">
  263. <value>DC.creator</value>
  264. </attribute>
  265. <attribute name="content"/>
  266. </element>
  267. </define>
  268. <define name="meta.DC.copyright">
  269. <element name="meta">
  270. <attribute name="name">
  271. <value>DC.copyright</value>
  272. </attribute>
  273. <attribute name="content"/>
  274. </element>
  275. </define>
  276. <define name="meta.DC.source">
  277. <element name="meta">
  278. <attribute name="name">
  279. <value>DC.source</value>
  280. </attribute>
  281. <attribute name="content">
  282. <data type="anyURI"/>
  283. </attribute>
  284. </element>
  285. </define>
  286. </grammar>