CesiumGS / 3d-tiles

Specification for streaming massive heterogeneous 3D geospatial datasets :earth_americas:
2.04k stars 459 forks source link

Experiments for OGC standard template #700

Closed javagl closed 2 years ago

javagl commented 2 years ago

For now, this inserts only the header from the community standard template.

Assuming that you already can run "Metanorma", the command line

metanorma compile --agree-to-terms -t ogc -x html,pdf Specification.adoc

should generate a PDF file (the HTML output is still broken...)

Build instructions will be added here or in the BUILDING.md soon. Fow now, I can only give the recommendation to NOT install Metanorma, but instead, use the Docker container. (Details of how to use the Docker container to build the specs will also be added, as soon as I have figured that one out...)

A preliminary list of TODOs, derived from warnings or issues during the build process:

javagl commented 2 years ago

The recent commits address some of the issues above:

Some further fixes are PRELIMINARY and have to be reviewed:

lilleyse commented 2 years ago

@javagl the guidance document linked in https://docs.ogc.org/pol/05-020r27/05-020r27.html#main-steps-in-the-standard-process goes into more detail about the preface/scope:

Documents being submitted as Full standards shall use the document formatting and content, in common use by the OGC at the time of submission, of standards submitted under the OGC Consensus Standards process. There is a detailed guidance document for using the template.

Documents being submitted as Community standards do not need to follow the OGC document template for an OGC standard. However, the submission team for a Community standard is strongly encouraged to provide the candidate standard to the OGC using the document template.

You might be able to reference the 3D Tiles 1.0 submission too: https://github.com/CesiumGS/3d-tiles/blob/main/specification/specification.pdf

javagl commented 2 years ago

There have been some updates

  1. Added "Terms And Definitions"
  2. Added "References"
  3. Extended "Revision History"

This is largely based on the 3D Tiles 1.0 spec from https://github.com/metanorma/mn-samples-ogc/blob/main/sources/18-053r2/ , so they may be incomplete (i.e. we should check which additional entries 1. and 2. need , and keep an eye on https://www.metanorma.org/author/ogc/authoring-guide/terms-definitions/#entering-terminology-entries ).

The Revision History is taken from 1.0 - I assume that this should be done, because we are in fact only updating the 1.0 specification.


