Formal Quality

Sample presentation of

import yaml
from IPython.display import Markdown

# Load the YAML content
with open("_formalq.yml", "r", encoding="utf-8") as f:
  catalogue_record = yaml.safe_load(f)["catalogue-record"]["table"]

# Keep track of footnotes
footnotes = []
footnote_counter = 1

def generate_markdown_table(record):
    global footnote_counter
    markdown_text = ""
    
    for key, details in record.items():
        markdown_text += f"## {key}\n\n"
        markdown_text += "| Grade | Parameter | Value |\n"
        markdown_text += "|-------|-----------|-------|\n"
        
        for sub_key, sub_details in details.items():
            grade = sub_details["evaluation"]
            parameter = f'**{sub_key}** [^footnote{footnote_counter}]'
            # Add the reference footnote for this parameter
            footnotes.append(f'[^footnote{footnote_counter}]: ref.: {sub_details["ref."]}\n\n    obligation: {sub_details["obligation"]}')
            footnote_counter += 1

            value = sub_details.get("data provided or implied", "null")
            implied_txt = "found" if not sub_details.get("implied?") else "implied"
            note = f'{implied_txt}; {sub_details["comment"]}'
            value_with_note = f'{value} [^footnote{footnote_counter}]'
            # Add the note footnote for this value
            footnotes.append(f'[^footnote{footnote_counter}]: {note}')
            footnote_counter += 1
            
            # Color based on the grade, default to plain bold if the grade is not expected
            color_map = {
                "A": "green",
                "B": "blue",
                "C": "orange",
                "F": "red"
            }
            color = color_map.get(grade, None)
            
            # If grade is one of the expected, apply color, else just make it bold
            if color:
                grade_colored = f'**<span style="color:{color}">{grade}</span>**'
            else:
                grade_colored = f'**{grade}**'
            
            markdown_text += f"| {grade_colored} | {parameter} | {value_with_note} |\n"
            
        markdown_text += "\n"
    
    return markdown_text

# Generate the markdown for the table
markdown_output = generate_markdown_table(catalogue_record)

# Add footnotes to the bottom of the markdown
markdown_output += "\n## Footnotes\n\n"
markdown_output += "\n".join(footnotes)

# Output the generated markdown
Markdown(markdown_output)

Access information

Grade Parameter Value
A Access URL 1 https://www.cita.lu/info_trafic/datex/situationrecord 2
C Access interface 3 HTTP/HTTPS 4
C Communication method 5 pull 6
C Data format - Data Model 7 DATEX II Profile 8
F Data format - Encoding 9 None 10
C Data format - Grammar 11 XSD 12
C Data format - Syntax 13 XML 14
F Data format description 15 None 16
F Data sample 17 None 18
F Data schema / validation 19 None 20
F Protocol documentation 21 None 22
F Security mechanisms 23 None 24

Conditions for use

Grade Parameter Value
A Conditions for use 25 Creative Commons Zero (CC0) 26
C Contract or license 27 Free of charge 28

Content information

Grade Parameter Value
F Dataset detailed type 29 None 30
F Dataset documentation 31 None 32
F Dataset language 33 None 34
F Dataset type category 35 None 36
F Description of dataset 37 None 38
C Georeferencing method 39 AlertCMethod4Linear 40
B Name of the dataset 41 Cita : Événements trafic en DATEX II 42
F Related linked data sources 43 None 44
C Resource type 45 Dataset 46
- Service type category 47 None 48

Evaluation metadata

Grade Parameter Value
- content provider contact 49 chmylonas@certh.gr 50
- evaluated dataset url 51 https://data.public.lu/en/datasets/cita-evenements-trafic-en-datex-ii/ 52
- evaluation date 53 30/09/2024 54
- evaluator 55 Chrysostomos Mylonas 56

Geographical coverage

Grade Parameter Value
B Area covered by publication 57 Luxembourg, territorial coverage granularity 58
F Network coverage 59 None 60
F Network coverage description 61 None 62

Metadata information

Grade Parameter Value
F Contact point 63 None 64
A Dataset identifier 65 5bb707fff176a135ced3b287 66
B Metadata date 67 October 5, 2018 68
C Metadata language 69 fr; eng 70

Quality information

Grade Parameter Value
C Applicable DRs 71 SRTI; RTTI 72
F Availability 73 None 74
F Cross verification 75 None 76
F Data collection method 77 None 78
F National body assessment status 79 None 80
F Problem reporting process 81 None 82
F Quality description 83 None 84
F Reaction time to respond 85 None 86
A Update frequency 87 Real time 88

Responsibilities

Grade Parameter Value
F Data owner 89 None 90
B Publisher 91 Administration des Ponts et Chaussées 92

Temporal information

Grade Parameter Value
- End date of publication 93 None 94
F Start date of publication 95 None 96

Transportation system

Grade Parameter Value
F Transportation modes covered 97 None 98

Footnotes

