From ae3e9f8c0a3839c9fd1d0b69e8e37ffacd725709 Mon Sep 17 00:00:00 2001 From: Gregorio Pellegirno Date: Thu, 7 Mar 2024 15:31:27 +0100 Subject: [PATCH 1/4] Hazards technique Thanks to Chris for the work. I entered the technique of hazards. In order to handle the different permutations of possible hazards, I thought of using an array. I created a "Join array to comma list" function to concatenate the array (thanks to Matt for support). This is a starting point. As an editor we still have some doubts, which we will dissolve in the call. --- .../draft/techniques/onix-metadata/index.html | 113 +++++++++++++++++- 1 file changed, 109 insertions(+), 4 deletions(-) diff --git a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html index 22f7abe4..36cb5db2 100644 --- a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html +++ b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html @@ -173,6 +173,32 @@

Check for Node

  • ELSE return False.
  • +
    +

    Join array to comma list

    +

    This function serves to concatenate an array of strings, separating each element with a comma, with the last element separated by an "and".

    +

    For example if the input array has elements ["one", "two", "three"], then the output is going to be "one, two and three".

    +

    This algorithm takes the string_array argument: the list of string to join.

    +

    To join the array, run the following steps:

    +
      +
    1. LET output_string be "".
    2. +
    3. LET array_length be the length of given string_array.
    4. +
    5. + IF array_length == 1: + THEN return string_array[0]. +
    6. +
    7. FOR i = 0 TO (array_length - 1): +
        +
      1. CONCAT string_array[i] TO output_string.
      2. +
      3. + IF i < (array_length - 2): + THEN CONCAT ", " TO output_string. +
      4. +
      5. ELSE CONCAT " and " TO output_string.
      6. +
      +
    8. +
    9. return output_string.
    10. +
    +

    Techniques

    @@ -217,13 +243,13 @@

    Instructions

    1. IF all_textual_content_can_be_modified: - THEN display "Appearance can be modified". + THEN display "Appearance can be modified".
    2. ELSE IF is_fixed_layout: - THEN display "Appearance cannot be modified". + THEN display "Appearance cannot be modified".
    3. -
    4. ELSE display "Appearance modifiability not known".
    5. +
    6. ELSE display "Appearance modifiability not known".
    @@ -242,7 +268,86 @@

    Charts, diagrams, and formulas

    Hazards

    This technique relates to Hazards key information.

    - +

    This algorithm takes the onix_record_as_text argument: a UTF-8 string representing the ONIX record.

    +

    Understanding the variables

    +
    +
    no_hazards_or_warnings_confirmed
    +
    +

    If true it indicates that the code 00 of codelist 143 (No known hazards or warnings) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means there is a positive indication in the ONIX record confirming there are no associated hazard warnings with this product.

    +
    +
    flashing_hazard
    +
    +

    If true it indicates that the code 13 of codelist 143 (WARNING - Flashing hazard) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means that there is a positive indication that the product has a flashing hazard which must be displayed.

    +
    +
    no_flashing_hazards
    +
    +

    If true it indicates that the code 14 of codelist 143 (No flashing hazard warning necessary) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means there is a positive indication in the ONIX record confirming there are no flashing hazards associated with this product.

    +
    +
    motion_simulation_hazard
    +
    +

    If true it indicates that the code 17 of codelist 143 (WARNING - Motion simulation hazard) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means that there is a positive indication that the product has a motion simulation hazard which must be displayed.

    +
    +
    no_motion_hazards
    +
    +

    If true it indicates that the code 18 of codelist 143 (No motion simulation hazard warning necessary) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means there is a positive indication in the ONIX record confirming there are no motion simulation hazards associated with this product.

    +
    +
    sound_hazard
    +
    +

    If true it indicates that the code 15 of codelist 143 (WARNING - Sound hazard) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means that there is a positive indication that the product has a sound hazard which must be displayed.

    +
    +
    no_sound_hazards
    +
    +

    If true it indicates that the code 16 of codelist 143 (No sound hazard warning necessary) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means there is a positive indication in the ONIX record confirming there are no sound hazards associated with this product.

    +
    +
    +

    Variables setup

    +
      +
    1. LET onix be the result of calling pre processing given onix_record_as_text.
    2. +
    3. LET no_hazards_or_warnings_confirmed be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "00"].
    4. +
    5. LET flashing_hazard be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "13"].
    6. +
    7. LET no_flashing_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "14"].
    8. +
    9. LET motion_simulation_hazard be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "17"].
    10. +
    11. LET no_motion_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "18"].
    12. +
    13. LET sound_hazard be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "15"].
    14. +
    15. LET no_sound_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "16"].
    16. +
    +

    Instructions

    +
      +
    1. + IF no_hazards_or_warnings_confirmed OR (no_flashing_hazards AND no_motion_hazards AND no_sound_hazards): + THEN display "No hazards". +
    2. +
    3. + ELSE IF flashing_hazard OR motion_simulation_hazard OR sound_hazard: + THEN LET hazards be an empty array. +
        +
      1. + IF flashing_hazard: + THEN APPEND "flashing" to hazards. +
      2. +
      3. + IF motion_simulation_hazard: + THEN APPEND "motion" to hazards. +
      4. +
      5. + IF sound_hazard: + THEN APPEND "sound" to hazards. +
      6. +
      7. LET hazards_string be the result of calling join array to comma list given hazards.
      8. +
      9. CONCAT "hazards" TO hazards_string.
      10. +
      11. MAKE uppercase the first character of hazards_string.
      12. +
      13. display hazards_string.
      14. +
      +
    4. +
    5. ELSE display "".
    6. +
    From 27751ab1ab73e53b0580dbad03cf515621f03b84 Mon Sep 17 00:00:00 2001 From: Gregorio Pellegirno Date: Tue, 12 Mar 2024 14:21:21 +0100 Subject: [PATCH 2/4] ONIX techniques: change id to "hazards none" --- UX-Guide-Metadata/draft/techniques/onix-metadata/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html index 36cb5db2..0e30c5d3 100644 --- a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html +++ b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html @@ -322,7 +322,7 @@

    Instructions

    1. IF no_hazards_or_warnings_confirmed OR (no_flashing_hazards AND no_motion_hazards AND no_sound_hazards): - THEN display "No hazards". + THEN display "No hazards".
    2. ELSE IF flashing_hazard OR motion_simulation_hazard OR sound_hazard: From ec6f548e7c2ee01350c85e99d250129d244b0ba5 Mon Sep 17 00:00:00 2001 From: Gregorio Pellegirno Date: Tue, 12 Mar 2024 14:30:35 +0100 Subject: [PATCH 3/4] Refactor array join as suggested by Matt --- .../draft/techniques/onix-metadata/index.html | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html index 0e30c5d3..30fc6074 100644 --- a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html +++ b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html @@ -61,7 +61,6 @@ code[id]::after { content: "[ID: " attr(id) "]"; } - /*html::before { content: ""; }*/ @@ -173,32 +172,6 @@

      Check for Node

    3. ELSE return False.
    -
    -

    Join array to comma list

    -

    This function serves to concatenate an array of strings, separating each element with a comma, with the last element separated by an "and".

    -

    For example if the input array has elements ["one", "two", "three"], then the output is going to be "one, two and three".

    -

    This algorithm takes the string_array argument: the list of string to join.

    -

    To join the array, run the following steps:

    -
      -
    1. LET output_string be "".
    2. -
    3. LET array_length be the length of given string_array.
    4. -
    5. - IF array_length == 1: - THEN return string_array[0]. -
    6. -
    7. FOR i = 0 TO (array_length - 1): -
        -
      1. CONCAT string_array[i] TO output_string.
      2. -
      3. - IF i < (array_length - 2): - THEN CONCAT ", " TO output_string. -
      4. -
      5. ELSE CONCAT " and " TO output_string.
      6. -
      -
    8. -
    9. return output_string.
    10. -
    -

    Techniques

    @@ -340,9 +313,14 @@

    Instructions

    IF sound_hazard: THEN APPEND "sound" to hazards. -
  • LET hazards_string be the result of calling join array to comma list given hazards.
  • -
  • CONCAT "hazards" TO hazards_string.
  • -
  • MAKE uppercase the first character of hazards_string.
  • +
  • LET hazards_string be the result of: +
      +
    • calling join on hazards with the separator ", "
    • +
    • making uppercase the first character
    • +
    • replacing the last occurence of ", " with " and "
    • +
    • concatenating " hazards" to the end of the string IF (length of hazards) > 1 ELSE concatenating " hazard" to the end of the string.
    • +
    +
  • display hazards_string.
  • From 4ffff96d7fe18ffa1707d8cbde5d75fe0b7a7440 Mon Sep 17 00:00:00 2001 From: Gregorio Pellegirno Date: Tue, 12 Mar 2024 14:43:29 +0100 Subject: [PATCH 4/4] Adding the option for unkown hazards --- .../draft/techniques/onix-metadata/index.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html index 30fc6074..78d17d89 100644 --- a/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html +++ b/UX-Guide-Metadata/draft/techniques/onix-metadata/index.html @@ -279,6 +279,11 @@

    Understanding the variables

    If true it indicates that the code 16 of codelist 143 (No sound hazard warning necessary) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    This means there is a positive indication in the ONIX record confirming there are no sound hazards associated with this product.

    +
    unknown_if_contains_hazards
    +
    +

    If true it indicates that the code 08 of codelist 196 (Unknown accessibility) is present in the ONIX record, otherwise if false it means that the metadata is not present.

    +

    This means that the product has not been assessed for hazards and there is no information about potential hazards.

    +

    Variables setup

      @@ -290,6 +295,7 @@

      Variables setup

    1. LET no_motion_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "18"].
    2. LET sound_hazard be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "15"].
    3. LET no_sound_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "12" and ProductFormFeatureValue = "16"].
    4. +
    5. LET unknown_if_contains_hazards be the result of calling check for node on onix, /ONIXMessage/Product/DescriptiveDetail/ProductFormFeature[ProductFormFeatureType = "09" and ProductFormFeatureValue = "08"].

    Instructions

      @@ -324,7 +330,14 @@

      Instructions

    1. display hazards_string.
    -
  • ELSE display "".
  • +
  • + ELSE IF unknown_if_contains_hazards: + THEN display "The presence of hazards is unknown". +
  • +
  • + ELSE display "No information about possible hazards". +

    This key information can be hidden if metadata is missing.

    +