There have been some tweaks in the section structure, trying to minimize the number of warnings (and make sections appear properly in the TOC), but ... a "warning-free" state might be an unachievable ideal. (I'm not even talking about the ~100 "Matenorma XML syntax" warnings, but the "coarse-grained" ones that indicate wrong section orders, regardless of the order of the sections...)


A spec-lawyer detail: https://www.metanorma.org/author/ogc/topics/markup/ says

Where section obligations are named (i.e. in annex names), they are only given as “normative” or “informative”; the alternate text of “non-normative” is disallowed.

While this only seems to refer the whole sections, we are declaring inlined sections (implementation examples) as 'non-normative' (and use the term "Implementation Note" occasionally to declare non-normativeness). Should that be changed/reviewed?

javagl commented 2 years ago

I'll mark this as 'Ready for review' for now.

EDIT: One possibly important thing is the information in the document header, like the 'Submission date' or 'document identifiers'. We don't know them for now, I guess.

The mandatory sections for Metanorma/OGC have been inserted and filled, even though they may require polishing. For example, the 'Normative References' and 'Terms And Definitions' are largely taken from 3D Tiles 1.0. I have added some terms (from Metadata and Implicit Tiling), but they still may have to be extended or reviewed in terms of their actual 'normative-ness' and details of the wording.

Currently, the "Property Reference" is marked as the only 'normative' appendix, because it is the only sensible summary of all structures and their properties. (Most of them are described in the actual spec text, but not as formally/technically as in the properties reference). The 'Conformance' section explicitly links to the 'Properties Reference' as part of the definition of 'conformance'.

The changes that have been done in this branch are made under the assumption that the final document will be created with Metanorma. It is still possible to run the plain, 'old' asciidoctor on the current state, and the output looks somewhat OK, but if the intention was (medium-term) to create a "nice" document with plain asciidoctor, then some of the OCG sections (submitters, conformance...) might be omitted. This would be possible with some asciidoctor --attribute create-ocg-version.... command line flag, but that's probably not pressing right now.

lilleyse commented 2 years ago

I'm seeing a bunch of warnings from metanorma. Which of these need to be addressed and which are just noise?

(base) slilley@Hydrogen:~/Code/3d-tiles/specification$ docker run -v "$(pwd)":/metanorma -v ${HOME}/.fontist/fonts/:/config/fonts metanorma/metanorma metanorma compile --agree-to-terms -t ogc -x html,pdf Specification.adoc
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
[relaton] EPSG WGS-84-3 does not have a recognised prefix
[relaton] Khronos Group glTF 2.0 does not have a recognised prefix
[relaton-w3c] ("W3C css-color-3") fetching...
[relaton-ietf] ("IETF RFC 2397") fetching...
[relaton-ogc] ("OGC 12-063r5") fetching...
[relaton-ietf] ("IETF RFC 2397") found RFC 2397
[relaton-ogc] ("OGC 12-063r5") found 12-063r5
[relaton-ietf] ("IETF RFC 3629") fetching...
[relaton-w3c] ("W3C css-color-3") found css-color-3
[relaton-ietf] ("IETF RFC 3629") found RFC 3629
[relaton-ietf] ("IETF RFC 3986") fetching...
[relaton-ietf] ("IETF RFC 3986") found RFC 3986
[relaton] EPSG WGS-84-3 does not have a recognised prefix
[relaton] Khronos Group glTF 2.0 does not have a recognised prefix
Style: Preface is missing!
Metanorma XML Style Warning: (XML Line 000428): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000454): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000493): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000679): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000908): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001008): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001129): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001361): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001500): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001612): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001643): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001662): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001849): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001862): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001931): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001944): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 001997): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002045): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002132): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002151): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002209): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002314): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002346): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002383): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002459): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002503): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002516): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002567): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002671): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002716): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002742): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002936): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 002951): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003122): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003261): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003277): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003365): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003414): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003808): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003831): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003874): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 003927): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 004728): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 004769): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 004839): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 005201): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 005371): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006013): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006097): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006207): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006291): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006494): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006593): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006698): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006820): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 006929): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 007277): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 007395): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 007494): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 007631): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 007758): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008063): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008153): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008417): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008507): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008771): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008855): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 008979): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009196): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009250): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009414): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009489): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009581): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009761): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009905): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 009996): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 010052): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 010246): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 010326): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 010546): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 010671): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 012907): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 013125): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 013145): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 013254): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 013266): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000018): Figure should have title
Metanorma XML Style Warning: (XML Line 000018): Figure should have title
Metanorma XML Style Warning: (XML Line 000024): Table should have title
Metanorma XML Style Warning: (XML Line 003890): Table should have title
Metanorma XML Style Warning: (XML Line 003963): Table should have title
Metanorma XML Style Warning: (XML Line 003975): Table should have title
Metanorma XML Style Warning: (XML Line 004195): Table should have title
Metanorma XML Style Warning: (XML Line 004414): Table should have title
Metanorma XML Style Warning: (XML Line 004428): Table should have title
Metanorma XML Style Warning: (XML Line 013874): Table should have title
Metanorma XML Syntax: (XML Line 000140:104): element "clause" not allowed here; expected element "foreword"
Metanorma XML Syntax: (XML Line 000140:290): element "submitters" not allowed yet; missing required element "foreword"
Metanorma XML Syntax: (XML Line 000193:174): element "fn" not allowed here; expected the element end-tag, text or element "add", "bookmark", "br", "concept", "del", "em", "eref", "hi", "hr", "image", "index", "index-xref", "keyword", "link", "note", "pagebreak", "ruby", "smallcap", "span", "stem", "strike", "strong", "sub", "sup", "svg", "tt", "underline" or "xref"
Metanorma XML Syntax: (XML Line 000236:330): element "fn" not allowed here; expected the element end-tag, text or element "add", "bookmark", "br", "concept", "del", "em", "eref", "hi", "hr", "image", "index", "index-xref", "keyword", "link", "note", "pagebreak", "ruby", "smallcap", "span", "stem", "strike", "strong", "sub", "sup", "svg", "tt", "underline" or "xref"
Metanorma XML Syntax: (XML Line 003258:47): element "p" not allowed here; expected the element end-tag
Metanorma XML Syntax: (XML Line 003456:52): element "figure" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 003956:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004031:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004043:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004263:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004411:52): element "figure" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004456:52): element "figure" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004463:52): element "figure" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004482:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 004496:51): element "table" not allowed here; expected the element end-tag or element "dl", "formula", "ol", "p", "quote", "sourcecode" or "ul"
Metanorma XML Syntax: (XML Line 014042:123): element "docidentifier" not allowed yet; missing required element "title"
Metanorma XML Syntax: (XML Line 014076:145): element "docidentifier" not allowed yet; missing required element "title"
java -Xss5m -Xmx2048m -jar /usr/local/bundle/gems/mn2pdf-1.47/lib/../bin/mn2pdf.jar --xml-file "/metanorma/Specification.presentation.xml" --xsl-file "/usr/local/bundle/gems/metanorma-ogc-2.1.3/lib/isodoc/ogc/ogc.community-standard.xsl" --pdf-file "/metanorma/Specification.pdf" --syntax-highlight  --font-manifest "/tmp/fontist_locations20220627-1-sarrz9.yml"
javagl commented 2 years ago

