Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPRESS schema documentation should follow SC 4 Supplementary Directives #10

Open
opoudjis opened this issue Feb 11, 2021 · 19 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link

opoudjis commented Feb 11, 2021

I noticed this when reviewing the prototype part 41 document.
There were missing descriptions for TYPES.
The SC4 supplementary directives require descriptions for all declarations except CONSTANT and interfaces.

If no text is provided in descriptions.xml for SELECT and ENUMERATION types, the XSLT pastes boilerplate descriptions in the document.

That boilerplate will need to be inserted by the metanorma-based tooling to cover that use case.

Which means that stepmod2mn will need to insert them as remarks, if there are none present. @ronaldtse and/or @TRThurman, you will need to direct @Intelligent2013 to where the XSLT resides, so he can replicate it.

@opoudjis opoudjis added the enhancement New feature or request label Feb 11, 2021
@ronaldtse
Copy link

@Intelligent2013 all the XSLT boilerplate content is under “xsl”

@TRThurman
Copy link

TRThurman commented Feb 11, 2021 via email

@ronaldtse
Copy link

ronaldtse commented Feb 11, 2021

@ronaldtse ronaldtse changed the title Create remarks where none are provided EXPRESS schema documentation should follow SC 4 Supplementary Directives Feb 11, 2021
@ronaldtse
Copy link

Related to metanorma/iso-tc184-sc4-boilerplate#1

Intelligent2013 added a commit that referenced this issue Feb 11, 2021
@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Feb 11, 2021

I need some clarification.

  1. If no text is provided in descriptions.xml for SELECT and ENUMERATION types, the XSLT pastes boilerplate descriptions in the document.

What is descriptions.xml? Do you mean, for example, like this \data\resources\action_schema\action_schema.xml ?

  1. Let's take a look at html view for document ISO 10303-41:
    изображение

Section 5 Application context has subsection 5.3 Application context type definitions.
Section 6 Approval has subsection 6.3 Approval type definitions.
Section 7 Basic attribute has subsection 7.3 Basic attribute type definitions.
Section 8 Certification doesn't have ... type definitions sections.

That means xslt should put placeholder in the section 8? Or xslt should check type definitions only for section 5?

  1. The Supplementary Directives text for 5.3, 6.7 and 8 which relate to ISO 10303 is provided here: https://github.com/metanorma/iso-tc184-sc4-directives/blob/master/supplementary-directives.adoc

I don't understand when xslt should put 6.7 and 8 boilerplates? What are the conditions for this?

@ronaldtse
Copy link

@ronaldtse
Copy link

ronaldtse commented Feb 11, 2021

Section 8 Certification doesn't have ... type definitions sections.

Because this schema does not have EXPRESS "type" and EXPRESS "function" content.

See https://github.com/metanorma/iso-tc184-sc4-directives/blob/master/supplementary-directives.adoc#672-components-of-a-clause-that-specifies-an-express-schema

@Intelligent2013
Copy link
Contributor

@ronaldtse thank you for explanation, I've thought about something else...

  1. sect_4_express.xsl generates some text yet, for example
[[types]]
== action_schema type definitions

[[action_schema.as_description_attribute_select]]
==== as_description_attribute_select

The *as_description_attribute_select* type is an extension of the *description_attribute_select* type. It adds the data type action_request_solution to the list of alternate data types.

In this case should stepmod2mn put boilerplate remark after that additionally?

[General:SC4_xxxx]
...
[end_General]
  1. How would you like to put the boilerplate:
  • as link to boilerplate adoc or
  • put boilerplate adoc content inside main adoc file? (it seems it is possible via xslt+java extension)

@TRThurman
Copy link

TRThurman commented Feb 11, 2021 via email

@Intelligent2013
Copy link
Contributor

Intelligent2013 commented Feb 12, 2021

I've added boilerplate displaying in https://github.com/metanorma/stepmod2mn/blob/master/src/main/resources/stepmod2mn.adoc.xsl (code must be changed for real values). In boilerplate we can display:

  • just text (parameter text)
  • content of an external text file (parameter file), file must be accessible
  • both text and content of an external text file.
<xsl:call-template name="insertBoilerplate">
  <xsl:with-param name="folder" select="'General'"/>
  <xsl:with-param name="identifier" select="'SC4_xxxx'"/>
  <xsl:with-param name="text">Example: Put boilerplate for type select, see https://github.com/metanorma/iso-tc184-sc4-directives/blob/master/supplementary-directives.adoc</xsl:with-param>
  <xsl:with-param name="file">https://raw.githubusercontent.com/metanorma/stepmod2mn/master/README.adoc</xsl:with-param>
</xsl:call-template>

On next step I need to know how to determine values for folder, identifier.

No, the above text is the boilerplate.

It means that we need to enclose it in

[General:SC4_xxxx]
 ...
 [end_General]

or leave as is?

@TRThurman
Copy link

TRThurman commented Feb 12, 2021 via email

Intelligent2013 added a commit that referenced this issue Feb 12, 2021
@ronaldtse
Copy link

ronaldtse commented Feb 13, 2021

@Intelligent2013 I've discussed with @opoudjis , we are envisioning that:

  1. We will encode the boilerplate text as liquid templates for adoc includes
  2. We will use a git submodule to include boilerplate text inside iso-10303-stepmod

