relaton-bib 2.0.0.pre.alpha.2 → 2.0.0.pre.alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/CLAUDE.md +96 -0
- data/Gemfile +1 -0
- data/README.adoc +2 -2
- data/grammars/basicdoc.rng +61 -44
- data/grammars/biblio-standoc.rng +37 -56
- data/grammars/biblio.rng +42 -20
- data/lib/relaton/bib/converter/asciibib/to_asciibib.rb +656 -0
- data/lib/relaton/bib/converter/asciibib.rb +13 -0
- data/lib/relaton/bib/converter/bibtex/from_bibtex.rb +245 -0
- data/lib/relaton/bib/converter/bibtex/to_bibtex.rb +339 -0
- data/lib/relaton/bib/converter/bibtex.rb +23 -0
- data/lib/relaton/bib/converter/bibxml/from_rfcxml.rb +384 -0
- data/lib/relaton/bib/converter/bibxml/from_rfcxml_referencegroup.rb +71 -0
- data/lib/relaton/bib/{renderer/rfc.rb → converter/bibxml/to_rfcxml.rb} +95 -91
- data/lib/relaton/bib/converter/bibxml/to_rfcxml_referencegroup.rb +52 -0
- data/lib/relaton/bib/converter/bibxml.rb +51 -0
- data/lib/relaton/bib/hash_parser_v1.rb +103 -66
- data/lib/relaton/bib/item_data.rb +65 -20
- data/lib/relaton/bib/model/date.rb +6 -4
- data/lib/relaton/bib/model/ext.rb +0 -3
- data/lib/relaton/bib/model/ics.rb +9 -0
- data/lib/relaton/bib/model/item.rb +7 -1
- data/lib/relaton/bib/model/item_base.rb +17 -9
- data/lib/relaton/bib/model/subdivision.rb +2 -0
- data/lib/relaton/bib/model/title.rb +38 -0
- data/lib/relaton/bib/model/type/string_date.rb +48 -0
- data/lib/relaton/bib/namespace_helper.rb +21 -0
- data/lib/relaton/bib/version.rb +1 -1
- data/lib/relaton/bib.rb +5 -82
- data/relaton-bib.gemspec +3 -0
- metadata +58 -26
- data/lib/relaton/bib/model/editorial_group.rb +0 -14
- data/lib/relaton/bib/model/technical_committee.rb +0 -14
- data/lib/relaton/bib/model/workgroup.rb +0 -20
- data/lib/relaton/bib/parser/rfc_address.rb +0 -60
- data/lib/relaton/bib/parser/rfc_contacts.rb +0 -35
- data/lib/relaton/bib/parser/rfc_docidentifier.rb +0 -70
- data/lib/relaton/bib/parser/rfc_organization.rb +0 -31
- data/lib/relaton/bib/parser/rfc_person.rb +0 -42
- data/lib/relaton/bib/parser/rfc_reference.rb +0 -143
- data/lib/relaton/bib/parser/rfc_referencegroup.rb +0 -45
- data/lib/relaton/bib/parser/rfc_shared.rb +0 -23
- data/lib/relaton/bib/renderer/bibtex_builder.rb +0 -348
- data/lib/relaton/bibtex_parser.rb +0 -243
- data/lib/relaton/bibxml_parser.rb +0 -419
- data/lib/relaton/deep_dup.rb +0 -30
- data/lib/relaton/hit.rb +0 -52
- data/lib/relaton/hit_collection.rb +0 -105
- data/lib/relaton/workers_pool.rb +0 -43
- data/lib/relaton/xml_parser.rb +0 -716
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c0a55f18c7de55d6551412157acc62414e31ad0f23f692b26aaab429f0958f1
|
|
4
|
+
data.tar.gz: cb1bc25d03c5419e8663532da102899f8720081e54ee3c7ab1c6bc800c74873f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c0b2431f5cbdecacd05074669d0eac38a2c9d783c0fea627d0dbc80f5fdc50a1223ea759715cc85548506039e01b70f88237386f4edb03305299fd47f61b630
|
|
7
|
+
data.tar.gz: d8080d53ebd5cac16d39e480c04c9e8de4e63be8c8d5fb20890f5fdd27dccedf2dce2b862117a8473a7c8f9e00be4865da54f799213363d95717dec23a1b8bda
|
data/.gitignore
CHANGED
|
@@ -11,5 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
# rspec failure tracking
|
|
13
13
|
.rspec_status
|
|
14
|
-
.rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml
|
|
15
14
|
Gemfile.lock
|
|
15
|
+
.claude/
|
|
16
|
+
.rubocop-remote-87c7cdd254a8d09d005ee06efac7acc0.yml
|
|
17
|
+
rubocop-87c7cdd254a8d09d005ee06efac7acc0.yml
|
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
RelatonBib is a Ruby gem that implements the [BibliographicItem model](https://github.com/metanorma/relaton-models#bibliography-uml-models) for bibliographic reference management. It's part of the Relaton ecosystem and serves as the base library for other Relaton gems.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install dependencies
|
|
13
|
+
bundle install
|
|
14
|
+
|
|
15
|
+
# Run all tests
|
|
16
|
+
bundle exec rake spec
|
|
17
|
+
|
|
18
|
+
# Run a single test file
|
|
19
|
+
bundle exec rspec spec/relaton_bib/bibliographic_item_spec.rb
|
|
20
|
+
|
|
21
|
+
# Run a specific test by line number
|
|
22
|
+
bundle exec rspec spec/relaton_bib/bibliographic_item_spec.rb:42
|
|
23
|
+
|
|
24
|
+
# Run linting
|
|
25
|
+
bundle exec rubocop
|
|
26
|
+
|
|
27
|
+
# Auto-fix linting issues
|
|
28
|
+
bundle exec rubocop -a
|
|
29
|
+
|
|
30
|
+
# Interactive console
|
|
31
|
+
bin/console
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Architecture
|
|
35
|
+
|
|
36
|
+
### Serialization Layer (lutaml-model)
|
|
37
|
+
|
|
38
|
+
The codebase uses [lutaml-model](https://github.com/lutaml/lutaml-model) for serialization. Each model class in `lib/relaton/bib/model/` inherits from `Lutaml::Model::Serializable` and declares attributes with XML/YAML/JSON mappings.
|
|
39
|
+
|
|
40
|
+
### Core Classes
|
|
41
|
+
|
|
42
|
+
**`Relaton::Bib::Item`** ([lib/relaton/bib/model/item.rb](lib/relaton/bib/model/item.rb)) - The main serialization class defining all bibliographic attributes and their XML mappings. Uses `ItemData` as its underlying model.
|
|
43
|
+
|
|
44
|
+
**`Relaton::Bib::ItemData`** ([lib/relaton/bib/item_data.rb](lib/relaton/bib/item_data.rb)) - The data container class that holds bibliographic data and provides conversion methods (`to_xml`, `to_yaml`, `to_bibtex`, `to_rfcxml`). This separation allows the same data to be serialized differently (bibitem vs bibdata).
|
|
45
|
+
|
|
46
|
+
**`Relaton::Bib::Bibitem`** and **`Relaton::Bib::Bibdata`** - Variants of `Item` with different XML root elements and attributes (bibitem excludes `ext`, bibdata excludes `id`).
|
|
47
|
+
|
|
48
|
+
### Component Models
|
|
49
|
+
|
|
50
|
+
Each bibliographic attribute has its own class in `lib/relaton/bib/model/`:
|
|
51
|
+
|
|
52
|
+
- `Title`, `LocalizedString`, `LocalizedMarkedUpString` - text with language/script
|
|
53
|
+
- `Contributor`, `Person`, `Organization` - contributors and affiliations
|
|
54
|
+
- `Docidentifier` - document IDs (DOI, ISBN, etc.)
|
|
55
|
+
- `Date` - publication dates with custom `StringDate` type
|
|
56
|
+
- `Relation` - related documents (circular reference with Item)
|
|
57
|
+
- `Ext` - extension data (doctype, ICS codes, structured identifiers)
|
|
58
|
+
|
|
59
|
+
### Parsing
|
|
60
|
+
|
|
61
|
+
- **`HashParserV1`** ([lib/relaton/bib/hash_parser_v1.rb](lib/relaton/bib/hash_parser_v1.rb)) - Converts legacy Hash/YAML format to `ItemData`
|
|
62
|
+
- **`Converter::BibXml`** ([lib/relaton/bib/converter/bibxml.rb](lib/relaton/bib/converter/bibxml.rb)) - Parses RFC BibXML format via `Relaton::Bib::Converter::BibXml.to_item`
|
|
63
|
+
- **lutaml-model native** - `Item.from_xml`, `Item.from_yaml`, `Item.from_json` handle current format
|
|
64
|
+
|
|
65
|
+
### Rendering
|
|
66
|
+
|
|
67
|
+
- **`Renderer::BibtexBuilder`** - Converts `ItemData` to BibTeX format
|
|
68
|
+
- **`Converter::BibXml`** - Converts `ItemData` to RFC XML format via `Relaton::Bib::Converter::BibXml.to_xml`
|
|
69
|
+
- **lutaml-model native** - `to_xml`, `to_yaml`, `to_json` via the serialization classes
|
|
70
|
+
|
|
71
|
+
### Usage Pattern
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
# Parse from YAML
|
|
75
|
+
item = Relaton::Bib::Item.from_yaml(yaml_string)
|
|
76
|
+
|
|
77
|
+
# Parse from XML
|
|
78
|
+
item = Relaton::Bib::Bibitem.from_xml(xml_string)
|
|
79
|
+
item = Relaton::Bib::Bibdata.from_xml(xml_string)
|
|
80
|
+
|
|
81
|
+
# Parse from RFC XML
|
|
82
|
+
item = Relaton::Bib::Converter::BibXml.to_item(xml_string)
|
|
83
|
+
|
|
84
|
+
# Convert to different formats (returns string)
|
|
85
|
+
item.to_xml # as <bibitem>
|
|
86
|
+
item.to_xml(bibdata: true) # as <bibdata>
|
|
87
|
+
item.to_yaml
|
|
88
|
+
item.to_bibtex
|
|
89
|
+
item.to_rfcxml
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Code Style
|
|
93
|
+
|
|
94
|
+
- Follows Ribose OSS Ruby style guide (inherited via `.rubocop.yml`)
|
|
95
|
+
- Target Ruby version: 3.1+
|
|
96
|
+
- Uses YARD documentation comments
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -180,7 +180,7 @@ Relaton::Bib::Item.from_yaml yaml
|
|
|
180
180
|
xml = File.read 'spec/fixtures/rfc.xml'
|
|
181
181
|
=> "<reference anchor=\"RFC1\" target=\"10.17487/RFC0001\">\n <front>\n <title>Title RFC1</title>\n <seriesInf..."
|
|
182
182
|
|
|
183
|
-
Relaton::Bib::
|
|
183
|
+
Relaton::Bib::Converter::BibXml.to_item xml
|
|
184
184
|
=> #<Relaton::Bib::ItemData:0x000000011dc9fc98 ...
|
|
185
185
|
----
|
|
186
186
|
|
|
@@ -202,7 +202,7 @@ item = Relaton::Bib::Bibdata.from_xml xml
|
|
|
202
202
|
|
|
203
203
|
[source,ruby]
|
|
204
204
|
----
|
|
205
|
-
Relaton::Bib::BibtexParser.from_bibtex File.read('spec/
|
|
205
|
+
Relaton::Bib::BibtexParser.from_bibtex File.read('spec/fixtures/techreport.bib')
|
|
206
206
|
=> {"ISOTC211"=>
|
|
207
207
|
#<Relaton::Bib::Item:0x007fedee0a2ab0
|
|
208
208
|
...
|
data/grammars/basicdoc.rng
CHANGED
|
@@ -198,14 +198,14 @@ Applicable to modify and delete</a:documentation>
|
|
|
198
198
|
</zeroOrMore>
|
|
199
199
|
</element>
|
|
200
200
|
</optional>
|
|
201
|
-
<
|
|
201
|
+
<zeroOrMore>
|
|
202
202
|
<element name="description">
|
|
203
|
-
<a:documentation>Description of the change described in this block</a:documentation>
|
|
204
|
-
<
|
|
203
|
+
<a:documentation>Description(s) of the change described in this block</a:documentation>
|
|
204
|
+
<oneOrMore>
|
|
205
205
|
<ref name="BasicBlock"/>
|
|
206
|
-
</
|
|
206
|
+
</oneOrMore>
|
|
207
207
|
</element>
|
|
208
|
-
</
|
|
208
|
+
</zeroOrMore>
|
|
209
209
|
<optional>
|
|
210
210
|
<element name="newcontent">
|
|
211
211
|
<a:documentation>New content to be added to the document; applicable to add and modify</a:documentation>
|
|
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
|
|
|
267
267
|
<value>justified</value>
|
|
268
268
|
</choice>
|
|
269
269
|
</define>
|
|
270
|
+
<define name="IdRefType">
|
|
271
|
+
<a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
|
|
272
|
+
<data type="IDREF"/>
|
|
273
|
+
</define>
|
|
270
274
|
<define name="RequiredId">
|
|
271
275
|
<a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
|
|
272
276
|
<attribute name="id">
|
|
@@ -382,33 +386,7 @@ in a document (e.g. sourcecode annotations)</a:documentation>
|
|
|
382
386
|
<a:documentation>Block intended to capture reviewer comments about some text in the document</a:documentation>
|
|
383
387
|
<element name="review">
|
|
384
388
|
<ref name="RequiredId"/>
|
|
385
|
-
<
|
|
386
|
-
<a:documentation>The party who has offered the comment</a:documentation>
|
|
387
|
-
</attribute>
|
|
388
|
-
<optional>
|
|
389
|
-
<attribute name="type">
|
|
390
|
-
<a:documentation>The type of reviewer comment</a:documentation>
|
|
391
|
-
</attribute>
|
|
392
|
-
</optional>
|
|
393
|
-
<optional>
|
|
394
|
-
<attribute name="date">
|
|
395
|
-
<a:documentation>The date when the comment was made</a:documentation>
|
|
396
|
-
<data type="dateTime"/>
|
|
397
|
-
</attribute>
|
|
398
|
-
</optional>
|
|
399
|
-
<optional>
|
|
400
|
-
<attribute name="from">
|
|
401
|
-
<a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
|
|
402
|
-
If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
|
|
403
|
-
<data type="IDREF"/>
|
|
404
|
-
</attribute>
|
|
405
|
-
</optional>
|
|
406
|
-
<optional>
|
|
407
|
-
<attribute name="to">
|
|
408
|
-
<a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
|
|
409
|
-
<data type="IDREF"/>
|
|
410
|
-
</attribute>
|
|
411
|
-
</optional>
|
|
389
|
+
<ref name="ReviewAttributes"/>
|
|
412
390
|
<oneOrMore>
|
|
413
391
|
<ref name="paragraph">
|
|
414
392
|
<a:documentation>Reviewer comments content</a:documentation>
|
|
@@ -416,6 +394,35 @@ If not provided, the comment applies in the vicinity of the place it has been in
|
|
|
416
394
|
</oneOrMore>
|
|
417
395
|
</element>
|
|
418
396
|
</define>
|
|
397
|
+
<define name="ReviewAttributes">
|
|
398
|
+
<attribute name="reviewer">
|
|
399
|
+
<a:documentation>The party who has offered the comment</a:documentation>
|
|
400
|
+
</attribute>
|
|
401
|
+
<optional>
|
|
402
|
+
<attribute name="type">
|
|
403
|
+
<a:documentation>The type of reviewer comment</a:documentation>
|
|
404
|
+
</attribute>
|
|
405
|
+
</optional>
|
|
406
|
+
<optional>
|
|
407
|
+
<attribute name="date">
|
|
408
|
+
<a:documentation>The date when the comment was made</a:documentation>
|
|
409
|
+
<data type="dateTime"/>
|
|
410
|
+
</attribute>
|
|
411
|
+
</optional>
|
|
412
|
+
<optional>
|
|
413
|
+
<attribute name="from">
|
|
414
|
+
<a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
|
|
415
|
+
If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
|
|
416
|
+
<ref name="IdRefType"/>
|
|
417
|
+
</attribute>
|
|
418
|
+
</optional>
|
|
419
|
+
<optional>
|
|
420
|
+
<attribute name="to">
|
|
421
|
+
<a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
|
|
422
|
+
<ref name="IdRefType"/>
|
|
423
|
+
</attribute>
|
|
424
|
+
</optional>
|
|
425
|
+
</define>
|
|
419
426
|
<define name="NumberingAttributes">
|
|
420
427
|
<optional>
|
|
421
428
|
<attribute name="unnumbered">
|
|
@@ -857,6 +864,7 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
|
|
|
857
864
|
<define name="tr">
|
|
858
865
|
<a:documentation>Sequence of cells to be displayed as a row in a table</a:documentation>
|
|
859
866
|
<element name="tr">
|
|
867
|
+
<ref name="TrAttributes"/>
|
|
860
868
|
<oneOrMore>
|
|
861
869
|
<choice>
|
|
862
870
|
<ref name="td">
|
|
@@ -869,6 +877,9 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
|
|
|
869
877
|
</oneOrMore>
|
|
870
878
|
</element>
|
|
871
879
|
</define>
|
|
880
|
+
<define name="TrAttributes">
|
|
881
|
+
<empty/>
|
|
882
|
+
</define>
|
|
872
883
|
<define name="tr-no-id">
|
|
873
884
|
<a:documentation>Sequence of cells to be displayed as a row in a table: optional ID attributes recursively (for use in Relaton, metadata)</a:documentation>
|
|
874
885
|
<element name="tr">
|
|
@@ -1280,13 +1291,13 @@ Restricted recursively to contain only other such inline elements with no identi
|
|
|
1280
1291
|
<ref name="pure_strike"/>
|
|
1281
1292
|
<ref name="pure_smallcap"/>
|
|
1282
1293
|
<ref name="br"/>
|
|
1294
|
+
<ref name="stem"/>
|
|
1283
1295
|
</choice>
|
|
1284
1296
|
</define>
|
|
1285
1297
|
<define name="NestedTextElement">
|
|
1286
1298
|
<a:documentation>Contents of TextElement tags: leaves out tags that should occur only at top level of block: bookmark image hr pagebreak</a:documentation>
|
|
1287
1299
|
<choice>
|
|
1288
1300
|
<ref name="PureTextElement"/>
|
|
1289
|
-
<ref name="stem"/>
|
|
1290
1301
|
<ref name="eref"/>
|
|
1291
1302
|
<ref name="xref"/>
|
|
1292
1303
|
<ref name="hyperlink"/>
|
|
@@ -1497,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
|
|
|
1497
1508
|
<attribute name="to">
|
|
1498
1509
|
<a:documentation>A reference to an anchor element (typically a bookmark),
|
|
1499
1510
|
to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
|
|
1500
|
-
<
|
|
1511
|
+
<ref name="IdRefType"/>
|
|
1501
1512
|
</attribute>
|
|
1502
1513
|
</optional>
|
|
1503
1514
|
<ref name="index-primary">
|
|
@@ -1655,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
|
|
|
1655
1666
|
<define name="XrefAttributes">
|
|
1656
1667
|
<attribute name="target">
|
|
1657
1668
|
<a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
|
|
1658
|
-
<
|
|
1669
|
+
<ref name="IdRefType"/>
|
|
1659
1670
|
</attribute>
|
|
1660
1671
|
<optional>
|
|
1661
1672
|
<attribute name="type">
|
|
@@ -1694,23 +1705,29 @@ which can be bookmarks as well as block or section references</a:documentation>
|
|
|
1694
1705
|
<a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
|
|
1695
1706
|
The target of a footnote is the location it is embedded in within the text</a:documentation>
|
|
1696
1707
|
<element name="fn">
|
|
1697
|
-
<
|
|
1698
|
-
|
|
1699
|
-
</attribute>
|
|
1700
|
-
<oneOrMore>
|
|
1701
|
-
<ref name="paragraph">
|
|
1702
|
-
<a:documentation>The content of the footnote</a:documentation>
|
|
1703
|
-
</ref>
|
|
1704
|
-
</oneOrMore>
|
|
1708
|
+
<ref name="FnAttributes"/>
|
|
1709
|
+
<ref name="FnBody"/>
|
|
1705
1710
|
</element>
|
|
1706
1711
|
</define>
|
|
1712
|
+
<define name="FnBody">
|
|
1713
|
+
<oneOrMore>
|
|
1714
|
+
<ref name="paragraph">
|
|
1715
|
+
<a:documentation>The content of the footnote</a:documentation>
|
|
1716
|
+
</ref>
|
|
1717
|
+
</oneOrMore>
|
|
1718
|
+
</define>
|
|
1719
|
+
<define name="FnAttributes">
|
|
1720
|
+
<attribute name="reference">
|
|
1721
|
+
<a:documentation>The number of the footnote, used to identify it visually</a:documentation>
|
|
1722
|
+
</attribute>
|
|
1723
|
+
</define>
|
|
1707
1724
|
<define name="callout">
|
|
1708
1725
|
<a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
|
|
1709
1726
|
<element name="callout">
|
|
1710
1727
|
<attribute name="target">
|
|
1711
1728
|
<a:documentation>The target of the callout is understood to be the location of the callout within the source code;
|
|
1712
1729
|
the extent of the target is not expressed overtly</a:documentation>
|
|
1713
|
-
<
|
|
1730
|
+
<ref name="IdRefType"/>
|
|
1714
1731
|
</attribute>
|
|
1715
1732
|
<text>
|
|
1716
1733
|
<a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
|
data/grammars/biblio-standoc.rng
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
|
|
3
|
-
<!--
|
|
4
|
-
Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
|
|
5
|
-
of relaton
|
|
6
|
-
|
|
7
|
-
Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
|
|
8
|
-
(SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
|
|
9
|
-
-->
|
|
10
3
|
<include href="biblio.rng">
|
|
4
|
+
<!-- ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix -->
|
|
5
|
+
<!--
|
|
6
|
+
Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
|
|
7
|
+
of relaton
|
|
8
|
+
|
|
9
|
+
Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
|
|
10
|
+
(SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
|
|
11
|
+
-->
|
|
11
12
|
<define name="BibData">
|
|
12
13
|
<a:documentation>The bibliographic description of a standardisation document</a:documentation>
|
|
13
14
|
<ref name="StandardBibliographicItem"/>
|
|
@@ -75,12 +76,6 @@ from other documents in the same doctype</a:documentation>
|
|
|
75
76
|
<ref name="flavor">
|
|
76
77
|
<a:documentation>Flavour of Metanorma used to process this document</a:documentation>
|
|
77
78
|
</ref>
|
|
78
|
-
<optional>
|
|
79
|
-
<ref name="editorialgroup">
|
|
80
|
-
<a:documentation>Groups associated with the production of the standards document, typically within
|
|
81
|
-
a standards definition organization</a:documentation>
|
|
82
|
-
</ref>
|
|
83
|
-
</optional>
|
|
84
79
|
<zeroOrMore>
|
|
85
80
|
<ref name="ics">
|
|
86
81
|
<a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
|
|
@@ -91,6 +86,9 @@ a standards definition organization</a:documentation>
|
|
|
91
86
|
<a:documentation>Representation of the identifier for the standardisation document, giving its individual semantic components</a:documentation>
|
|
92
87
|
</ref>
|
|
93
88
|
</zeroOrMore>
|
|
89
|
+
<ref name="DocumentImages">
|
|
90
|
+
<a:documentation>Coverpage and other images to be rendered with document</a:documentation>
|
|
91
|
+
</ref>
|
|
94
92
|
</define>
|
|
95
93
|
<define name="doctype">
|
|
96
94
|
<a:documentation>Classification of the standardisation document</a:documentation>
|
|
@@ -126,49 +124,6 @@ a standards definition organization</a:documentation>
|
|
|
126
124
|
However we prefer not to hardcode it, given ongoing extension.</a:documentation>
|
|
127
125
|
<text/>
|
|
128
126
|
</define>
|
|
129
|
-
<define name="editorialgroup">
|
|
130
|
-
<a:documentation>A group associated with the production of the standards document, typically within
|
|
131
|
-
a standards definition organization</a:documentation>
|
|
132
|
-
<element name="editorialgroup">
|
|
133
|
-
<oneOrMore>
|
|
134
|
-
<ref name="technical-committee">
|
|
135
|
-
<a:documentation>A technical committee associated with the production of the standards document</a:documentation>
|
|
136
|
-
</ref>
|
|
137
|
-
</oneOrMore>
|
|
138
|
-
</element>
|
|
139
|
-
</define>
|
|
140
|
-
<define name="technical-committee">
|
|
141
|
-
<a:documentation>Technical committee associated with the production of a standards document</a:documentation>
|
|
142
|
-
<element name="technical-committee">
|
|
143
|
-
<ref name="IsoWorkgroup"/>
|
|
144
|
-
</element>
|
|
145
|
-
</define>
|
|
146
|
-
<define name="IsoWorkgroup">
|
|
147
|
-
<optional>
|
|
148
|
-
<attribute name="number">
|
|
149
|
-
<a:documentation>Numeric identifier of the technical committee</a:documentation>
|
|
150
|
-
</attribute>
|
|
151
|
-
</optional>
|
|
152
|
-
<optional>
|
|
153
|
-
<attribute name="type">
|
|
154
|
-
<a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
|
|
155
|
-
</attribute>
|
|
156
|
-
</optional>
|
|
157
|
-
<optional>
|
|
158
|
-
<attribute name="identifier">
|
|
159
|
-
<a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
|
|
160
|
-
</attribute>
|
|
161
|
-
</optional>
|
|
162
|
-
<optional>
|
|
163
|
-
<attribute name="prefix">
|
|
164
|
-
<a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
|
|
165
|
-
typically indicating its type</a:documentation>
|
|
166
|
-
</attribute>
|
|
167
|
-
</optional>
|
|
168
|
-
<text>
|
|
169
|
-
<a:documentation>Name of the technical committee</a:documentation>
|
|
170
|
-
</text>
|
|
171
|
-
</define>
|
|
172
127
|
<define name="ics">
|
|
173
128
|
<a:documentation>Classification taken from the International Classification of Standards.
|
|
174
129
|
ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
|
|
@@ -268,6 +223,32 @@ and not those document components</a:documentation>
|
|
|
268
223
|
</optional>
|
|
269
224
|
</element>
|
|
270
225
|
</define>
|
|
226
|
+
<define name="DocumentImages">
|
|
227
|
+
<zeroOrMore>
|
|
228
|
+
<element name="coverpage-image">
|
|
229
|
+
<a:documentation>Images to be displayed on the coverpage of the document</a:documentation>
|
|
230
|
+
<ref name="image-no-id"/>
|
|
231
|
+
</element>
|
|
232
|
+
</zeroOrMore>
|
|
233
|
+
<zeroOrMore>
|
|
234
|
+
<element name="innercoverpage-image">
|
|
235
|
+
<a:documentation>Images to be displayed on the inner coverpage of the document</a:documentation>
|
|
236
|
+
<ref name="image-no-id"/>
|
|
237
|
+
</element>
|
|
238
|
+
</zeroOrMore>
|
|
239
|
+
<zeroOrMore>
|
|
240
|
+
<element name="tocside-image">
|
|
241
|
+
<a:documentation>Images to be displayed on the Table of Contents page of the document</a:documentation>
|
|
242
|
+
<ref name="image-no-id"/>
|
|
243
|
+
</element>
|
|
244
|
+
</zeroOrMore>
|
|
245
|
+
<zeroOrMore>
|
|
246
|
+
<element name="backpage-image">
|
|
247
|
+
<a:documentation>Images to be displayed on the backpage of the document</a:documentation>
|
|
248
|
+
<ref name="image-no-id"/>
|
|
249
|
+
</element>
|
|
250
|
+
</zeroOrMore>
|
|
251
|
+
</define>
|
|
271
252
|
<define name="StandardBibliographicItem">
|
|
272
253
|
<ref name="BibliographicItem"/>
|
|
273
254
|
<zeroOrMore>
|
data/grammars/biblio.rng
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!--
|
|
3
|
-
instantiations of this grammar may replace leaf strings
|
|
4
|
-
with more elaborated types; e.g. title (text) replaced with
|
|
5
|
-
title-main, title-intro, title-part; type replaced with
|
|
6
|
-
enum.
|
|
7
|
-
|
|
8
|
-
some renaming at leaf nodes is permissible
|
|
9
|
-
|
|
10
|
-
obligations can change both from optional to mandatory,
|
|
11
|
-
and from mandatory to optional; optional elements may
|
|
12
|
-
be omitted; freely positioned alternatives may be replaced
|
|
13
|
-
with strict ordering
|
|
14
|
-
|
|
15
|
-
DO NOT introduce a namespace here. We do not want a distinct namespace
|
|
16
|
-
for these elements, and a distinct namespace for any grammar inheriting
|
|
17
|
-
these elements; we just want one namespace for any child grammars
|
|
18
|
-
of this.
|
|
19
|
-
-->
|
|
20
2
|
<grammar 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">
|
|
3
|
+
<!--
|
|
4
|
+
ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix
|
|
5
|
+
|
|
6
|
+
Instantiations of this grammar may replace leaf strings
|
|
7
|
+
with more elaborated types; e.g. title (text) replaced with
|
|
8
|
+
title-main, title-intro, title-part; type replaced with
|
|
9
|
+
enum.
|
|
10
|
+
|
|
11
|
+
Some renaming at leaf nodes is permissible
|
|
12
|
+
|
|
13
|
+
Obligations can change both from optional to mandatory,
|
|
14
|
+
and from mandatory to optional; optional elements may
|
|
15
|
+
be omitted; freely positioned alternatives may be replaced
|
|
16
|
+
with strict ordering
|
|
17
|
+
|
|
18
|
+
DO NOT introduce a namespace here. We do not want a distinct namespace
|
|
19
|
+
for these elements, and a distinct namespace for any grammar inheriting
|
|
20
|
+
these elements; we just want one namespace for any child grammars
|
|
21
|
+
of this.
|
|
22
|
+
-->
|
|
21
23
|
<!--
|
|
22
24
|
https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
|
|
23
25
|
iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
|
|
@@ -240,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
|
|
|
240
242
|
</choice>
|
|
241
243
|
</define>
|
|
242
244
|
<define name="roledescription">
|
|
245
|
+
<a:documentation>A more detailed description of the role of the contributor
|
|
246
|
+
Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
|
|
243
247
|
<element name="description">
|
|
244
248
|
<ref name="LocalizedMarkedUpString"/>
|
|
245
249
|
</element>
|
|
@@ -441,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
|
|
|
441
445
|
</oneOrMore>
|
|
442
446
|
<zeroOrMore>
|
|
443
447
|
<ref name="subdivision">
|
|
444
|
-
<a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item
|
|
448
|
+
<a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
|
|
449
|
+
Multiple subdivisions can be specified for an organization, with no implication of hierarchical
|
|
450
|
+
relation between them
|
|
451
|
+
Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
|
|
445
452
|
</ref>
|
|
446
453
|
</zeroOrMore>
|
|
447
454
|
<optional>
|
|
@@ -483,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
|
|
|
483
490
|
<a:documentation>The type of subdivision</a:documentation>
|
|
484
491
|
</attribute>
|
|
485
492
|
</optional>
|
|
493
|
+
<optional>
|
|
494
|
+
<attribute name="subtype">
|
|
495
|
+
<a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
|
|
496
|
+
</attribute>
|
|
497
|
+
</optional>
|
|
486
498
|
<ref name="OrganizationType">
|
|
487
499
|
<a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
|
|
488
500
|
</ref>
|
|
@@ -857,7 +869,7 @@ depending on whether the items exist as independent documents, or are parts of a
|
|
|
857
869
|
</zeroOrMore>
|
|
858
870
|
</element>
|
|
859
871
|
</define>
|
|
860
|
-
<define name="BibItemType"
|
|
872
|
+
<define name="BibItemType">
|
|
861
873
|
<a:documentation>Type of bibliographic item.
|
|
862
874
|
The value list complies with the types provided in ISO 690:2021.
|
|
863
875
|
NOTE: These values represent a strict superset to BibTeX
|
|
@@ -1241,6 +1253,11 @@ Refer to `BibliographicItem` for definitions</a:documentation>
|
|
|
1241
1253
|
</define>
|
|
1242
1254
|
<define name="formattedref">
|
|
1243
1255
|
<element name="formattedref">
|
|
1256
|
+
<optional>
|
|
1257
|
+
<attribute name="format">
|
|
1258
|
+
<a:documentation>format of formatted reference; Metanorma assumes references are formatted as Metanorma XML</a:documentation>
|
|
1259
|
+
</attribute>
|
|
1260
|
+
</optional>
|
|
1244
1261
|
<oneOrMore>
|
|
1245
1262
|
<ref name="TextElement"/>
|
|
1246
1263
|
</oneOrMore>
|
|
@@ -1812,6 +1829,11 @@ May be used to differentiate rendering of notes in bibliographies</a:documentati
|
|
|
1812
1829
|
<a:documentation>Abstract of bibliographic item</a:documentation>
|
|
1813
1830
|
<element name="abstract">
|
|
1814
1831
|
<ref name="LocalizedStringAttributes"/>
|
|
1832
|
+
<optional>
|
|
1833
|
+
<attribute name="format">
|
|
1834
|
+
<a:documentation>What format the formatted abstract is in. In Metanorma, assumed to be Metanorma XML</a:documentation>
|
|
1835
|
+
</attribute>
|
|
1836
|
+
</optional>
|
|
1815
1837
|
<choice>
|
|
1816
1838
|
<oneOrMore>
|
|
1817
1839
|
<ref name="BasicBlockNoId">
|