FAIRmat-NFDI / nyaml

https://fairmat-nfdi.github.io/nyaml
https://pypi.org/project/nyaml/
Apache License 2.0
1 stars 0 forks source link

Proposal to change the file extension from `yaml` to `nxdl.yaml` #21

Closed RubelMozumder closed 4 months ago

RubelMozumder commented 4 months ago

The YAML file mainly represent NXDL via YAML syntax which later converted into .nxdl.xml in XML syntax. The file would be more intuitive and distinguishable than other general yaml for different purposes.

If it is agreed change to be needed:

RubelMozumder commented 4 months ago

@domna, @sanbrock, @sherjeelshabih, @lukaspie , @rettigl , @mkuehbach what do you think?

domna commented 4 months ago

I would still support .yaml as a file ending. I don't see a reason to write the more cumbersome nxdl.yaml file ending.

sherjeelshabih commented 4 months ago

I don't have a strong opinion for either option.

If the motivation is just distinguishability, I would vote to keep it the same. It will add more length to the name and is redundant as nyaml2nxdl should check the contents of the file regardless of the extension.

lukaspie commented 4 months ago

If the motivation is just distinguishability, I would vote to keep it the same. It will add more length to the name and is redundant as nyaml2nxdl should check the contents of the file regardless of the extension.

I am also -1 on this for the exact reason that @sherjeelshabih is describing. The important part is the contexts of the file (which we anyway check) and not the file extension.

mkuehbach commented 4 months ago

The file is a YAML file, hence typically one would expect either YAML or YML as file ending. I am against .nxdl.yaml, as the set of pieces of information within a serialization should be described by content identifier in the serialization rather than via the alias used to identify the instance of the serialization. Indeed, the yaml file does not have even a magic cookie, so content checks are needed as others mentioned and are performed. We decided at some point to make it consistent and use YAML instead of a mixture of YAML and YML as file endings.

RubelMozumder commented 4 months ago

Thanks for your feedback.

Probably, I should have given more context about the distinguishable. While working on the nyaml paper I realized that the yaml file describing the application definition is just a mapper between the keyword and value or to another block of the yaml part.

But, in yaml the content of the file has especial meaning, who does not know the NXDL the file content is just literal text. In nxdl.yaml file the keywords or small blocks of yaml have special grammar and meaning which absolutely follow the NXDL language. The extension will bring the value of our work on the nxdl application definition. In future, we will see nxdl.yaml version as another well-known version of nxdl.xml. Even, if we compare the two names from nxdl.xml and nxdl.yaml they very very intuitive.

sanbrock commented 4 months ago

I totally see the the value in .nxdl.yaml. As you point out, exactly as with .nxdl.xml at the end of the day these are files in yaml or xml formats respectively. The question is what else the file names should contain. Nexus has 2 convention rules here:

The second point holds because NXDL is indeed defined as an XML dialect by the XML Schema Definition nxdl.xsd. Similarly, our yaml files do follow a special nxdl type dialect in yaml what we called nyaml. Here, we do not have a corresponding schema definition or dialect validator other than the conversion tool itself. The rules of the dialect are only expressed in the documentation and this is what shall also explain the relationship and mapping to/from NXDL, like rank, dimensions, etc.
Note that we have not planned to indicate this characteristic of these files of belonging this nyaml dialect in the filename, but rather in the name of the subdirectory where we place/expect these files.
For now, we can just keep it as is, but later, if NIAC agrees, we may want to define the NXDL being independent of XML and then one can have NXDL implementations in different formats, like nxdl.xml and nxdl.yaml. Note that for the moment , NIAC made it clear that NXDL is in xml and the single point of truth is the .nxdl.xml file.

RubelMozumder commented 4 months ago

By unanimous with everyone, we will keep the file extension .yaml for the YAML format.