As mentioned above: A "warning-free" state might be an unachievable ideal.

But to roughly categorize the messages


[relaton] EPSG WGS-84-3 does not have a recognised prefix [relaton] Khronos Group glTF 2.0 does not have a recognised prefix

This refers to the functionality of auto-fetching reference information for certain types of references (e.g. for ISO standard references or so). We might change the reference to use one of the "known reference repository identifiers", but I think this is mainly a convenience, compared to manually defining it.


Style: Preface is missing! ... required element "foreword"

We can add a section called Preface and 'Foreword'. I don't know what it should contain, though. The "Abstract", "Scope" and "Conformance" already felt a bit handwaving...


... element "table" not allowed here; expected ... ... element "figure" not allowed here; expected ...

These seem to be mostly caused by the cases where we have tables and images in admonitions (i.e. in the 'Note'-blocks). Why it prints a warning for that? I don't know...


Hanging paragraph in clause ... element ... not allowed here; ...

🤷‍♂️

I can look at the code/rule that generated this message, and I can look at the XML to see the offending elements, but I don't know why they are not allowed there, or where these elements come from in the first place.

From my understanding, the approach of Metanorma, on the oversimplified level, is

  1. Take any input (HTML, ADOC, MD, DOC, ...)
  2. Convert it into an 'XML to rule them all'
  3. Perform some sanity checks on the XML
  4. Use the XML to generate any output (HTML, PDF, DOC, ...)

Now, many things can go wrong there. I did not yet go down to the level where I'd try to debug the Ruby code that is running inside the Docker container or so. But I can investigate these warnings, on demand...

javagl commented 2 years ago

An aside: In the command line that is used for creating the specs, one can add

... -x html,pdf,xml
                ^ this

in order to retain this XML file that the warnings refer to.

lilleyse commented 2 years ago

The Revision History is taken from 1.0 - I assume that this should be done, because we are in fact only updating the 1.0 specification.

I think revision history is specific to the document based on what I've seen in other OGC specs. So the table should have a single row with a description like "This is the first normative version of this document."

While this only seems to refer the whole sections, we are declaring inlined sections (implementation examples) as 'non-normative' (and use the term "Implementation Note" occasionally to declare non-normativeness). Should that be changed/reviewed?

Yeah, let's change the wording to "informative" everywhere.

Other comments:

lilleyse commented 2 years ago

