forked from citation-style-language/schema
-
Notifications
You must be signed in to change notification settings - Fork 1
/
csl-data.rnc
104 lines (92 loc) · 2.94 KB
/
csl-data.rnc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
namespace dc = "http://purl.org/dc/elements/1.1/"
dc:title [ "Citation Style Language Data" ]
dc:creator [ "Bruce D'Arcus" ]
dc:rights [ "Copyright 2009-2018 Citation Style Language and contributors" ]
dc:license [ "MIT license" ]
dc:description [ "A schema for the CSL data model." ]
include "csl-types.rnc"
include "csl-variables.rnc"
start = element references { reference+ }
reference = element reference { type, id, uri?, container-uri?, (contributor* & date* & variable+) }
## Types
div {
type = attribute type { item-types }
}
## Identifiers
div {
## The id is an identifier unique to the scope of the file
id = attribute id { token }
## The URI is the global identity for the refererence; used to associate a citation reference to its data
uri = attribute uri { xsd:anyURI }
## the URI for containing items (such as edited books or journals)
container-uri = attribute container-uri { xsd:anyURI }
}
## Contributors
div {
contributor =
element contributor {
attribute type { variables.names },
name-elements
}
name-elements =
element name { text }
| ((element given { text }? &
element family { text }?) &
element dropping-particle { text }? &
element non-dropping-particle { text }? &
element suffix { text }?)
}
## Dates
div {
date =
element date {
attribute type { variables.dates },
attribute circa { xsd:boolean }?,
(date-pattern | date-range)
}
date-pattern =
year-pattern,
( ( month-pattern, day-pattern? ) | season-pattern )?
date-range =
element begin-date { date-pattern },
element end-date { date-pattern }?
year-pattern =
attribute year {
xsd:integer { maxInclusive="-1" }
| xsd:integer { minInclusive="1" }
}
month-pattern =
attribute month { xsd:integer { minInclusive="1" maxInclusive="12" } }
day-pattern =
attribute day { xsd:integer { minInclusive="1" maxInclusive="31" } }
# 1 = Spring, 2 = Summer, 3 = Fall, 4 = Winter
season-pattern =
attribute season { xsd:integer { minInclusive="1" maxInclusive="4" } }
}
## Simple Variables
div {
variable =
element variable {
attribute type { variables.standard },
(simple-variable-pattern | rich-variable-pattern)
}
simple-variable-pattern = text
rich-variable-pattern =
(text
| element abbr { text }
| element b { text }
| element cite {
## cited title which is a part (like an article), and so typically rendered in quotes, rather than italicized
attribute class { "part" }?,
text
}
| element i { text }
| element sc { text }
| element span {
## text whose case should not be transformed (as with proper nouns)
attribute class { "protect" }?,
text
}
| element sup { text }
| element sub { text })+
}