Biblio Schema
namespace local = ""
namespace inh = inherit
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

## A Relax NG bibliographic schema.
## By Bruce D'Arcus

start = Biblio

Biblio = element biblio { Bibentry+ }

## First we define the main structures and their components.

Part = Name*, Titles*, Location?

Periodical = Name*, Titles, Origin.Periodical, Location?

Monograph = Name*, Titles, Origin.Monograph, Location?, Series?

Series = Name*, Titles, Publisher?

## For archival records

Collection = element collection { Name*, Titles, Date?, Location }

## Next we define the types, which are generic and broad.
## Drawn from MARC/MODS.

ResourceType = attribute type { "text""sound""still-image""moving-image""cartographic""mixed" }

## Genre lists, divided by structural types.
## This is the key innovation perhaps, in that we use this
## as a named -- commonly understood -- proxy to the underlying
## structure. Current values are for illustration only. We need to make
## these lists extensible. But how?

Genres = Genre.Monograph, Genre.Periodical, Genre.PartInMonograph, Genre.PartInPeriodical

Genre.Monograph =
"book""website""album""report""painting""chart""diagram""data""play""interview"

Genre.Periodical = "chapter""song""webpage"

Genre.PartInMonograph = "chapter""song""webpage"

Genre.PartInPeriodical = "article-journal""article-magazine""article-newspaper"

## Definitions for the main container modules.

Containers = In.Monograph, In.Periodical, In.Collection, In.Series

In.Monograph = element in { Monograph, PartDesc, attribute type { "monograph" } }

In.Periodical = element in { Periodical, PartDesc?, attribute type { "periodical" } }

In.Series = element in { Series, attribute type { "series" } }

In.Collection = element in { Collection, attribute type { "collection" } }

## Next we assemble them based on genres.
## Note: extension mechanism still to do.

Bibentry =
element bibentry
{
( ResourceType, attribute genre { Genre.PartInPeriodical }, Part, In.Periodical, Notes* )
| ( ResourceType, attribute genre { Genre.Monograph }, Monograph, In.Series? )
| ( ResourceType, attribute genre { Genre.PartInMonograph }, Part, In.Monograph )
}

## Titles contain titles and subtitles. Drawn from MODS titleInfo.

Titles = element titles { attlist.titles, ( titlesubTitlenonSort )+ }

attlist.titles &=
attribute ID { xsd:ID }?,
attribute type { "abbreviated""translated""alternative""uniform" }?,
attribute href { text }?,
attribute role { text }?,
attribute xml:lang { text }?,
attribute transliteration { text }?

title = element title { attlist.title, any }

attlist.title &= empty

subTitle = element subTitle { attlist.subTitle, any }

attlist.subTitle &= empty

nonSort = element nonSort { attlist.nonSort, any }

attlist.nonSort &= empty

## Name element

Name = element name { attlist.name, namePart*, address* }

## As with genres, we define different name role lists depending on context.

Name.Roles = NameRoles.Part, NameRole.Whole, NameRole.Series

## A part (article, chapter, etc.) cannot have an editor. We apply this
## logic to this list. Again, needs to be extended.

NameRoles.Part = attribute role { "author""artist""director" }

## Role for whole -- which can be either standalone or containers -- and
## include examples such as books or journals.

NameRole.Whole =
attribute role { "author""editor""interviewer""interviewee""performer""recipient""artist" }

## Series role, for things like series editor. Could be for any third-level
## name role though.

NameRole.Series = attribute role { "series-editor" }

## Actual name pieces. Will likely change attributes to elements.

namePart = element namePart { attlist.namePart, text }

attlist.namePart &= attribute type { "date""family""given" }?

attlist.name &=
attribute ID { xsd:ID }?,
attribute type { "personal""corporate""conference" },
attribute href { text }?,
attribute role { text }?,
attribute xml:lang { text }?,
attribute transliteration { text }?

## address for names

address =
element address
{
attlist-address*,
( ( emailphonefax )*, ( ( streetaddresspostal-codecitycountry )* | Place ) )*
}

attlist-address &= Lang

email = element email { xsd:token }

phone = element phone { attlist-phone, text }

attlist-phone &= empty

fax = element fax { attlist-fax, text }

attlist-fax &= empty

streetaddress = element streetaddress { attlist-streetaddress, text }

attlist-streetaddress &= empty

postal-code = element postal-code { attlist-postal-code, text }

attlist-postal-code &= empty

city = element city { attlist-city, text }

attlist-city &= empty

country = element country { attlist-country, text }

attlist-country &= empty

## generic stuff

Generics = Lang, any

any = ( element * { attribute * { text }*, any } | text )*

Lang =
attribute xml:lang { xsd:NMTOKEN }?,
[ a:defaultValue = "no" ] attribute translit { "yes""no" }?,
attribute text-type { "primary""translation" }?

