From 44f9c8f073809169dcf793116be2bfa175987345 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:15:40 +0100 Subject: [PATCH 1/6] allow open enumerations in nxdl.xsd --- nxdl.xsd | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nxdl.xsd b/nxdl.xsd index a82b3217ac..473f600423 100755 --- a/nxdl.xsd +++ b/nxdl.xsd @@ -1232,6 +1232,11 @@ https://stackoverflow.com/a/48980995/1046449 --> (This data type is used internally in the NXDL schema to define elements and attributes to be used by users in NXDL specifications.) + + Enumerations can be closed or open. A closed enumeration is one where the list of + values are the only ones allowed for a specification. An open enumeration is one + where the list of values is incomplete and additional values other than those listed + are allowed. :: @@ -1247,6 +1252,14 @@ https://stackoverflow.com/a/48980995/1046449 --> + + + + Is this an open enumeration? + An open enumeration allows additional values not listed. + + + From 1b96f871268cbe9b5e8cf77e00ad541a89d642ff Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:16:01 +0100 Subject: [PATCH 2/6] render open enumerations in the docs --- dev_tools/docs/nxdl.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dev_tools/docs/nxdl.py b/dev_tools/docs/nxdl.py index 3d22baf41c..8f2857e458 100644 --- a/dev_tools/docs/nxdl.py +++ b/dev_tools/docs/nxdl.py @@ -511,11 +511,14 @@ def _print_enumeration(self, indent, ns, parent): node_list = parent.xpath("nx:item", namespaces=ns) if len(node_list) == 0: return "" - - if len(node_list) == 1: - self._print(f"{indent}Obligatory value:", end="") + + if parent.attrib.get("open", "false") == "true": + self._print(f"{indent}This is an open enumeration. Any of these values is suggested:", end="") else: - self._print(f"{indent}Any of these values:", end="") + if len(node_list) == 1: + self._print(f"{indent}Obligatory value:", end="") + else: + self._print(f"{indent}Any of these values:", end="") docs = OrderedDict() for item in node_list: From ea0c66f02398367bb6a9a0c602306d0483276378 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:16:15 +0100 Subject: [PATCH 3/6] open enumeration in NXsource/type --- base_classes/NXsource.nxdl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_classes/NXsource.nxdl.xml b/base_classes/NXsource.nxdl.xml index 16974c945f..c1bff178f0 100644 --- a/base_classes/NXsource.nxdl.xml +++ b/base_classes/NXsource.nxdl.xml @@ -47,7 +47,7 @@ type of radiation source (pick one from the enumerated list and spell exactly) - + From 3ac40aca7695e7619b9cfb714560b1dd823e9359 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:44:40 +0100 Subject: [PATCH 4/6] bring in NXobject/identifierNAME, makes its enum open --- base_classes/NXobject.nxdl.xml | 167 ++++++++++++++++++++++++++++++++- 1 file changed, 166 insertions(+), 1 deletion(-) diff --git a/base_classes/NXobject.nxdl.xml b/base_classes/NXobject.nxdl.xml index 24dd520104..c89ac6d552 100644 --- a/base_classes/NXobject.nxdl.xml +++ b/base_classes/NXobject.nxdl.xml @@ -30,5 +30,170 @@ This is the base object of NeXus - + + + An identifier for a (persistent) resource. + + An identifier, provided by some authority, that has been assigned to the + real-world object described by this ``NXobject``. To be useful, the identifier + must not be reassigned to a different real-world object. It is typical for + there to be some mechanism to resolve an identifier, obtaining metadata + about the object. Identifiers for which some guarantees exist regarding + this resolution process are called persistent identifiers. + Persistent identifiers are also known as PIDs. + + + + The type of identifier used. + + It is recommended to use the most specific type when describing the identifier. + + For example, all IGSNs are DOIs and all DOIs are Handles; however, an IGSN should have type IGSN (and not DOI or Hdl). + Similarly, an ARK, Purl, ORCID and ROR identifiers should have their corresponding types and should not use the more generic URL identifier. + + + + + Archival Resource Key. + + An ARK is a Uniform Resource Identifier (URI) designed to support long-term access to a variety of information objects. + + Syntax: https://NMA/ark:/NAAN/Name[Qualifier]. Brackets indicate optional elements. + Example: https://example.org/ark:/12345/abcde + + + + + Digital Object Identifier. + + A DOI is a unique alphanumeric string used to identify digital content. It consists of a prefix and a suffix, separated by a slash. + + Syntax: 10.XXXX/XXXXXX + Example: 10.1107/S1600576714027575 + + + + + A handle is a unique identifier that consists of a prefix indicating the naming authority and a suffix representing the local name + of a resource, cts. + + A handle is a unique identifier used to facilitate the identification and management of digital objects. It is composed of a prefix that + indicates the naming authority and a suffix that specifies the resource's local name. + + This refers specifically to an ID in the Handle system operated by the Corporation for National Research Initiatives (CNRI). + + Syntax: prefix/identifier + Example: 123456789/abc123 + + + + + International Generic Sample Number. + + The IGSN is a unique identifier assigned to a specific sample or specimen in the context of scientific research. + Since 2021, IGSNs are issued by DataCite, meaning that there are now DataCite-issued DOIs for all IGSNs, + including those historical IGSNs issued beforehand. Therefore, the syntax is the same as for DOIs. + + Syntax: 10.XXXX/XXXXXX + Example: 10.1107/S1600576714027575 + + + + + ISNI is an ISO standard to uniquely identify individuals and organizations involved in creative work, including pseudonyms + and other public personas. + + An ISNI-ID is made up of 16 digits, the last character being a check character. The check character may be either a decimal digit + or the character “X”. + + A URL can be generated from the ISNI ID by combining it with the prefix https://isni.org/isni/, resulting in + https://isni.org/isni/{ISNI-ID}. + + Syntax: 16 base-10 digits stored without any spaces. + Example: 0000000121032683 + + + + + International Standard Serial Number + + An ISSN is an 8-digit unique identifier used to distinguish a serial publication, whether in print or electronic form. + The last character (a digit or 'X') serves as a check character, making the ISSN uniquely defined by its first seven digits. + + Syntax: NNNN-NNNC, where N a decimal digit character (i.e., in the set {0,1,2,...,9}), and C is in {0,1,2,...,9,X} + Example: 1234-5678 or 1234-567X + + + + + Linking ISSN + + The linking The ISSN, or ISSN-L, is a specific ISSN that groups the different media of the same serial publication. + + Syntax: NNNN-NNNC, where N a decimal digit character (i.e., in the set {0,1,2,...,9}), and C is in {0,1,2,...,9,X} + Example: 1234-5678 or 1234-567X + + + + + Open Researcher and Contributor identifier. + + ORCID provides a free and persistent identifier that uniquely distinguishes authors and contributors in scientific research. + + Syntax: https://orcid.org/XXXX-XXXX-XXXX-XXXX + Example: https://orcid.org/0000-0002-1825-0097 + + + + + Persistent Uniform Resource Locator. + + A Persistent Uniform Resource Locator (PURL) is a type of URL designed to provide a stable, long-term reference to a web + resource by using a resolver to redirect users to the resource's current location, even if it moves over time. + + A PURL has three parts: (1) a protocol, (2) a resolver address, and (3) a name. + + Syntax: https://purl.org/foo/bar + Example: https://purl.org/dc/elements/1.1/title + + + + + Research Organization Registry + + A ROR ID is a globally unique identifier for research organizations, enabling unambiguous linking of institutions across systems. + + Syntax: https://ror.org/{ROR-ID} + Example: https://ror.org/052gg0110 + + + + + Uniform Resource Locator + + Also known as web address, a URL is the address used to access a resource on the internet, + specifying its location and the protocol to retrieve it. + + Syntax: scheme://domain:port/path?query_string#fragment_id + Example: https://www.example.com/about + + + + + Uniform Resource Name + + A URN is a unique, persistent identifier for a resource regardless of where it is stored. + + It is recommended that identifiers with more specific type attribute (such as DOI or ISSN) values should not be stored as a URN, + even when this is valid. As an example, the URN doi:10.1107/S1600576714027575 is a valid URN-based representation for the DOI + 10.1107/S1600576714027575, but it is recommended to use type="DOI" in this case. + + Syntax: urn:<namespace>:<namespace-specific-string>. The leading urn: sequence is case-insensitive. + Example: urn:isbn:0000000000000 + + + + + + From 67388268574d5d50970af70854514b32756a42fe Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:28:38 +0100 Subject: [PATCH 5/6] codestyle --- dev_tools/docs/nxdl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev_tools/docs/nxdl.py b/dev_tools/docs/nxdl.py index 8f2857e458..ce5034371e 100644 --- a/dev_tools/docs/nxdl.py +++ b/dev_tools/docs/nxdl.py @@ -511,9 +511,12 @@ def _print_enumeration(self, indent, ns, parent): node_list = parent.xpath("nx:item", namespaces=ns) if len(node_list) == 0: return "" - + if parent.attrib.get("open", "false") == "true": - self._print(f"{indent}This is an open enumeration. Any of these values is suggested:", end="") + self._print( + f"{indent}This is an open enumeration. Any of these values is suggested:", + end="", + ) else: if len(node_list) == 1: self._print(f"{indent}Obligatory value:", end="") From b464848bf1bf2145ddad218bfbe61bbfd2f36e01 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:38:30 +0100 Subject: [PATCH 6/6] move attribute out of xs:sequence --- nxdl.xsd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nxdl.xsd b/nxdl.xsd index 473f600423..1e6c6f12a2 100755 --- a/nxdl.xsd +++ b/nxdl.xsd @@ -1252,14 +1252,6 @@ https://stackoverflow.com/a/48980995/1046449 --> - - - - Is this an open enumeration? - An open enumeration allows additional values not listed. - - - @@ -1292,6 +1284,14 @@ https://stackoverflow.com/a/48980995/1046449 --> + + + + Is this an open enumeration? + An open enumeration allows additional values not listed. + + +