From c7a2a5bf5ca99ae418989a1461d1ebd768cd4d59 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Mon, 28 Oct 2024 01:39:38 +0300 Subject: [PATCH 1/5] Refactor SPARQL query for danish nouns into eight files for each variable to resolve runtime issues. Previously combined three variables in one file leading to performance problems. Adding NonGenitive Form to the json file. --- .../resources/lexeme_form_metadata.json | 4 ++++ .../danish/nouns/query_nouns_1.sparql | 22 +++++++++++++++++++ .../danish/nouns/query_nouns_2.sparql | 18 +++++++++++++++ .../danish/nouns/query_nouns_3.sparql | 18 +++++++++++++++ .../danish/nouns/query_nouns_4.sparql | 18 +++++++++++++++ .../danish/nouns/query_nouns_5.sparql | 17 ++++++++++++++ .../danish/nouns/query_nouns_6.sparql | 18 +++++++++++++++ .../danish/nouns/query_nouns_7.sparql | 18 +++++++++++++++ .../danish/nouns/query_nouns_8.sparql | 18 +++++++++++++++ 9 files changed, 151 insertions(+) create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql create mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql diff --git a/src/scribe_data/resources/lexeme_form_metadata.json b/src/scribe_data/resources/lexeme_form_metadata.json index 5e8786c61..8737eddca 100644 --- a/src/scribe_data/resources/lexeme_form_metadata.json +++ b/src/scribe_data/resources/lexeme_form_metadata.json @@ -99,6 +99,10 @@ "25": { "label": "Comitative", "qid": "Q838581" + }, + "26": { + "label": "NonGenitive", + "qid": "Q98946930" } }, "02_gender": { diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql new file mode 100644 index 000000000..9ca8930dc --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql @@ -0,0 +1,22 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?noun + ?nonGenitiveDefiniteSingular + +WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 ; + wikibase:lemma ?noun . + + # MARK: Singular + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . + ?nonGenitiveDefiniteSingularForm ontolex:representation ?nonGenitiveDefiniteSingular ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql new file mode 100644 index 000000000..124d1ff84 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nonGenitiveDefinitesingular + +MARK: Singular + +WHERE { + # MARK: Singular Definite Non-Genitive + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveDefinitesingularForm . + ?nonGenitiveDefinitesingularForm ontolex:representation ?nonGenitiveDefinitesingular ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997851, wd:Q110786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql new file mode 100644 index 000000000..8ce3a5257 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nonGenitiveIndefiniteSingular + +WHERE { + + # MARK: Singular + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveIndefiniteSingularForm . + ?nonGenitiveIndefiniteSingularForm ontolex:representation ?nonGenitiveIndefiniteSingular ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql new file mode 100644 index 000000000..06d255a8f --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?genitiveIndefinitePlural + +MARK: Genitive + +WHERE { + # MARK: Genitive + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveIndefinitePluralForm . + ?genitiveIndefinitePluralForm ontolex:representation ?genitiveIndefinitePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q146786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql new file mode 100644 index 000000000..b9af2668b --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql @@ -0,0 +1,17 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?genitiveIndefiniteSingular +MARK: Genitive + +WHERE { + # MARK: Genitive + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveIndefiniteSingularForm . + ?genitiveIndefiniteSingularForm ontolex:representation ?genitiveIndefiniteSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q110786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql new file mode 100644 index 000000000..c6b62e25e --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?genitiveDefinitePlural + +WHERE { + + # MARK: Genitive + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveDefinitePluralForm . + ?genitiveDefinitePluralForm ontolex:representation ?genitiveDefinitePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997851, wd:Q146786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql new file mode 100644 index 000000000..308ad54c4 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nonGenitiveIndefinitePlural + +WHERE { + + # MARK: Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveIndefinitePluralForm . + ?nonGenitiveIndefinitePluralForm ontolex:representation ?nonGenitiveIndefinitePlural ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q146786 . + } +} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql new file mode 100644 index 000000000..308ad54c4 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql @@ -0,0 +1,18 @@ +# tool: scribe-data +# All Danish (Q9035) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nonGenitiveIndefinitePlural + +WHERE { + + # MARK: Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveIndefinitePluralForm . + ?nonGenitiveIndefinitePluralForm ontolex:representation ?nonGenitiveIndefinitePlural ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q146786 . + } +} From 06080e90a6a4775ba9420ef2ef27d933b16d086e Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Mon, 28 Oct 2024 02:06:11 +0300 Subject: [PATCH 2/5] Small fixes --- .../danish/nouns/query_nouns_1.sparql | 4 ++-- .../danish/nouns/query_nouns_2.sparql | 9 ++++----- .../danish/nouns/query_nouns_3.sparql | 2 +- .../danish/nouns/query_nouns_4.sparql | 2 +- .../danish/nouns/query_nouns_5.sparql | 1 - 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql index 9ca8930dc..a75fab481 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql @@ -12,11 +12,11 @@ WHERE { wikibase:lexicalCategory wd:Q1084 ; wikibase:lemma ?noun . - # MARK: Singular + # MARK: Singular OPTIONAL { ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . ?nonGenitiveDefiniteSingularForm ontolex:representation ?nonGenitiveDefiniteSingular ; - wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997851, wd:Q110786 . } } diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql index 124d1ff84..919fad4eb 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql @@ -4,15 +4,14 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nonGenitiveDefinitesingular + ?nonGenitiveDefiniteSingular -MARK: Singular +# MARK: Singular WHERE { - # MARK: Singular Definite Non-Genitive OPTIONAL { - ?lexeme ontolex:lexicalForm ?nonGenitiveDefinitesingularForm . - ?nonGenitiveDefinitesingularForm ontolex:representation ?nonGenitiveDefinitesingular ; + ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . + ?nonGenitiveDefiniteSingularForm ontolex:representation ?nonGenitiveDefiniteSingular ; wikibase:grammaticalFeature wd:Q98946930, wd:Q53997851, wd:Q110786 . } } diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql index 8ce3a5257..8964efd9a 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql @@ -8,7 +8,7 @@ SELECT WHERE { - # MARK: Singular +# MARK: Singular OPTIONAL { ?lexeme ontolex:lexicalForm ?nonGenitiveIndefiniteSingularForm . diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql index 06d255a8f..f0e8fcedb 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql @@ -6,7 +6,7 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?genitiveIndefinitePlural -MARK: Genitive +# MARK: Genitive WHERE { # MARK: Genitive diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql index b9af2668b..2023e621b 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql @@ -5,7 +5,6 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?genitiveIndefiniteSingular -MARK: Genitive WHERE { # MARK: Genitive From 8f56d8374855b9b4768a4b0fcff63089263d5ef7 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Mon, 28 Oct 2024 02:28:10 +0300 Subject: [PATCH 3/5] Forgot language and lexical category filters in the WHERE haha --- .../danish/nouns/query_nouns_2.sparql | 7 +++++-- .../danish/nouns/query_nouns_3.sparql | 4 +++- .../danish/nouns/query_nouns_4.sparql | 3 +++ .../danish/nouns/query_nouns_5.sparql | 3 +++ .../danish/nouns/query_nouns_6.sparql | 2 ++ .../danish/nouns/query_nouns_7.sparql | 2 ++ .../danish/nouns/query_nouns_8.sparql | 2 ++ 7 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql index 919fad4eb..8614beb59 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql @@ -6,9 +6,12 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?nonGenitiveDefiniteSingular -# MARK: Singular - WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 ; + + # MARK: Singular + OPTIONAL { ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . ?nonGenitiveDefiniteSingularForm ontolex:representation ?nonGenitiveDefiniteSingular ; diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql index 8964efd9a..3482c72da 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql @@ -7,8 +7,10 @@ SELECT ?nonGenitiveIndefiniteSingular WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 ; -# MARK: Singular + # MARK: Singular OPTIONAL { ?lexeme ontolex:lexicalForm ?nonGenitiveIndefiniteSingularForm . diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql index f0e8fcedb..e85b31e78 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql @@ -9,6 +9,9 @@ SELECT # MARK: Genitive WHERE { + ?lexeme dct:language wd:Q9035 ; # Added language condition + wikibase:lexicalCategory wd:Q1084 ; # Added lexical category condition + # MARK: Genitive OPTIONAL { ?lexeme ontolex:lexicalForm ?genitiveIndefinitePluralForm . diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql index 2023e621b..a1c91b986 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql @@ -7,6 +7,9 @@ SELECT ?genitiveIndefiniteSingular WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 ; + # MARK: Genitive OPTIONAL { ?lexeme ontolex:lexicalForm ?genitiveIndefiniteSingularForm . diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql index c6b62e25e..c0eb94360 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql @@ -7,6 +7,8 @@ SELECT ?genitiveDefinitePlural WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 . # MARK: Genitive diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql index 308ad54c4..1f1ba5b1c 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql @@ -7,6 +7,8 @@ SELECT ?nonGenitiveIndefinitePlural WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 . # MARK: Plural diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql index 308ad54c4..1f1ba5b1c 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql @@ -7,6 +7,8 @@ SELECT ?nonGenitiveIndefinitePlural WHERE { + ?lexeme dct:language wd:Q9035 ; + wikibase:lexicalCategory wd:Q1084 . # MARK: Plural From 39de82903fdbc09818b5c4173e25d9fc8ade199c Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Tue, 29 Oct 2024 22:46:37 +0300 Subject: [PATCH 4/5] Minimum number of forms per file to avoid timeout errors --- .../danish/nouns/query_nouns.sparql | 34 ----------- .../danish/nouns/query_nouns_1.sparql | 59 ++++++++++++++++--- .../danish/nouns/query_nouns_2.sparql | 4 +- .../danish/nouns/query_nouns_3.sparql | 20 ------- .../danish/nouns/query_nouns_4.sparql | 21 ------- .../danish/nouns/query_nouns_5.sparql | 19 ------ .../danish/nouns/query_nouns_6.sparql | 20 ------- .../danish/nouns/query_nouns_7.sparql | 20 ------- .../danish/nouns/query_nouns_8.sparql | 20 ------- 9 files changed, 53 insertions(+), 164 deletions(-) delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql delete mode 100644 src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns.sparql deleted file mode 100644 index 6e2db09e2..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns.sparql +++ /dev/null @@ -1,34 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?singular - ?plural - ?gender - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 ; - wikibase:lemma ?singular . - - # MARK: Plural - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pluralForm . - ?pluralForm ontolex:representation ?plural ; - wikibase:grammaticalFeature wd:Q146786 . - } - - # MARK: Gender(s) - - OPTIONAL { - ?lexeme wdt:P5185 ?nounGender . - } - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?nounGender rdfs:label ?gender . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql index a75fab481..c8c1c7b9c 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql @@ -4,19 +4,62 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?noun - ?nonGenitiveDefiniteSingular + ?genitiveIndefiniteSingular + ?genitiveDefiniteSingular + ?genitiveDefinitePlural + ?genitiveIndefinitePlural + ?nonGenitiveDefinitePlural + ?nonGenitiveIndefinitePlural + ?nonGenitiveIndefiniteSingular WHERE { ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 ; - wikibase:lemma ?noun . + wikibase:lexicalCategory wd:Q1084 . - # MARK: Singular + # MARK: Genitive OPTIONAL { - ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . - ?nonGenitiveDefiniteSingularForm ontolex:representation ?nonGenitiveDefiniteSingular ; - wikibase:grammaticalFeature wd:Q98946930, wd:Q53997851, wd:Q110786 . + ?lexeme ontolex:lexicalForm ?genitiveIndefiniteSingularForm . + ?genitiveIndefiniteSingularForm ontolex:representation ?genitiveIndefiniteSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q110786 . } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveDefiniteSingularForm . + ?genitiveDefiniteSingularForm ontolex:representation ?genitiveDefiniteSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997851, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveDefinitePluralForm . + ?genitiveDefinitePluralForm ontolex:representation ?genitiveDefinitePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997851, wd:Q146786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveIndefinitePluralForm . + ?genitiveIndefinitePluralForm ontolex:representation ?genitiveIndefinitePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q146786 . + } + + # MARK: Non-genitive + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveDefinitePluralForm . + ?nonGenitiveDefinitePluralForm ontolex:representation ?nonGenitiveDefinitePlural ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997851, wd:Q146786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveIndefinitePluralForm . + ?nonGenitiveIndefinitePluralForm ontolex:representation ?nonGenitiveIndefinitePlural ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q146786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nonGenitiveIndefiniteSingularForm . + ?nonGenitiveIndefiniteSingularForm ontolex:representation ?nonGenitiveIndefiniteSingular ; + wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . + } + } diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql index 8614beb59..d58030d36 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_2.sparql @@ -8,9 +8,9 @@ SELECT WHERE { ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 ; + wikibase:lexicalCategory wd:Q1084 . - # MARK: Singular + # MARK: Non-genitive OPTIONAL { ?lexeme ontolex:lexicalForm ?nonGenitiveDefiniteSingularForm . diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql deleted file mode 100644 index 3482c72da..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_3.sparql +++ /dev/null @@ -1,20 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nonGenitiveIndefiniteSingular - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 ; - - # MARK: Singular - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nonGenitiveIndefiniteSingularForm . - ?nonGenitiveIndefiniteSingularForm ontolex:representation ?nonGenitiveIndefiniteSingular ; - wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql deleted file mode 100644 index e85b31e78..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_4.sparql +++ /dev/null @@ -1,21 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?genitiveIndefinitePlural - -# MARK: Genitive - -WHERE { - ?lexeme dct:language wd:Q9035 ; # Added language condition - wikibase:lexicalCategory wd:Q1084 ; # Added lexical category condition - - # MARK: Genitive - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genitiveIndefinitePluralForm . - ?genitiveIndefinitePluralForm ontolex:representation ?genitiveIndefinitePlural ; - wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q146786 . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql deleted file mode 100644 index a1c91b986..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_5.sparql +++ /dev/null @@ -1,19 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?genitiveIndefiniteSingular - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 ; - - # MARK: Genitive - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genitiveIndefiniteSingularForm . - ?genitiveIndefiniteSingularForm ontolex:representation ?genitiveIndefiniteSingular ; - wikibase:grammaticalFeature wd:Q146233, wd:Q53997857, wd:Q110786 . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql deleted file mode 100644 index c0eb94360..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_6.sparql +++ /dev/null @@ -1,20 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?genitiveDefinitePlural - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 . - - # MARK: Genitive - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genitiveDefinitePluralForm . - ?genitiveDefinitePluralForm ontolex:representation ?genitiveDefinitePlural ; - wikibase:grammaticalFeature wd:Q146233, wd:Q53997851, wd:Q146786 . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql deleted file mode 100644 index 1f1ba5b1c..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_7.sparql +++ /dev/null @@ -1,20 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nonGenitiveIndefinitePlural - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 . - - # MARK: Plural - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nonGenitiveIndefinitePluralForm . - ?nonGenitiveIndefinitePluralForm ontolex:representation ?nonGenitiveIndefinitePlural ; - wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q146786 . - } -} diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql deleted file mode 100644 index 1f1ba5b1c..000000000 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_8.sparql +++ /dev/null @@ -1,20 +0,0 @@ -# tool: scribe-data -# All Danish (Q9035) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nonGenitiveIndefinitePlural - -WHERE { - ?lexeme dct:language wd:Q9035 ; - wikibase:lexicalCategory wd:Q1084 . - - # MARK: Plural - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nonGenitiveIndefinitePluralForm . - ?nonGenitiveIndefinitePluralForm ontolex:representation ?nonGenitiveIndefinitePlural ; - wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q146786 . - } -} From 545602d7f02f5ed512dc748258c414a18f7c5638 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Thu, 31 Oct 2024 10:12:42 +0100 Subject: [PATCH 5/5] Minor spacing update --- .../language_data_extraction/danish/nouns/query_nouns_1.sparql | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql index c8c1c7b9c..7eccf9f1c 100644 --- a/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/danish/nouns/query_nouns_1.sparql @@ -61,5 +61,4 @@ WHERE { ?nonGenitiveIndefiniteSingularForm ontolex:representation ?nonGenitiveIndefiniteSingular ; wikibase:grammaticalFeature wd:Q98946930, wd:Q53997857, wd:Q110786 . } - }