## The origin element is used to capture who, what, where, and when
## distributed the bibliographic object in question; from where the object came from.
## For published sources, this is where the publisher, publisher place and
## publication date go.
## This element can also be used for unpublished sources as
## well, and for events such as performances, interviews, or conferences.
## Because Relax NG allows us to, we control the mix of elements
## depending on whether we have a monograph or a periodical (the
## former generally requiring a publisher, and the latter not).

Origins = Origin.Monograph, Origin.Periodical

Origin.Monograph = element origin { Publisher?, Place, Date }

Origin.Periodical = element origin { Date }

Publisher = element publisher { text }

Place = element place { text }

## The Date element; drawn from BibX, but
## using schema datatyping.

Dates = Date

Date = element date { attlist-Date, text }

attlist-Date &=
attribute year { xsd:gYear },
attribute month { xsd:token { pattern = "0[1-9]|1[0-2]" } }?,
attribute day { xsd:token { pattern = "0[1-9]|(1|2)[0-9]|3[0-1]" } }?,
[ a:defaultValue = "item" ] attribute role { "start""end""item" }?,
Lang?

## While origin designates where an object is from, the location
## element is used to designate where it is currently at. This
## is useful for online sources where one needs to specify a URL, or
## for archival sources where one needs to designate a holding
## location.

Location = element location { attlist.location, text }

attlist.location &= attribute type { "physical""electronic" }

parttype =
"number"
"volume"
"issue"
"page"
"chapter"
"part"
"section"
"paragraph"
"line"
"word"
"track"
"other"

## Drawn from the BibX partdesc element.

PartDesc = element partDesc { attlist-partdesc, ( singlerangecomposite )+ }

attlist-partdesc &= empty

composite = element composite { attlist-composite, ( singlerange ), PartDesc }

attlist-composite &= empty

single = element single { attlist-single, xsd:NMTOKEN }

attlist-single &= attribute xml:lang { text }?, attribute type { parttype }, attribute subtype { text }?

range = element range { attlist-range, \start, end? }

attlist-range &= attribute xml:lang { text }?, attribute type { parttype }, attribute subtype { text }?

\start = element start { attlist-start, xsd:NMTOKEN }

attlist-start &= empty

end = element end { attlist-end, xsd:NMTOKEN }

attlist-end &= empty

## Annotation/notes element

Notes = element notes { attlist.notes, note* }

attlist.notes &= empty

## The main element is "note," and can be repeated. Attributes have been
## added to enhance note-taking support related to bibliographic data.

note = element note { attlist.note, para* }

attlist.note &=
attribute ID { xsd:ID }?,
attribute user { text }?,
attribute href { text }?,
attribute xml:lang { text }?,
attribute date { xsd:date }?,
Citation.attlist?

## Add attributes to attach elements with their citation referent(s).

Citation.attlist =
attribute reference { xsd:IDREFS }?,
attribute related { xsd:IDREFS }?,
attribute start-page { text }?,
attribute stop-page { text }?

## main elements

Blocks = parablockquoteext.Blocks

Inlines = textemphasisquotespanext.Inlines

## The following elements allow for future extension if needed.

ext.Inlines = notAllowed

ext.Blocks = notAllowed

para = element para { attlist.para, ( InlinesBlocks )* }

attlist.para &= Citation.attlist

quote = element quote { attlist.quote, text* }

attlist.quote &= Citation.attlist

blockquote = element blockquote { attlist.blockquote, para* }

attlist.blockquote &= Citation.attlist

## Below we add a "source" attribute to indicate whether the emphasis
## has been added by the note-taker, or was present in the original source.

emphasis = element emphasis { attlist.emphasis, Inlines* }

attlist.emphasis &= attribute source { "original""added" }?

## The span element is added as a more generic way to tag text. I imagine it
## could be used to tag chunks of text with a language attribute, but perhaps
## also to act as a kind of highlighter of key pieces of content.

span = element span { attlist.span, Inlines* }

attlist.span &= attribute type { text }?, attribute xml:lang { text }?
Index
 
