| 1 |
# Schemas describing the Citation Style Language |
| 2 |
|
| 3 |
<!-- |
| 4 |
When editing this file, use line breaks to separate sentences or phrases, rather than wrapping the text at a fixed character count. |
| 5 |
This helps git produce clean diffs and keeps reflowing to minimum. |
| 6 |
More info at https://rhodesmill.org/brandon/2012/one-sentence-per-line/ |
| 7 |
--> |
| 8 |
|
| 9 |
This is the official repository for schemas describing the Citation Style Language (CSL). |
| 10 |
Current schemas include: |
| 11 |
|
| 12 |
* [CSL schema](#csl-schema) - describes CSL style and locale XML files |
| 13 |
* [CSL-JSON schema](#csl-json-schema) - |
| 14 |
describes a commonly used JSON data model for storing CSL processor input |
| 15 |
(such as bibliographic metadata). |
| 16 |
|
| 17 |
For more information about CSL, visit <https://citationstyles.org>. |
| 18 |
For general quesions and discussions have a look at the [CSL-forum](https://discourse.citationstyles.org/). |
| 19 |
|
| 20 |
## CSL Schema |
| 21 |
|
| 22 |
The CSL schema is written in the compact syntax of [RELAX NG](http://relaxng.org/), |
| 23 |
and currently consists of the following files: |
| 24 |
|
| 25 |
* [`csl.rnc`](schemas/styles/csl.rnc) |
| 26 |
* [`csl-categories.rnc`](schemas/styles/csl-categories.rnc) |
| 27 |
* [`csl-terms.rnc`](schemas/styles/csl-terms.rnc) |
| 28 |
* [`csl-types.rnc`](schemas/styles/csl-types.rnc) |
| 29 |
* [`csl-variables.rnc`](schemas/styles/csl-variables.rnc) |
| 30 |
|
| 31 |
CSL style and locale files should be validated against `csl.rnc`, |
| 32 |
which incorporates the content of the other files. |
| 33 |
|
| 34 |
The CSL schema contains several [Schematron](http://www.schematron.com/) rules to make sure all macros called in a CSL style are actually defined. |
| 35 |
Since the popular [Jing](https://github.com/relaxng/jing-trang) XML validator currently ignores embedded Schematron rules, |
| 36 |
we also provide the `csl.sch` Schematron schema, which contains the Schematron rules extracted from the CSL schema. |
| 37 |
Jing users can use `csl.sch` to perform a secondary validation of CSL styles. |
| 38 |
|
| 39 |
## CSL-JSON Schema |
| 40 |
|
| 41 |
The CSL-JSON schema is written in [JSON Schema](http://json-schema.org/), |
| 42 |
and currently consists of the following files: |
| 43 |
|
| 44 |
* [`csl-data.json`](schemas/input/csl-data.json) |
| 45 |
* [`csl-citation.json`](schemas/input/csl-citation.json) |
| 46 |
|
| 47 |
To render citations and bibliographies, CSL processors not only require CSL style and locale files, but also bibliographic metadata. |
| 48 |
The citeproc-js CSL processor [introduced](http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#data-input) a JSON format to store such metadata, |
| 49 |
and this format has since been adopted by various other software products. |
| 50 |
The format, also known as "citeproc-JSON", has been codified in the CSL-JSON Schema. This same schema can be used to validate YAML. |
| 51 |
|
| 52 |
**At this point the CSL-JSON schema is not yet fully normative, and care must be taken to ensure compatibility with other tools built around CSL-JSON.** |
| 53 |
|
| 54 |
Whereas `csl-data.json` describes how the metadata of bibliographic items can be stored, |
| 55 |
`csl-citation.json` incorporates `csl-data.json` and adds an additional layer of information to also describe the context in which bibliographic items are cited. |
| 56 |
This includes information such as the order in which items are cited, |
| 57 |
which items are cited together in a single citation, etc. |
| 58 |
|
| 59 |
## Licensing |
| 60 |
|
| 61 |
This repository is released under the [MIT license](LICENSE.txt). |