Footnotes

  1. ref.: 2.2.8.8

    obligation: conditionally*↩︎

  2. found; Provided as expected↩︎

  3. ref.: 2.2.8.6

    obligation: mandatory↩︎

  4. implied; Implied by the data feed↩︎

  5. ref.: 2.2.8.7

    obligation: conditionally*↩︎

  6. implied; Implied by the data feed↩︎

  7. ref.: 2.2.8.4

    obligation: mandatory↩︎

  8. implied; Implied by the data feed↩︎

  9. ref.: 2.2.8.1

    obligation: optional↩︎

  10. found; Not available↩︎

  11. ref.: 2.2.8.3

    obligation: optional↩︎

  12. implied; Implied by the data feed↩︎

  13. ref.: 2.2.8.2

    obligation: mandatory↩︎

  14. implied; Implied by the data feed↩︎

  15. ref.: 2.2.8.5

    obligation: conditionally*↩︎

  16. found; Not available↩︎

  17. ref.: None

    obligation: recommended↩︎

  18. found; Not available↩︎

  19. ref.: None

    obligation: recommended↩︎

  20. found; Not available↩︎

  21. ref.: None

    obligation: recommended↩︎

  22. found; Not available↩︎

  23. ref.: None

    obligation: recommended↩︎

  24. found; Not available↩︎

  25. ref.: 2.2.7.2

    obligation: conditionally*↩︎

  26. found; Provided as expected↩︎

  27. ref.: 2.2.7.1

    obligation: mandatory↩︎

  28. implied; Implied by the conditions for use↩︎

  29. ref.: 2.2.2.5

    obligation: optional↩︎

  30. found; Not available↩︎

  31. ref.: None

    obligation: recommended↩︎

  32. found; Not available↩︎

  33. ref.: 2.2.2.7

    obligation: mandatory↩︎

  34. found; Not available↩︎

  35. ref.: 2.2.2.4

    obligation: mandatory↩︎

  36. found; Not available↩︎

  37. ref.: 2.2.2.2

    obligation: mandatory↩︎

  38. found; Not available↩︎

  39. ref.: 2.2.2.8

    obligation: recommended↩︎

  40. found; Implied by the data feed↩︎

  41. ref.: 2.2.2.1

    obligation: mandatory↩︎

  42. found; Available only in french↩︎

  43. ref.: None

    obligation: recommended↩︎

  44. found; Not available↩︎

  45. ref.: 2.2.2.3

    obligation: mandatory↩︎

  46. implied; Assumed↩︎

  47. ref.: 2.2.2.6

    obligation: conditionally*↩︎

  48. found; None↩︎

  49. ref.: None

    obligation: None↩︎

  50. found; None↩︎

  51. ref.: None

    obligation: None↩︎

  52. found; None↩︎

  53. ref.: None

    obligation: None↩︎

  54. found; None↩︎

  55. ref.: None

    obligation: None↩︎

  56. found; None↩︎

  57. ref.: 2.2.4.1

    obligation: mandatory↩︎

  58. found; Not in the correct format↩︎

  59. ref.: 2.2.4.2

    obligation: mandatory↩︎

  60. found; Not available↩︎

  61. ref.: 2.2.4.3

    obligation: optional↩︎

  62. found; Not available↩︎

  63. ref.: 2.2.1.3

    obligation: partially*↩︎

  64. found; Not available↩︎

  65. ref.: None

    obligation: recommended↩︎

  66. found; Provided as expected↩︎

  67. ref.: 2.2.1.1

    obligation: mandatory↩︎

  68. found; Not provided in the expected format↩︎

  69. ref.: 2.2.1.2

    obligation: mandatory↩︎

  70. implied; Implied by the metadata page↩︎

  71. ref.: None

    obligation: recommended↩︎

  72. implied; Implied by the data feed↩︎

  73. ref.: None

    obligation: recommended↩︎

  74. found; Not available↩︎

  75. ref.: None

    obligation: recommended↩︎

  76. found; Not available↩︎

  77. ref.: None

    obligation: recommended↩︎

  78. found; Not available↩︎

  79. ref.: 2.2.9.3

    obligation: optional↩︎

  80. found; Not available↩︎

  81. ref.: None

    obligation: recommended↩︎

  82. found; Not available↩︎

  83. ref.: 2.2.9.2

    obligation: mandatory↩︎

  84. found; Not available↩︎

  85. ref.: None

    obligation: recommended↩︎

  86. found; Not available↩︎

  87. ref.: 2.2.9.1

    obligation: mandatory↩︎

  88. found; Provided as expected↩︎

  89. ref.: 2.2.6.2

    obligation: partially*↩︎

  90. found; Not available↩︎

  91. ref.: 2.2.6.1

    obligation: partially*↩︎

  92. found; Email is not provided/ only in french↩︎

  93. ref.: 2.2.3.2

    obligation: optional↩︎

  94. found; None↩︎

  95. ref.: 2.2.3.1

    obligation: mandatory↩︎

  96. found; Not available↩︎

  97. ref.: 2.2.5.1

    obligation: mandatory↩︎

  98. found; Not available↩︎