Skip to content

Commit

Permalink
fix failing workflow: add languages to workflow and update failing te…
Browse files Browse the repository at this point in the history
…st cases.
  • Loading branch information
DeleMike committed Oct 19, 2024
1 parent d814ecb commit c8214ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/scribe_data/check/check_query_identifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ def extract_qid_from_sparql(file_path: Path, pattern: str) -> str:
FileNotFoundError
If the specified file does not exist.
Example
-------
> extract_qid_from_sparql(Path("path/to/query.sparql"), r"\?lexeme dct:language wd:Q\d+")
'Q123456'
"""
try:
with open(file_path, "r", encoding="utf-8") as file:
Expand Down Expand Up @@ -155,5 +151,5 @@ def is_valid_data_type(query_file: Path, data_type_qid: str) -> bool:
return data_type_qid == expected_data_type_qid


if __name__ == "__main__":
check_queries()
# if __name__ == "__main__":
check_queries()
8 changes: 8 additions & 0 deletions src/scribe_data/resources/language_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
}
}
},
"igbo":{
"iso":"ig",
"qid": "Q33578"
},
"indonesian": {
"iso": "id",
"qid": "Q9240"
Expand All @@ -87,6 +91,10 @@
"iso": "ja",
"qid": "Q5287"
},
"korean":{
"iso":"ko",
"qid":"Q9176"
},
"kurmanji": {
"iso": "kmr",
"qid": "Q36163"
Expand Down
4 changes: 4 additions & 0 deletions tests/cli/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def test_list_languages(self, mock_print):
call("Hausa ha Q56475 "),
call("Hebrew he Q9288 "),
call("Hindi hi Q11051 "),
call("Igbo ig Q33578 "),
call("Indonesian id Q9240 "),
call("Italian it Q652 "),
call("Japanese ja Q5287 "),
call("Korean ko Q9176 "),
call("Kurmanji kmr Q36163 "),
call("Latin la Q397 "),
call("Malay ms Q9237 "),
Expand Down Expand Up @@ -200,9 +202,11 @@ def test_list_languages_for_data_type_valid(self, mock_print):
call("Hebrew he Q9288 "),
call("Hindustani/hindi hi Q11051 "),
call("Hindustani/urdu ur Q11051 "),
call("Igbo ig Q33578 "),
call("Indonesian id Q9240 "),
call("Italian it Q652 "),
call("Japanese ja Q5287 "),
call("Korean ko Q9176 "),
call("Kurmanji kmr Q36163 "),
call("Latin la Q397 "),
call("Malay ms Q9237 "),
Expand Down

0 comments on commit c8214ff

Please sign in to comment.