The HTML output seems to be missing "List of Tables" and "List of Figures" (possibly a bug in the HTML generator since there's no table of contents in the HTML output?). Most likely out of our control.

javagl commented 2 years ago

I took a look at OGC Policy Directive 49 - we should try to use the same language wherever possible. The biggest thing is changing "must" to "shall" everywhere.

The word 'must' appears 209 times in the specification. I can go through these and see which of them must shall be changed. But many of them appear in the properties reference, so this may rather be an issue of https://github.com/CesiumGS/wetzel/blob/82890df68ae4c24c5679196c06e3afccd6673a30/lib/style.js#L132 ...


An aside: Among the XML warnings is one

element "fn" not allowed

This is caused by footnotes. In the PDF, footnotes appear at the bottom of the page. In the HTML, they appear ... at the bottom ... of ... everything. I think we should avoid footnotes, and just use a plain link instead (there are only 2 of them).

javagl commented 2 years ago

I'm still wondering about all the "Hanging paragraph in clause" messages. If someone who knows Ruby can decipher what it is actually checking here https://www.rubydoc.info/gems/metanorma-standoc/1.9.3/Asciidoctor/Standoc/Validate#hanging_para_style-instance_method that could help.

For a moment, I thought that it might actually complain about "empty" clauses: From other standardization efforts, I know that it is sometimes considered to be problematic to have sections like


1. Section

1.1. First Subsection

Some text here

1.2. Second Subsection

More text here


because there is no text in 'Section 1' (but only in the Subsections), and there should always be some text, like


1. Section

Now here is some text that sets the stage for the following subsections

1.1. First Subsection

Some text here

1.2. Second Subsection

More text here


(We could do this anyhow, but from a first quick test, that's not what Metanorma complains about ...)

lilleyse commented 2 years ago

@javagl I pushed some commits:

javagl commented 2 years ago

💡 this "MIME type" vs. "madia type" change was only applied to the .MD files. Sorry about that.

lilleyse commented 2 years ago

Hmm... so we can't control where the Future Work section goes? It doesn't feel right to include it in the main spec body when it really belongs in the preliminary sections. That seems to be the convention for other specs too.

lilleyse commented 2 years ago

The word 'must' appears 209 times in the specification. I can go through these and see which of them must shall be changed. But many of them appear in the properties reference, so this may rather be an issue of https://github.com/CesiumGS/wetzel/blob/82890df68ae4c24c5679196c06e3afccd6673a30/lib/style.js#L132 ...

Yeah let's update all those, including the wetzel branch (and regenerate the property reference)

javagl commented 2 years ago

Apparently, it can be tagged as [.preface] - from https://www.metanorma.org/author/ogc/authoring-guide/sections-ogc/#ogc-additional-prelim - which is "allowed but not encouraged"...

Metanorma Future Work

So it could be done, if desired...

javagl commented 2 years ago

The point about wetzel: Sorry, I said something that was ... essentially wrong there. Wetzel does insert the "must-keyword" at some places, but there is nothing to fix in wetzel itself - just to add -k "shall" to the command line.

Beyond that, most appearances of 'must' are from the description in the schema, so this will indeed be a rather manual process.

(I can tackle that a bit later today)

lilleyse commented 2 years ago

Apparently, it can be tagged as [.preface] - from https://www.metanorma.org/author/ogc/authoring-guide/sections-ogc/#ogc-additional-prelim - which is "allowed but not encouraged"...

Let's do it. Even the OGC Standard for Modular specifications includes it in the preliminary sections.

javagl commented 2 years ago

The change from 'must' to 'shall' was done in the last commits. (It could largely have been done with a "Replace all", but I did it manually. I also changed it in 'Informative' sections, even though it should not matter there...)

Being aware of similar requirements ( https://datatracker.ietf.org/doc/html/rfc2119 ), the wording in most parts of the specification text SHOULD already be reasonably precise in terms of the exact meaning of these keywords, but I think that it has not been reviewed explicitly in this regard.

lilleyse commented 2 years ago

I did a quick final pass over the HTML and PDF. I don't think there's anything left to add here. Thanks @javagl!

javagl commented 2 years ago

For a moment, I thought that it might actually complain about "empty" clauses: From other standardization efforts, I know that it is sometimes considered to be problematic to have sections like ...

Another thing that might come up in terms of ~"broad, editorial/typesetting practices" is that we often do not refer to images and tables in the text. As far as I know, patterns like

Some data can be stored in some way.

Some Table A B
X Y

should rather be linked, as in

Some data can be stored as shown in Some Table ...

But we'll fix that if it actually comes up.

lilleyse commented 1 year ago

The code snippets are no longer counted as figures, by marking them as [%unnumbered]

@javagl did this change go back into the wetzel branch? I regenerated the property reference just now and the lines were removed.

image

javagl commented 1 year ago

@lilleyse It might well be that I did this manually in the rush back then, but ... doing the fix wouldn't have taken much longer, so I just opened https://github.com/CesiumGS/wetzel/pull/84 ...

(EDIT: Of course, one could argue about whether this should be configurable via the wetzel CLI, but ... I think having them unnumbered is a sensible default...)

lilleyse commented 1 year ago

Thanks @javagl