i.e. no remote boilerplate fetches needed in rendering.

Thoughts?

@Intelligent2013
Copy link
Contributor

@ronaldtse

  1. We will encode the boilerplate text as liquid templates for adoc includes

To parse liquid templates in stepmod2mn I see two options:

  • call (from stepmod2mn) some ruby liquid parser via command line, for example ruby script.rb and put output string in resulted adoc via xslt, or
  • parse liquid templates in stepmod2mn with using of Liqp library (https://github.com/bkiers/Liqp)
  1. We will use a git submodule to include boilerplate text inside iso-10303-stepmod

I've added boilerplatepath parameter to stepmod2mn command line.

@ronaldtse
Copy link

@Intelligent2013 I think stepmod2mn only needs to point to the liquid templates (via AsciiDoc include), Metanorma can read in those liquid templates instead.

Reason is:

  1. We don't want to render the boilerplate content in adoc files as static text
  2. The authors will want to change the boilerplate text in the future

Thoughts @opoudjis ?

@opoudjis
Copy link
Author

opoudjis commented Feb 15, 2021

It's a vulnerability, so I'm not in love with it, and people really will need to ensure that the submodules are in the right place, but ok. I see that @Intelligent2013 has already added a command line parameter to configure the boilerplate path; that will still be needed to populate any include paths.

@ronaldtse
Copy link

Vulnerability in the general sense because a change in that repo may affect the build, right. I assume we’re going to create the repo and submodule anyway so it will be at the right place.

@Intelligent2013
Copy link
Contributor

Currently, the text Error: boilerplate text is empty. presents in the output adoc always when no text is provided in descriptions.xml. For instance iso-10303-srl\documents\modules\maths_value\sections\04-info_reqs.adoc:

[[maths_value_arm.maths_atom]]
===== maths_atom (((maths_atom,ARM object definition)))

A *maths_value* is a single Boolean, real integer or complex value.

Error: boilerplate text is empty.

[.underline]#EXPRESS specification:#

As noticed in #105:

the stepmod2mn migration process triggers several errors. We need to fix ALL of them.

therefore I'll move the message Error: boilerplate text is empty. from the adoc to the console log.

To put the boilerplate:

  1. We will encode the boilerplate text as liquid templates for adoc includes
  2. We will use a git submodule to include boilerplate text inside iso-10303-stepmod

we need to pass the submodule's path into stepmod2mn via the command line parameter --boilerplatepath <path>, or I need to hardcode this path in the XSLT as static value.

@ronaldtse
Copy link

What is the boilerplate? What exactly is missing?

Intelligent2013 added a commit that referenced this issue Dec 5, 2023
@Intelligent2013
Copy link
Contributor

What is the boilerplate? What exactly is missing?

@ronaldtse

for example, let's take a look at the document iso-10303-stepmod-wg12\data\modules\shape_appearance_layers.

The output adoc iso-10303-srl\documents\modules\shape_appearance_layers\sections\04-info_reqs.adoc doesn't contain the description (after ===== title and before [.underline]#EXPRESS specification:#):

[[shape_appearance_layers_arm.sal_appearance_context]]
===== sal_appearance_context (((sal_appearance_context,ARM object definition)))

WE NEED DESCRIPTION (OR BOILERPLATE TEXT) HERE

[.underline]#EXPRESS specification:#


[source%unnumbered]
--
TYPE sal_appearance_context = SELECT BASED_ON appearance_contextWITH 
   (Geometric_model_relationship, 
    Group, 
    Layer);
END_TYPE;
--

The reason - in the 10303-stepmod-wg12\data\modules\shape_appearance_layers\arm_descriptions.xml:

<?xml version="1.0" encoding="utf-8"?>
...
<ext_descriptions module_directory="shape_appearance_layers" schema_file="arm.xml" rcs.date="$Date: 2009/12/03 13:09:58 $" rcs.revision="$Revision: 1.5 $">

  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Schema: Shape_appearance_layers_arm 
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
   <ext_description linkend="Shape_appearance_layers_arm"/>
		 	
</ext_descriptions>

there isn't description like this:

<ext_description linkend="Shape_appearance_layers_arm.sal_appearance_context">
Description text...
</ext_description>

From the initial post:

The SC4 supplementary directives require descriptions for all declarations except CONSTANT and interfaces.

If no text is provided in descriptions.xml for SELECT and ENUMERATION types, the XSLT pastes boilerplate descriptions in the document.

The requirements: https://github.com/metanorma/iso-tc184-sc4-directives/blob/main/sources/supplementary-directives/document.adoc#components-of-a-clause-that-specifies-an-express-schema

https://github.com/metanorma/iso-tc184-sc4-directives/blob/main/sources/supplementary-directives/document.adoc#components-of-a-clause-that-specifies-an-express-schema

In the 2.5 years ago post #10 (comment)

@Intelligent2013 I've discussed with @opoudjis , we are envisioning that:

  1. We will encode the boilerplate text as liquid templates for adoc includes
  2. We will use a git submodule to include boilerplate text inside iso-10303-stepmod

Is there such submodule with boilerplate text as liquid templates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants