| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
|---|
| 2 |
|
|---|
| 3 |
<!-- ================================================================== |
|---|
| 4 |
$Id$ |
|---|
| 5 |
|
|---|
| 6 |
Relax NG Schema for MusicBrainz XML Metadata Version 1.0rc3 |
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
This XML schema has been designed to represent music metadata. |
|---|
| 10 |
Documentation and the latest revision can be found at |
|---|
| 11 |
|
|---|
| 12 |
http://musicbrainz.org/development/mmd/ |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
Copyright (c) 2006 Robert Kaye, Matthias Friedrich |
|---|
| 16 |
|
|---|
| 17 |
The schema is released under the Creative Commons |
|---|
| 18 |
Attribution-ShareAlike 2.5 license. |
|---|
| 19 |
|
|---|
| 20 |
http://creativecommons.org/licenses/by-sa/2.5/ |
|---|
| 21 |
|
|---|
| 22 |
================================================================== --> |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
<grammar xmlns="http://relaxng.org/ns/structure/1.0" |
|---|
| 26 |
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" |
|---|
| 27 |
ns="http://musicbrainz.org/ns/mmd-1.0#"> |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
<start> |
|---|
| 31 |
<ref name="def_metadata"/> |
|---|
| 32 |
</start> |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
<define name="def_metadata"> |
|---|
| 36 |
<element name="metadata"> |
|---|
| 37 |
<optional> |
|---|
| 38 |
<attribute name="generator"> |
|---|
| 39 |
<data type="anyURI"/> |
|---|
| 40 |
</attribute> |
|---|
| 41 |
</optional> |
|---|
| 42 |
<optional> |
|---|
| 43 |
<attribute name="created"> |
|---|
| 44 |
<data type="dateTime"/> |
|---|
| 45 |
</attribute> |
|---|
| 46 |
</optional> |
|---|
| 47 |
|
|---|
| 48 |
<optional> |
|---|
| 49 |
<ref name="def_artist"/> |
|---|
| 50 |
</optional> |
|---|
| 51 |
<optional> |
|---|
| 52 |
<ref name="def_release"/> |
|---|
| 53 |
</optional> |
|---|
| 54 |
<optional> |
|---|
| 55 |
<ref name="def_track"/> |
|---|
| 56 |
</optional> |
|---|
| 57 |
|
|---|
| 58 |
<optional> |
|---|
| 59 |
<ref name="def_artist-list"/> |
|---|
| 60 |
</optional> |
|---|
| 61 |
<optional> |
|---|
| 62 |
<ref name="def_release-list"/> |
|---|
| 63 |
</optional> |
|---|
| 64 |
<optional> |
|---|
| 65 |
<ref name="def_track-list"/> |
|---|
| 66 |
</optional> |
|---|
| 67 |
|
|---|
| 68 |
<optional> |
|---|
| 69 |
<ref name="def_extension"/> |
|---|
| 70 |
</optional> |
|---|
| 71 |
</element> |
|---|
| 72 |
</define> |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
<define name="def_artist"> |
|---|
| 76 |
<element name="artist"> |
|---|
| 77 |
<optional> |
|---|
| 78 |
<attribute name="id"> |
|---|
| 79 |
<data type="anyURI"/> |
|---|
| 80 |
</attribute> |
|---|
| 81 |
</optional> |
|---|
| 82 |
<optional> |
|---|
| 83 |
<attribute name="type"> |
|---|
| 84 |
<data type="anyURI"/> |
|---|
| 85 |
</attribute> |
|---|
| 86 |
</optional> |
|---|
| 87 |
|
|---|
| 88 |
<optional> |
|---|
| 89 |
<element name="name"> |
|---|
| 90 |
<text/> |
|---|
| 91 |
</element> |
|---|
| 92 |
</optional> |
|---|
| 93 |
<optional> |
|---|
| 94 |
<element name="sort-name"> |
|---|
| 95 |
<text/> |
|---|
| 96 |
</element> |
|---|
| 97 |
</optional> |
|---|
| 98 |
<optional> |
|---|
| 99 |
<element name="disambiguation"> |
|---|
| 100 |
<text/> |
|---|
| 101 |
</element> |
|---|
| 102 |
</optional> |
|---|
| 103 |
<optional> |
|---|
| 104 |
<element name="life-span"> |
|---|
| 105 |
<optional> |
|---|
| 106 |
<attribute name="begin"> |
|---|
| 107 |
<ref name="def_incomplete-date"/> |
|---|
| 108 |
</attribute> |
|---|
| 109 |
</optional> |
|---|
| 110 |
<optional> |
|---|
| 111 |
<attribute name="end"> |
|---|
| 112 |
<ref name="def_incomplete-date"/> |
|---|
| 113 |
</attribute> |
|---|
| 114 |
</optional> |
|---|
| 115 |
</element> |
|---|
| 116 |
</optional> |
|---|
| 117 |
|
|---|
| 118 |
<optional> |
|---|
| 119 |
<ref name="def_alias-list"/> |
|---|
| 120 |
</optional> |
|---|
| 121 |
<optional> |
|---|
| 122 |
<ref name="def_release-list"/> |
|---|
| 123 |
</optional> |
|---|
| 124 |
<zeroOrMore> |
|---|
| 125 |
<ref name="def_relation-list"/> |
|---|
| 126 |
</zeroOrMore> |
|---|
| 127 |
|
|---|
| 128 |
<zeroOrMore> |
|---|
| 129 |
<ref name="def_extension"/> |
|---|
| 130 |
</zeroOrMore> |
|---|
| 131 |
</element> |
|---|
| 132 |
</define> |
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
<define name="def_release"> |
|---|
| 136 |
<element name="release"> |
|---|
| 137 |
<optional> |
|---|
| 138 |
<attribute name="id"> |
|---|
| 139 |
<data type="anyURI"/> |
|---|
| 140 |
</attribute> |
|---|
| 141 |
</optional> |
|---|
| 142 |
<optional> |
|---|
| 143 |
<attribute name="type"> |
|---|
| 144 |
<ref name="def_URI-list"/> |
|---|
| 145 |
</attribute> |
|---|
| 146 |
</optional> |
|---|
| 147 |
|
|---|
| 148 |
<optional> |
|---|
| 149 |
<element name="title"> |
|---|
| 150 |
<text/> |
|---|
| 151 |
</element> |
|---|
| 152 |
</optional> |
|---|
| 153 |
<optional> |
|---|
| 154 |
<element name="text-representation"> |
|---|
| 155 |
<optional> |
|---|
| 156 |
<attribute name="language"> |
|---|
| 157 |
<ref name="def_iso-639"/> |
|---|
| 158 |
</attribute> |
|---|
| 159 |
</optional> |
|---|
| 160 |
<optional> |
|---|
| 161 |
<attribute name="script"> |
|---|
| 162 |
<ref name="def_iso-15924"/> |
|---|
| 163 |
</attribute> |
|---|
| 164 |
</optional> |
|---|
| 165 |
</element> |
|---|
| 166 |
</optional> |
|---|
| 167 |
<optional> |
|---|
| 168 |
<element name="asin"> |
|---|
| 169 |
<data type="string"> |
|---|
| 170 |
<param name="pattern">[A-Z0-9]{10}</param> |
|---|
| 171 |
</data> |
|---|
| 172 |
</element> |
|---|
| 173 |
</optional> |
|---|
| 174 |
<optional> |
|---|
| 175 |
<ref name="def_artist"/> |
|---|
| 176 |
</optional> |
|---|
| 177 |
|
|---|
| 178 |
<optional> |
|---|
| 179 |
<ref name="def_release-event-list"/> |
|---|
| 180 |
</optional> |
|---|
| 181 |
<optional> |
|---|
| 182 |
<ref name="def_disc-list"/> |
|---|
| 183 |
</optional> |
|---|
| 184 |
<optional> |
|---|
| 185 |
<ref name="def_puid-list"/> |
|---|
| 186 |
</optional> |
|---|
| 187 |
<optional> |
|---|
| 188 |
<ref name="def_track-list"/> |
|---|
| 189 |
</optional> |
|---|
| 190 |
<zeroOrMore> |
|---|
| 191 |
<ref name="def_relation-list"/> |
|---|
| 192 |
</zeroOrMore> |
|---|
| 193 |
|
|---|
| 194 |
<zeroOrMore> |
|---|
| 195 |
<ref name="def_extension"/> |
|---|
| 196 |
</zeroOrMore> |
|---|
| 197 |
</element> |
|---|
| 198 |
</define> |
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
<define name="def_track"> |
|---|
| 202 |
<element name="track"> |
|---|
| 203 |
<optional> |
|---|
| 204 |
<attribute name="id"> |
|---|
| 205 |
<data type="anyURI"/> |
|---|
| 206 |
</attribute> |
|---|
| 207 |
</optional> |
|---|
| 208 |
|
|---|
| 209 |
<optional> |
|---|
| 210 |
<element name="title"> |
|---|
| 211 |
<text/> |
|---|
| 212 |
</element> |
|---|
| 213 |
</optional> |
|---|
| 214 |
<optional> |
|---|
| 215 |
<element name="duration"> |
|---|
| 216 |
<data type="nonNegativeInteger"/> |
|---|
| 217 |
</element> |
|---|
| 218 |
</optional> |
|---|
| 219 |
<optional> |
|---|
| 220 |
<ref name="def_artist"/> |
|---|
| 221 |
</optional> |
|---|
| 222 |
|
|---|
| 223 |
<optional> |
|---|
| 224 |
<ref name="def_release-list"/> |
|---|
| 225 |
</optional> |
|---|
| 226 |
<optional> |
|---|
| 227 |
<ref name="def_puid-list"/> |
|---|
| 228 |
</optional> |
|---|
| 229 |
<zeroOrMore> |
|---|
| 230 |
<ref name="def_relation-list"/> |
|---|
| 231 |
</zeroOrMore> |
|---|
| 232 |
|
|---|
| 233 |
<zeroOrMore> |
|---|
| 234 |
<ref name="def_extension"/> |
|---|
| 235 |
</zeroOrMore> |
|---|
| 236 |
</element> |
|---|
| 237 |
</define> |
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
<define name="def_relation"> |
|---|
| 241 |
<element name="relation"> |
|---|
| 242 |
<attribute name="type"> |
|---|
| 243 |
<data type="anyURI"/> |
|---|
| 244 |
</attribute> |
|---|
| 245 |
<attribute name="target"> |
|---|
| 246 |
<data type="anyURI"/> |
|---|
| 247 |
</attribute> |
|---|
| 248 |
<optional> |
|---|
| 249 |
<attribute name="direction"> |
|---|
| 250 |
<ref name="def_direction"/> |
|---|
| 251 |
</attribute> |
|---|
| 252 |
</optional> |
|---|
| 253 |
<optional> |
|---|
| 254 |
<attribute name="attributes"> |
|---|
| 255 |
<ref name="def_URI-list"/> |
|---|
| 256 |
</attribute> |
|---|
| 257 |
</optional> |
|---|
| 258 |
<optional> |
|---|
| 259 |
<attribute name="begin"> |
|---|
| 260 |
<ref name="def_incomplete-date"/> |
|---|
| 261 |
</attribute> |
|---|
| 262 |
</optional> |
|---|
| 263 |
<optional> |
|---|
| 264 |
<attribute name="end"> |
|---|
| 265 |
<ref name="def_incomplete-date"/> |
|---|
| 266 |
</attribute> |
|---|
| 267 |
</optional> |
|---|
| 268 |
|
|---|
| 269 |
<optional> |
|---|
| 270 |
<choice> |
|---|
| 271 |
<ref name="def_artist"/> |
|---|
| 272 |
<ref name="def_release"/> |
|---|
| 273 |
<ref name="def_track"/> |
|---|
| 274 |
|
|---|
| 275 |
<ref name="def_extension"/> |
|---|
| 276 |
</choice> |
|---|
| 277 |
</optional> |
|---|
| 278 |
</element> |
|---|
| 279 |
</define> |
|---|
| 280 |
|
|---|
| 281 |
|
|---|
| 282 |
<define name="def_alias"> |
|---|
| 283 |
<element name="alias"> |
|---|
| 284 |
<optional> |
|---|
| 285 |
<attribute name="type"> |
|---|
| 286 |
<data type="anyURI"/> |
|---|
| 287 |
</attribute> |
|---|
| 288 |
</optional> |
|---|
| 289 |
<optional> |
|---|
| 290 |
<attribute name="script"> |
|---|
| 291 |
<ref name="def_iso-15924"/> |
|---|
| 292 |
</attribute> |
|---|
| 293 |
</optional> |
|---|
| 294 |
<text/> |
|---|
| 295 |
</element> |
|---|
| 296 |
</define> |
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 |
<define name="def_extension"> |
|---|
| 300 |
<element> |
|---|
| 301 |
<anyName> |
|---|
| 302 |
<except> |
|---|
| 303 |
<nsName ns="http://musicbrainz.org/ns/mmd-1.0#"/> |
|---|
| 304 |
<nsName ns=""/> |
|---|
| 305 |
</except> |
|---|
| 306 |
</anyName> |
|---|
| 307 |
<zeroOrMore> |
|---|
| 308 |
<choice> |
|---|
| 309 |
<attribute> |
|---|
| 310 |
<anyName/> |
|---|
| 311 |
</attribute> |
|---|
| 312 |
<text/> |
|---|
| 313 |
<ref name="def_anything"/> |
|---|
| 314 |
</choice> |
|---|
| 315 |
</zeroOrMore> |
|---|
| 316 |
</element> |
|---|
| 317 |
</define> |
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 |
<define name="def_anything"> |
|---|
| 321 |
<element> |
|---|
| 322 |
<anyName> |
|---|
| 323 |
<except> |
|---|
| 324 |
<nsName ns=""/> |
|---|
| 325 |
</except> |
|---|
| 326 |
</anyName> |
|---|
| 327 |
<zeroOrMore> |
|---|
| 328 |
<choice> |
|---|
| 329 |
<attribute> |
|---|
| 330 |
<anyName/> |
|---|
| 331 |
</attribute> |
|---|
| 332 |
<text/> |
|---|
| 333 |
<ref name="def_anything"/> |
|---|
| 334 |
</choice> |
|---|
| 335 |
</zeroOrMore> |
|---|
| 336 |
</element> |
|---|
| 337 |
</define> |
|---|
| 338 |
|
|---|
| 339 |
|
|---|
| 340 |
<define name="def_artist-list"> |
|---|
| 341 |
<element name="artist-list"> |
|---|
| 342 |
<ref name="def_list-attributes"/> |
|---|
| 343 |
<zeroOrMore> |
|---|
| 344 |
<ref name="def_artist"/> |
|---|
| 345 |
</zeroOrMore> |
|---|
| 346 |
</element> |
|---|
| 347 |
</define> |
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
<define name="def_release-list"> |
|---|
| 351 |
<element name="release-list"> |
|---|
| 352 |
<ref name="def_list-attributes"/> |
|---|
| 353 |
<zeroOrMore> |
|---|
| 354 |
<ref name="def_release"/> |
|---|
| 355 |
</zeroOrMore> |
|---|
| 356 |
</element> |
|---|
| 357 |
</define> |
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
<define name="def_alias-list"> |
|---|
| 361 |
<element name="alias-list"> |
|---|
| 362 |
<ref name="def_list-attributes"/> |
|---|
| 363 |
<zeroOrMore> |
|---|
| 364 |
<ref name="def_alias"/> |
|---|
| 365 |
</zeroOrMore> |
|---|
| 366 |
</element> |
|---|
| 367 |
</define> |
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 |
<define name="def_track-list"> |
|---|
| 371 |
<element name="track-list"> |
|---|
| 372 |
<ref name="def_list-attributes"/> |
|---|
| 373 |
<zeroOrMore> |
|---|
| 374 |
<ref name="def_track"/> |
|---|
| 375 |
</zeroOrMore> |
|---|
| 376 |
</element> |
|---|
| 377 |
</define> |
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
<define name="def_release-event-list"> |
|---|
| 381 |
<element name="release-event-list"> |
|---|
| 382 |
<ref name="def_list-attributes"/> |
|---|
| 383 |
<zeroOrMore> |
|---|
| 384 |
<element name="event"> |
|---|
| 385 |
<attribute name="date"> |
|---|
| 386 |
<ref name="def_incomplete-date"/> |
|---|
| 387 |
</attribute> |
|---|
| 388 |
<attribute name="country"> |
|---|
| 389 |
<ref name="def_iso-3166"/> |
|---|
| 390 |
</attribute> |
|---|
| 391 |
</element> |
|---|
| 392 |
</zeroOrMore> |
|---|
| 393 |
</element> |
|---|
| 394 |
</define> |
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
<define name="def_disc-list"> |
|---|
| 398 |
<element name="disc-list"> |
|---|
| 399 |
<ref name="def_list-attributes"/> |
|---|
| 400 |
<zeroOrMore> |
|---|
| 401 |
<element name="disc"> |
|---|
| 402 |
<attribute name="id"> |
|---|
| 403 |
<data type="string"> |
|---|
| 404 |
<param name="pattern">[a-zA-Z0-9._]{27}-</param> |
|---|
| 405 |
</data> |
|---|
| 406 |
</attribute> |
|---|
| 407 |
<optional> |
|---|
| 408 |
<attribute name="sectors"> |
|---|
| 409 |
<data type="nonNegativeInteger"/> |
|---|
| 410 |
</attribute> |
|---|
| 411 |
</optional> |
|---|
| 412 |
</element> |
|---|
| 413 |
</zeroOrMore> |
|---|
| 414 |
</element> |
|---|
| 415 |
</define> |
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 |
<define name="def_puid-list"> |
|---|
| 419 |
<element name="puid-list"> |
|---|
| 420 |
<ref name="def_list-attributes"/> |
|---|
| 421 |
<zeroOrMore> |
|---|
| 422 |
<element name="puid"> |
|---|
| 423 |
<attribute name="id"> |
|---|
| 424 |
<ref name="def_uuid"/> |
|---|
| 425 |
</attribute> |
|---|
| 426 |
</element> |
|---|
| 427 |
</zeroOrMore> |
|---|
| 428 |
</element> |
|---|
| 429 |
</define> |
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 |
<define name="def_relation-list"> |
|---|
| 433 |
<element name="relation-list"> |
|---|
| 434 |
<attribute name="target-type"> |
|---|
| 435 |
<data type="anyURI"/> |
|---|
| 436 |
</attribute> |
|---|
| 437 |
<ref name="def_list-attributes"/> |
|---|
| 438 |
<zeroOrMore> |
|---|
| 439 |
<ref name="def_relation"/> |
|---|
| 440 |
</zeroOrMore> |
|---|
| 441 |
</element> |
|---|
| 442 |
</define> |
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
<define name="def_list-attributes"> |
|---|
| 446 |
<optional> |
|---|
| 447 |
<attribute name="count"> |
|---|
| 448 |
<data type="nonNegativeInteger"/> |
|---|
| 449 |
</attribute> |
|---|
| 450 |
</optional> |
|---|
| 451 |
<optional> |
|---|
| 452 |
<attribute name="offset"> |
|---|
| 453 |
<data type="nonNegativeInteger"/> |
|---|
| 454 |
</attribute> |
|---|
| 455 |
</optional> |
|---|
| 456 |
</define> |
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
<!-- A space separated list of URIs, relative ones are possible, too. --> |
|---|
| 460 |
<define name="def_URI-list"> |
|---|
| 461 |
<list> |
|---|
| 462 |
<oneOrMore> |
|---|
| 463 |
<data type="anyURI"/> |
|---|
| 464 |
</oneOrMore> |
|---|
| 465 |
</list> |
|---|
| 466 |
</define> |
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 |
<!-- A date with varying precision in format 'YYYY-MM-DD'. --> |
|---|
| 470 |
<define name="def_incomplete-date"> |
|---|
| 471 |
<data type="string"> |
|---|
| 472 |
<param name="pattern">[0-9]{4}(-[0-9]{2})?(-[0-9]{2})?</param> |
|---|
| 473 |
</data> |
|---|
| 474 |
</define> |
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
<!-- A two-letter country code like 'DE', 'UK', 'FR' etc. --> |
|---|
| 478 |
<define name="def_iso-3166"> |
|---|
| 479 |
<data type="string"> |
|---|
| 480 |
<param name="pattern">[A-Z]{2}</param> |
|---|
| 481 |
</data> |
|---|
| 482 |
</define> |
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
<!-- An ISO-639-2/T language code like 'DEU', 'ENG', 'JPN' etc. --> |
|---|
| 486 |
<define name="def_iso-639"> |
|---|
| 487 |
<data type="string"> |
|---|
| 488 |
<param name="pattern">[A-Z]{3}</param> |
|---|
| 489 |
</data> |
|---|
| 490 |
</define> |
|---|
| 491 |
|
|---|
| 492 |
|
|---|
| 493 |
<!-- A four-letter script code like 'Latn', 'Cyrl', etc. --> |
|---|
| 494 |
<define name="def_iso-15924"> |
|---|
| 495 |
<data type="string"> |
|---|
| 496 |
<param name="pattern">[A-Z][a-z]{3}</param> |
|---|
| 497 |
</data> |
|---|
| 498 |
</define> |
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
<!-- A 128 Bit UUID in its standard ASCII representation. --> |
|---|
| 502 |
<define name="def_uuid"> |
|---|
| 503 |
<data type="string"> |
|---|
| 504 |
<param name="pattern">[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}</param> |
|---|
| 505 |
</data> |
|---|
| 506 |
</define> |
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
<!-- Reading direction of a relation. Defaults to "both". --> |
|---|
| 510 |
<define name="def_direction"> |
|---|
| 511 |
<choice> |
|---|
| 512 |
<value>both</value> |
|---|
| 513 |
<value>forward</value> |
|---|
| 514 |
<value>backward</value> |
|---|
| 515 |
</choice> |
|---|
| 516 |
</define> |
|---|
| 517 |
|
|---|
| 518 |
</grammar> |
|---|