start
Definitions: 1
address
Definitions: 1
Referenced from:
Name
any
Definitions: 1
attlist-address
Definitions: 1
Referenced from:
address
attlist-city
Definitions: 1
Referenced from:
city
attlist-composite
Definitions: 1
Referenced from:
composite
attlist-country
Definitions: 1
Referenced from:
country
attlist-Date
Definitions: 1
Referenced from:
Date
attlist-end
Definitions: 1
Referenced from:
end
attlist-fax
Definitions: 1
Referenced from:
fax
attlist-partdesc
Definitions: 1
Referenced from:
PartDesc
attlist-phone
Definitions: 1
Referenced from:
phone
attlist-postal-code
Definitions: 1
Referenced from:
postal-code
attlist-range
Definitions: 1
Referenced from:
range
attlist-single
Definitions: 1
Referenced from:
single
attlist-start
Definitions: 1
Referenced from:
\start
attlist-streetaddress
Definitions: 1
Referenced from:
streetaddress
attlist.blockquote
Definitions: 1
Referenced from:
blockquote
attlist.emphasis
Definitions: 1
Referenced from:
emphasis
attlist.location
Definitions: 1
Referenced from:
Location
attlist.name
Definitions: 1
Referenced from:
Name
attlist.namePart
Definitions: 1
Referenced from:
namePart
attlist.nonSort
Definitions: 1
Referenced from:
nonSort
attlist.note
Definitions: 1
Referenced from:
note
attlist.notes
Definitions: 1
Referenced from:
Notes
attlist.para
Definitions: 1
Referenced from:
para
attlist.quote
Definitions: 1
Referenced from:
quote
attlist.span
Definitions: 1
Referenced from:
span
attlist.subTitle
Definitions: 1
Referenced from:
subTitle
attlist.title
Definitions: 1
Referenced from:
title
attlist.titles
Definitions: 1
Referenced from:
Titles
Bibentry
Definitions: 1
Referenced from:
Biblio
Biblio
Definitions: 1
Referenced from:
start
blockquote
Definitions: 1
Referenced from:
Blocks
Blocks
Definitions: 1
Referenced from:
para
Citation.attlist
Definitions: 1
city
Definitions: 1
Referenced from:
address
Collection
Definitions: 1
Referenced from:
In.Collection
composite
Definitions: 1
Referenced from:
PartDesc
Containers
Definitions: 1
Not referenced from any pattern
country
Definitions: 1
Referenced from:
address
Date
Definitions: 1
Dates
Definitions: 1
Not referenced from any pattern
email
Definitions: 1
Referenced from:
address
emphasis
Definitions: 1
Referenced from:
Inlines
end
Definitions: 1
Referenced from:
range
ext.Blocks
Definitions: 1
Referenced from:
Blocks
ext.Inlines
Definitions: 1
Referenced from:
Inlines
fax
Definitions: 1
Referenced from:
address
Generics
Definitions: 1
Not referenced from any pattern
Genre.Monograph
Definitions: 1
Referenced from:
Bibentry
Genres
Genre.PartInMonograph
Definitions: 1
Referenced from:
Bibentry
Genres
Genre.PartInPeriodical
Definitions: 1
Referenced from:
Bibentry
Genres
Genre.Periodical
Definitions: 1
Referenced from:
Genres
Genres
Definitions: 1
Not referenced from any pattern
In.Collection
Definitions: 1
Referenced from:
Containers
In.Monograph
Definitions: 1
Referenced from:
Bibentry
Containers
In.Periodical
Definitions: 1
Referenced from:
Bibentry
Containers
In.Series
Definitions: 1
Referenced from:
Bibentry
Containers
Inlines
Definitions: 1
Referenced from:
emphasis
para
span
Lang
Definitions: 1
Location
Definitions: 1
Monograph
Definitions: 1
Referenced from:
Bibentry
In.Monograph
Name
Definitions: 1
Name.Roles
Definitions: 1
Not referenced from any pattern
namePart
Definitions: 1
Referenced from:
Name
NameRole.Series
Definitions: 1
Referenced from:
Name.Roles
NameRole.Whole
Definitions: 1
Referenced from:
Name.Roles
NameRoles.Part
Definitions: 1
Referenced from:
Name.Roles
nonSort
Definitions: 1
Referenced from:
Titles
note
Definitions: 1
Referenced from:
Notes
Notes
Definitions: 1
Referenced from:
Bibentry
Origin.Monograph
Definitions: 1
Referenced from:
Monograph
Origins
Origin.Periodical
Definitions: 1
Referenced from:
Origins
Periodical
Origins
Definitions: 1
Not referenced from any pattern
para
Definitions: 1
Referenced from:
blockquote
Blocks
note
Part
Definitions: 1
Referenced from:
Bibentry
PartDesc
Definitions: 1
parttype
Definitions: 1
Referenced from:
attlist-range
attlist-single
Periodical
Definitions: 1
Referenced from:
In.Periodical
phone
Definitions: 1
Referenced from:
address
Place
Definitions: 1
Referenced from:
address
Origin.Monograph
postal-code
Definitions: 1
Referenced from:
address
Publisher
Definitions: 1
Referenced from:
Origin.Monograph
Series
quote
Definitions: 1
Referenced from:
Inlines
range
Definitions: 1
Referenced from:
composite
PartDesc
ResourceType
Definitions: 1
Referenced from:
Bibentry
Series
Definitions: 1
Referenced from:
In.Series
Monograph
single
Definitions: 1
Referenced from:
composite
PartDesc
span
Definitions: 1
Referenced from:
Inlines
\start
Definitions: 1
Referenced from:
range
streetaddress
Definitions: 1
Referenced from:
address
subTitle
Definitions: 1
Referenced from:
Titles
title
Definitions: 1
Referenced from:
Titles
Titles
Definitions: 1