From 8528d139b702fe7972ce873876ed6ff45c117389 Mon Sep 17 00:00:00 2001 From: axif Date: Fri, 18 Oct 2024 16:02:06 +0600 Subject: [PATCH 01/30] Latin adverbs & prepositions query --- .../Latin/adverbs/query_adverbs.sparql | 12 ++++++++++++ .../Latin/prepositions/query_prepositions.sparql | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql create mode 100644 src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql diff --git a/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql new file mode 100644 index 000000000..2c76c2867 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql @@ -0,0 +1,12 @@ +# tool: scribe-data +# All Latin language (Q397) adverbs (Q380057) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adverb +WHERE { + ?lexeme dct:language wd:Q397 ; + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?adverb . # Retrieve the lemma (base form) of the adverb +} diff --git a/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql new file mode 100644 index 000000000..aa4dcde78 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql @@ -0,0 +1,12 @@ +# tool: scribe-data +# All Latin language (Q397) postpositions (Q4833830) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?preposition +WHERE { + ?lexeme dct:language wd:Q397 ; + wikibase:lexicalCategory wd:Q4833830 ; + wikibase:lemma ?preposition . # Retrieve the lemma (base form) of the preposition +} From d158af8d277370c626eeadf20323a7f1b96b326d Mon Sep 17 00:00:00 2001 From: Khushalsarode Date: Fri, 18 Oct 2024 21:19:53 +0530 Subject: [PATCH 02/30] added nouns query for latvian language --- .../Latvian/nouns/nouns_query.sparql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql diff --git a/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql new file mode 100644 index 000000000..6703b9e27 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Latvian (Q9078) Nouns (Q1084) and the given lemma (base forms). +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nouns +WHERE { + ?lexeme dct:language wd:Q9078 ; + wikibase:lexicalCategory wd:Q1084 ; + wikibase:lemma ?nouns . + FILTER(LANG(?nouns) = "lv"). +} From d109640fa082cb163b000db0ec75b76e0f151fa3 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sat, 19 Oct 2024 14:52:35 +0300 Subject: [PATCH 03/30] adding a sparql file in Nynorsk/prepositions for Nynorsk prepositions --- .../Norwegian/Nynorsk/adverbs/query_adverbs.sparql | 1 - .../Norwegian/Nynorsk/prepositions/query_prepositions.sparql | 0 2 files changed, 1 deletion(-) create mode 100644 src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adverbs/query_adverbs.sparql index aabda3216..b24be0896 100644 --- a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adverbs/query_adverbs.sparql @@ -14,4 +14,3 @@ WHERE { wikibase:lemma ?adverb . } -Order by ?lexemeID diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql new file mode 100644 index 000000000..e69de29bb From 6803c00a3692c65ee2c68e100a9f97aa83392e25 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sat, 19 Oct 2024 17:51:44 +0300 Subject: [PATCH 04/30] simple sparql query for fetching Nynorsk Norwegian prepositions from wikidata --- .../prepositions/query_prepositions.sparql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql index e69de29bb..0c72e8cfe 100644 --- a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql @@ -0,0 +1,15 @@ +# tool: scribe-data +# All Nynorsk Norwegian (Q25164) prepositions. +# Enter this query at https://query.wikidata.org/. + +# Note: This query is for Nynorsk (Q25164) rather than Bokmål (Q25167). + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?preposition + +WHERE { + ?lexeme dct:language wd:Q25164 ; + wikibase:lexicalCategory wd:Q4833830 ; + wikibase:lemma ?preposition . +} From 8242035ee0238dc90ac17a32d30212da51d834e0 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sat, 19 Oct 2024 19:20:03 +0300 Subject: [PATCH 05/30] Nynorsk Norwegian adjectives sparql file --- .../Nynorsk/adjectives/query_adjectives.sparql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql new file mode 100644 index 000000000..515038070 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql @@ -0,0 +1,15 @@ +# tool: scribe-data +# All Nynorsk Norwegian (Q25164) adjectives. +# Enter this query at https://query.wikidata.org/. + +# Note: This query is for Nynorsk (Q25164) rather than Bokmål (Q25167). + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adjectives + +WHERE { + ?lexeme dct:language wd:Q25164 ; + wikibase:lexicalCategory wd:Q34698 ; + wikibase:lemma ?adjectives . +} From ab3223bd2ea92b973e9dd20a7416d8445042f667 Mon Sep 17 00:00:00 2001 From: Khushalsarode Date: Sun, 20 Oct 2024 01:03:15 +0530 Subject: [PATCH 06/30] added uppdated query for Latvian nouns with nouns forms --- .../Latvian/nouns/nouns_query.sparql | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql index 6703b9e27..9abcd0212 100644 --- a/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql +++ b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql @@ -1,13 +1,38 @@ # tool: scribe-data -# All Latvian (Q9078) Nouns (Q1084) and the given lemma (base forms). +# All Latvian (Q9078) nouns, their plurals and their genders. # Enter this query at https://query.wikidata.org/. +# All Masculine and Feminine forms of nouns for latvian -SELECT +SELECT DISTINCT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nouns + ?singular + ?plural + ?gender + WHERE { + VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns & pronouns + ?lexeme dct:language wd:Q9078 ; - wikibase:lexicalCategory wd:Q1084 ; - wikibase:lemma ?nouns . - FILTER(LANG(?nouns) = "lv"). + wikibase:lexicalCategory ?nounTypes ; + 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 . + FILTER NOT EXISTS { + ?lexeme wdt:P31 wd:Q202444 . + } + } . + + SERVICE wikibase:label { + bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". + ?nounGender rdfs:label ?gender . + } } From 35fdf93d818a4aaf76f31e31dfa684ed243d6f36 Mon Sep 17 00:00:00 2001 From: Ekikereabasi Nkereuwem Date: Sat, 19 Oct 2024 02:15:46 +0100 Subject: [PATCH 07/30] Igbo data queries --- .../Igbo/adjectives/adjective_query.sparql | 216 ++++++++++++++++++ .../Igbo/adverbs/adverb_query.sparql | 69 ++++++ .../Igbo/nouns/noun_query_1.sparql | 176 ++++++++++++++ .../Igbo/nouns/noun_query_2.sparql | 141 ++++++++++++ .../prepositions/preposition_query.sparql | 28 +++ 5 files changed, 630 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql create mode 100644 src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql create mode 100644 src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql create mode 100644 src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql create mode 100644 src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql diff --git a/src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql b/src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql new file mode 100644 index 000000000..946926b16 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql @@ -0,0 +1,216 @@ +# tool: scribe-data +# Igbo adjective and their corresponding grammatical features. +# Enter this query at https://query.wikidata.org/ + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adjective + ?singular + ?plural + ?pastParticiple + ?presentParticiple + ?presentTense + ?gerund + ?adjectivalAttribute + ?naAdjective + ?comparative + ?superlative + ?numeral + ?positive + ?demonstrativeAdjective + ?abstractNoun + ?verb + ?synonym + ?preposition + ?numeralSystem + ?adjectiveReduplication + ?adjectivePrenomial + ?pastTense + ?presentContinuous + ?noun + ?presentTensePastTense + ?nominal + +WHERE { + ?lexeme dct:language wd:Q33578; + wikibase:lexicalCategory wd:Q34698; + wikibase:lemma ?adjective . + + # MARK: Singular + OPTIONAL { + ?lexeme ontolex:lexicalForm ?singularForm . + ?singularForm ontolex:representation ?singular ; + wikibase:grammaticalFeature wd:Q110786 . + } + + # MARK: Plural + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pluralForm . + ?pluralForm ontolex:representation ?plural ; + wikibase:grammaticalFeature wd:Q146786 . + } + + # MARK: Past Participle + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastParticipleForm . + ?pastParticipleForm ontolex:representation ?pastParticiple ; + wikibase:grammaticalFeature wd:Q12717679 . + } + + # MARK: Present Participle + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentParticipleForm . + ?presentParticipleForm ontolex:representation ?presentParticiple ; + wikibase:grammaticalFeature wd:Q10345583 . + } + + # MARK: Present Tense + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentTenseForm . + ?presentTenseForm ontolex:representation ?presentTense ; + wikibase:grammaticalFeature wd:Q192613 . + + # MARK: Gerund + OPTIONAL { + ?lexeme ontolex:lexicalForm ?gerundForm . + ?gerundForm ontolex:representation ?gerund ; + wikibase:grammaticalFeature wd:Q1923028 . + } + + # MARK: Adjectival Attribute + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectivalAttributeForm . + ?adjectivalAttributeForm ontolex:representation ?adjectivalAttribute ; + wikibase:grammaticalFeature wd:Q10401368 . + } + + # MARK: Na-Adjective + OPTIONAL { + ?lexeme ontolex:lexicalForm ?naAdjectiveForm . + ?naAdjectiveForm ontolex:representation ?naAdjective ; + wikibase:grammaticalFeature wd:Q1091269 . + } + + # MARK: Comparative + OPTIONAL { + ?lexeme ontolex:lexicalForm ?comparativeForm . + ?comparativeForm ontolex:representation ?comparative ; + wikibase:grammaticalFeature wd:Q14169499 . + } + + # MARK: Superlative + OPTIONAL { + ?lexeme ontolex:lexicalForm ?superlativeForm . + ?superlativeForm ontolex:representation ?superlative ; + wikibase:grammaticalFeature wd:Q1817208 . + } + + # MARK: Numeral + OPTIONAL { + ?lexeme ontolex:lexicalForm ?numeralForm . + ?numeralForm ontolex:representation ?numeral ; + wikibase:grammaticalFeature wd:Q63116 . + } + + # MARK: Positive + OPTIONAL { + ?lexeme ontolex:lexicalForm ?positiveForm . + ?positiveForm ontolex:representation ?positive ; + wikibase:grammaticalFeature wd:Q3482678 . + } + + # MARK: Demonstrative Adjective + OPTIONAL { + ?lexeme ontolex:lexicalForm ?demonstrativeAdjectiveForm . + ?demonstrativeAdjectiveForm ontolex:representation ?demonstrativeAdjective ; + wikibase:grammaticalFeature wd:Q2824480 . + } + + # MARK: Abstract Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?abstractNounForm . + ?abstractNounForm ontolex:representation ?abstractNoun ; + wikibase:grammaticalFeature wd:Q2712963 . + } + + # MARK: Verb + OPTIONAL { + ?lexeme ontolex:lexicalForm ?verbForm . + ?verbForm ontolex:representation ?verb ; + wikibase:grammaticalFeature wd:Q24905 . + } + + # MARK: Synonym + OPTIONAL { + ?lexeme ontolex:lexicalForm ?synonymForm . + ?synonymForm ontolex:representation ?synonym ; + wikibase:grammaticalFeature wd:Q42106 . + } + + # MARK: Preposition + OPTIONAL { + ?lexeme ontolex:lexicalForm ?prepositionForm . + ?prepositionForm ontolex:representation ?preposition ; + wikibase:grammaticalFeature wd:Q4833830 . + } + + # MARK: Numeral System + OPTIONAL { + ?lexeme ontolex:lexicalForm ?numeralSystemForm . + ?numeralSystemForm ontolex:representation ?numeralSystem ; + wikibase:grammaticalFeature wd:Q122653 . + } + + # MARK: Adjective Reduplication + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectiveReduplicationForm . + ?adjectiveReduplicationForm ontolex:representation ?adjectiveReduplication ; + wikibase:grammaticalFeature wd:Q221446 . + } + + # MARK: Prenominal adjective + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectivePositiveForm . + ?adjectivePositiveForm ontolex:representation ?adjectivePositive ; + wikibase:grammaticalFeature wd:Q12259986 . + } + + # MARK: Past Tense + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastTenseForm . + ?pastTenseForm ontolex:representation ?pastTense ; + wikibase:grammaticalFeature wd:Q1994301 . + } + + # MARK: Present Continuous + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentContinuousForm . + ?presentContinuousForm ontolex:representation ?presentContinuous ; + wikibase:grammaticalFeature wd:Q7240943 . + } + + # MARK: Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectiveSuperlativeForm . + ?adjectiveSuperlativeForm ontolex:representation ?adjectiveSuperlative ; + wikibase:grammaticalFeature wd:Q1084 . + } + + # MARK: Present Tense and Past Tense + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentTensePastTenseForm . + ?presentTensePastTenseForm ontolex:representation ?presentTensePastTense ; + wikibase:grammaticalFeature wd:Q192613 ; + wikibase:grammaticalFeature wd:Q1994301 . + } + + # MARK: Nominal + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectiveNaAdjectiveForm . + ?adjectiveNaAdjectiveForm ontolex:representation ?adjectiveNaAdjective ; + wikibase:grammaticalFeature wd:Q503992 . + } + +} + +} diff --git a/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql b/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql new file mode 100644 index 000000000..176e5cc16 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql @@ -0,0 +1,69 @@ +# tool: scribe-data +# Igbo adverbs and their corresponding grammatical features. +# Enter this query at https://query.wikidata.org/ + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adverb + ?adverbialPhrase + ?pastParticiple + ?synonym + ?adverbial + ?determiner + ?futureTense + ?noun +WHERE { + ?lexeme dct:language wd:Q33578 ; + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?adverb . + + # MARK: Adverbial phrases + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adverbialPhraseForm . + ?adverbialPhraseForm ontolex:representation ?adverbialPhrase ; + wikibase:grammaticalFeature wd:Q3734650 . + } + + # MARK: Past participles + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastParticipleForm . + ?pastParticipleForm ontolex:representation ?pastParticiple ; + wikibase:grammaticalFeature wd:Q12717679 . + } + + # MARK: Synonyms + OPTIONAL { + ?lexeme ontolex:lexicalForm ?synonymForm . + ?synonymForm ontolex:representation ?synonym ; + wikibase:grammaticalFeature wd:Q42106 . + } + + # MARK: Adverbials + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adverbialForm . + ?adverbialForm ontolex:representation ?adverbial ; + wikibase:grammaticalFeature wd:Q380012. + } + + # MARK: Determiners + OPTIONAL { + ?lexeme ontolex:lexicalForm ?determinerForm . + ?determinerForm ontolex:representation ?determiner ; + wikibase:grammaticalFeature wd:Q576271 . + } + + # MARK: Future tense forms + OPTIONAL { + ?lexeme ontolex:lexicalForm ?futureTenseForm . + ?futureTenseForm ontolex:representation ?futureTense ; + wikibase:grammaticalFeature wd:Q501405 . + } + + # MARK: Nouns + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nounForm . + ?nounForm ontolex:representation ?noun ; + wikibase:grammaticalFeature wd:Q1084 . + } + +} diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql new file mode 100644 index 000000000..1f2c67db5 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql @@ -0,0 +1,176 @@ +# tool: scribe-data +# Igbo nouns and their grammatical features. +# Enter this query at https://query.wikidata.org/ + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?noun + ?singular + ?countNoun + ?massNoun + ?commonNoun + ?nounPhrase + ?numeral + ?uncountableSet + ?synonym + ?antonym + ?plural + ?concreteNoun + ?article + ?determiner + ?pluraleTantum + ?nominal + ?properNoun + ?abstractNoun + ?compoundNoun + ?gender + ?nominativeCase + + +WHERE { + ?lexeme dct:language wd:Q33578 ; # Igbo language + wikibase:lexicalCategory wd:Q1084 ; # noun + wikibase:lemma ?noun . + + # MARK: Singular + OPTIONAL { + ?lexeme ontolex:lexicalForm ?singularForm . + ?singularForm ontolex:representation ?singular ; + wikibase:grammaticalFeature wd:Q110786 . + } + + # MARK: Count Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?countNounForm . + ?countNounForm ontolex:representation ?countNoun ; + wikibase:grammaticalFeature wd:Q1520033 . + } + + # MARK: Mass Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?massNounForm . + ?massNounForm ontolex:representation ?massNoun ; + wikibase:grammaticalFeature wd:Q489168 . + } + + # MARK: Common Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?commonNounForm . + ?commonNounForm ontolex:representation ?commonNoun ; + wikibase:grammaticalFeature wd:Q2428747 . + } + + # MARK: Noun Phrase + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nounPhraseForm . + ?nounPhraseForm ontolex:representation ?nounPhrase ; + wikibase:grammaticalFeature wd:Q1401131 . + } + + # MARK: Numeral + OPTIONAL { + ?lexeme ontolex:lexicalForm ?numeralForm . + ?numeralForm ontolex:representation ?numeral ; + wikibase:grammaticalFeature wd:Q63116 . + } + + # MARK: Uncountable Set + OPTIONAL { + ?lexeme ontolex:lexicalForm ?uncountableSetForm . + ?uncountableSetForm ontolex:representation ?uncountableSet ; + wikibase:grammaticalFeature wd:Q1128796 . + } + + # MARK: Synonym + OPTIONAL { + ?lexeme ontolex:lexicalForm ?synonymForm . + ?synonymForm ontolex:representation ?synonym ; + wikibase:grammaticalFeature wd:Q42106 . + } + + # MARK: Antonym + OPTIONAL { + ?lexeme ontolex:lexicalForm ?antonymForm . + ?antonymForm ontolex:representation ?antonym ; + wikibase:grammaticalFeature wd:Q131779 . + } + + # MARK: Plural + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pluralForm . + ?pluralForm ontolex:representation ?plural ; + wikibase:grammaticalFeature wd:Q146786 . + } + + # MARK: Concrete Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?concreteNounForm . + ?concreteNounForm ontolex:representation ?concreteNoun ; + wikibase:grammaticalFeature wd:Q2646610 . + } + + # MARK: Article + OPTIONAL { + ?lexeme ontolex:lexicalForm ?articleForm . + ?articleForm ontolex:representation ?article ; + wikibase:grammaticalFeature wd:Q103184 . + } + + # MARK: Determiner + OPTIONAL { + ?lexeme ontolex:lexicalForm ?determinerForm . + ?determinerForm ontolex:representation ?determiner ; + wikibase:grammaticalFeature wd:Q576271 . + } + + # MARK: Plurale Tantum + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pluraleTantumForm . + ?pluraleTantumForm ontolex:representation ?pluraleTantum ; + wikibase:grammaticalFeature wd:Q138246 . + } + + # MARK: Nominal + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominalForm . + ?nominalForm ontolex:representation ?nominal ; + wikibase:grammaticalFeature wd:Q503992 . + } + + # MARK: Proper Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?properNounForm . + ?properNounForm ontolex:representation ?properNoun ; + wikibase:grammaticalFeature wd:Q147276 . + } + + # MARK: Abstract Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?abstractNounForm . + ?abstractNounForm ontolex:representation ?abstractNoun ; + wikibase:grammaticalFeature wd:Q2712963 . + } + + # MARK: Compound Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?compoundNounForm . + ?compoundNounForm ontolex:representation ?compoundNoun ; + wikibase:grammaticalFeature wd:Q43369910 . + } + + # MARK: Gender + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genderForm . + ?genderForm ontolex:representation ?gender ; + wikibase:grammaticalFeature wd:Q48277 . + } + + # MARK: Nominative Case + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativeCaseForm . + ?nominativeCaseForm ontolex:representation ?nominativeCase ; + wikibase:grammaticalFeature wd:Q131105 . + } + + +} diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql new file mode 100644 index 000000000..70bfe9479 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql @@ -0,0 +1,141 @@ +# tool: scribe-data +# Igbo nouns and their corresponding grammatical features. +# Enter this query at https://query.wikidata.org/ + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?noun + ?presentParticiple + ?pastParticiple + ?presentTense + ?imperative + ?pastTense + ?adjective + ?verbalNoun + ?infinitive + ?agent + ?verbPhrase + ?syntax + ?phoneme + ?phonology + ?soundSymbolism + ?suffix + ?numeralAdjective + +WHERE { + ?lexeme dct:language wd:Q33578 ; # Igbo language + wikibase:lexicalCategory wd:Q1084 ; # Lexical category: noun + wikibase:lemma ?noun . + + # MARK: Present Participle + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentParticipleForm . + ?presentParticipleForm ontolex:representation ?presentParticiple ; + wikibase:grammaticalFeature wd:Q10345583 . + } + + # MARK: Past Participle + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastParticipleForm . + ?pastParticipleForm ontolex:representation ?pastParticiple ; + wikibase:grammaticalFeature wd:Q12717679 . + } + + # MARK: Present Tense + OPTIONAL { + ?lexeme ontolex:lexicalForm ?presentTenseForm . + ?presentTenseForm ontolex:representation ?presentTense ; + wikibase:grammaticalFeature wd:Q192613 . + } + + # MARK: Imperative + OPTIONAL { + ?lexeme ontolex:lexicalForm ?imperativeForm . + ?imperativeForm ontolex:representation ?imperative ; + wikibase:grammaticalFeature wd:Q22716 . + } + + # MARK: Past Tense + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastTenseForm . + ?pastTenseForm ontolex:representation ?pastTense ; + wikibase:grammaticalFeature wd:Q1994301 . + } + + # MARK: Adjective + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adjectiveForm . + ?adjectiveForm ontolex:representation ?adjective ; + wikibase:grammaticalFeature wd:Q34698 . + } + + # MARK: Verbal Noun + OPTIONAL { + ?lexeme ontolex:lexicalForm ?verbalNounForm . + ?verbalNounForm ontolex:representation ?verbalNoun ; + wikibase:grammaticalFeature wd:Q7920975 . + } + + # MARK: Infinitive + OPTIONAL { + ?lexeme ontolex:lexicalForm ?infinitiveForm . + ?infinitiveForm ontolex:representation ?infinitive ; + wikibase:grammaticalFeature wd:Q179230 . + } + + # MARK: Agent + OPTIONAL { + ?lexeme ontolex:lexicalForm ?agentForm . + ?agentForm ontolex:representation ?agent ; + wikibase:grammaticalFeature wd:Q392648 . + } + + # MARK: Verb Phrase + OPTIONAL { + ?lexeme ontolex:lexicalForm ?verbPhraseForm . + ?verbPhraseForm ontolex:representation ?verbPhrase ; + wikibase:grammaticalFeature wd:Q1778442 . + } + + # MARK: Syntax + OPTIONAL { + ?lexeme ontolex:lexicalForm ?syntaxForm . + ?syntaxForm ontolex:representation ?syntax ; + wikibase:grammaticalFeature wd:Q37437 . + } + + # MARK: Phoneme + OPTIONAL { + ?lexeme ontolex:lexicalForm ?phonemeForm . + ?phonemeForm ontolex:representation ?phoneme ; + wikibase:grammaticalFeature wd:Q8183 . + } + + # MARK: Phonology + OPTIONAL { + ?lexeme ontolex:lexicalForm ?phonologyForm . + ?phonologyForm ontolex:representation ?phonology ; + wikibase:grammaticalFeature wd:Q40998 . + } + + # MARK: Sound Symbolism + OPTIONAL { + ?lexeme ontolex:lexicalForm ?soundSymbolismForm . + ?soundSymbolismForm ontolex:representation ?soundSymbolism ; + wikibase:grammaticalFeature wd:Q2475268 . + } + + # MARK: Suffix + OPTIONAL { + ?lexeme ontolex:lexicalForm ?suffixForm . + ?suffixForm ontolex:representation ?suffix ; + wikibase:grammaticalFeature wd:Q102047 . + } + + # MARK: Numeral Adjective + OPTIONAL { + ?lexeme ontolex:lexicalForm ?numeralAdjectiveForm . + ?numeralAdjectiveForm ontolex:representation ?numeralAdjective ; + wikibase:grammaticalFeature wd:Q55951821. + } +} diff --git a/src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql b/src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql new file mode 100644 index 000000000..6bfe7063b --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql @@ -0,0 +1,28 @@ +# tool: scribe-data +# Igbo preposition and their corresponding grammatical features. +# Enter this query at https://query.wikidata.org/ + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?preposition + ?synonym + ?contraction +WHERE { + ?lexeme dct:language wd:Q33578 ; + wikibase:lexicalCategory wd:Q4833830 ; + wikibase:lemma ?preposition . + + # MARK: Synonym + OPTIONAL { + ?lexeme ontolex:lexicalForm ?synonymForm . + ?synonymForm ontolex:representation ?synonym ; + wikibase:grammaticalFeature wd:Q42106. + } + + # MARK: Contraction + OPTIONAL { + ?lexeme ontolex:lexicalForm ?contractionForm . + ?contractionForm ontolex:representation ?contraction ; + wikibase:grammaticalFeature wd:Q126473 . + } + } From 9adc0517bcd984103c61e917c586e23a06f5365c Mon Sep 17 00:00:00 2001 From: Ekikereabasi Nkereuwem Date: Sat, 19 Oct 2024 19:27:08 +0100 Subject: [PATCH 08/30] Rename Igbo data queries SPARQL files --- ...e_query.sparql => query_adjectives.sparql} | 2 +- .../Igbo/adverbs/adverb_query.sparql | 69 ------------------- .../Igbo/adverbs/query_adverbs.sparql | 66 ++++++++++++++++-- ...un_query_1.sparql => query_nouns_1.sparql} | 2 +- ...un_query_2.sparql => query_nouns_2.sparql} | 2 +- ...query.sparql => query_prepositions.sparql} | 2 +- 6 files changed, 65 insertions(+), 78 deletions(-) rename src/scribe_data/language_data_extraction/Igbo/adjectives/{adjective_query.sparql => query_adjectives.sparql} (98%) delete mode 100644 src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql rename src/scribe_data/language_data_extraction/Igbo/nouns/{noun_query_1.sparql => query_nouns_1.sparql} (98%) rename src/scribe_data/language_data_extraction/Igbo/nouns/{noun_query_2.sparql => query_nouns_2.sparql} (97%) rename src/scribe_data/language_data_extraction/Igbo/prepositions/{preposition_query.sparql => query_prepositions.sparql} (89%) diff --git a/src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql similarity index 98% rename from src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql rename to src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql index 946926b16..fc808b3dc 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adjectives/adjective_query.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# Igbo adjective and their corresponding grammatical features. +# Igbo (Q33578) adjective (Q34698) and their corresponding grammatical features. # Enter this query at https://query.wikidata.org/ SELECT diff --git a/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql b/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql deleted file mode 100644 index 176e5cc16..000000000 --- a/src/scribe_data/language_data_extraction/Igbo/adverbs/adverb_query.sparql +++ /dev/null @@ -1,69 +0,0 @@ -# tool: scribe-data -# Igbo adverbs and their corresponding grammatical features. -# Enter this query at https://query.wikidata.org/ - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?adverb - ?adverbialPhrase - ?pastParticiple - ?synonym - ?adverbial - ?determiner - ?futureTense - ?noun -WHERE { - ?lexeme dct:language wd:Q33578 ; - wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?adverb . - - # MARK: Adverbial phrases - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adverbialPhraseForm . - ?adverbialPhraseForm ontolex:representation ?adverbialPhrase ; - wikibase:grammaticalFeature wd:Q3734650 . - } - - # MARK: Past participles - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastParticipleForm . - ?pastParticipleForm ontolex:representation ?pastParticiple ; - wikibase:grammaticalFeature wd:Q12717679 . - } - - # MARK: Synonyms - OPTIONAL { - ?lexeme ontolex:lexicalForm ?synonymForm . - ?synonymForm ontolex:representation ?synonym ; - wikibase:grammaticalFeature wd:Q42106 . - } - - # MARK: Adverbials - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adverbialForm . - ?adverbialForm ontolex:representation ?adverbial ; - wikibase:grammaticalFeature wd:Q380012. - } - - # MARK: Determiners - OPTIONAL { - ?lexeme ontolex:lexicalForm ?determinerForm . - ?determinerForm ontolex:representation ?determiner ; - wikibase:grammaticalFeature wd:Q576271 . - } - - # MARK: Future tense forms - OPTIONAL { - ?lexeme ontolex:lexicalForm ?futureTenseForm . - ?futureTenseForm ontolex:representation ?futureTense ; - wikibase:grammaticalFeature wd:Q501405 . - } - - # MARK: Nouns - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nounForm . - ?nounForm ontolex:representation ?noun ; - wikibase:grammaticalFeature wd:Q1084 . - } - -} diff --git a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql index 6d3717bcb..7ed8c8765 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql @@ -1,13 +1,69 @@ # tool: scribe-data -# All Igbo (Q33578) adverbs and the given forms. -# Enter this query at https://query.wikidata.org/. +# Igbo (Q33578) adverbs (Q380057) and their corresponding grammatical features. +# Enter this query at https://query.wikidata.org/ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?adverb - + ?adverbialPhrase + ?pastParticiple + ?synonym + ?adverbial + ?determiner + ?futureTense + ?noun WHERE { ?lexeme dct:language wd:Q33578 ; - wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?adverb . + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?adverb . + + # MARK: Adverbial phrases + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adverbialPhraseForm . + ?adverbialPhraseForm ontolex:representation ?adverbialPhrase ; + wikibase:grammaticalFeature wd:Q3734650 . + } + + # MARK: Past participles + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pastParticipleForm . + ?pastParticipleForm ontolex:representation ?pastParticiple ; + wikibase:grammaticalFeature wd:Q12717679 . + } + + # MARK: Synonyms + OPTIONAL { + ?lexeme ontolex:lexicalForm ?synonymForm . + ?synonymForm ontolex:representation ?synonym ; + wikibase:grammaticalFeature wd:Q42106 . + } + + # MARK: Adverbials + OPTIONAL { + ?lexeme ontolex:lexicalForm ?adverbialForm . + ?adverbialForm ontolex:representation ?adverbial ; + wikibase:grammaticalFeature wd:Q380012. + } + + # MARK: Determiners + OPTIONAL { + ?lexeme ontolex:lexicalForm ?determinerForm . + ?determinerForm ontolex:representation ?determiner ; + wikibase:grammaticalFeature wd:Q576271 . + } + + # MARK: Future tense forms + OPTIONAL { + ?lexeme ontolex:lexicalForm ?futureTenseForm . + ?futureTenseForm ontolex:representation ?futureTense ; + wikibase:grammaticalFeature wd:Q501405 . + } + + # MARK: Nouns + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nounForm . + ?nounForm ontolex:representation ?noun ; + wikibase:grammaticalFeature wd:Q1084 . + } + } diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql similarity index 98% rename from src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql rename to src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql index 1f2c67db5..30d007bda 100644 --- a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_1.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# Igbo nouns and their grammatical features. +# Igbo (Q33578) nouns (Q1084) and their grammatical features. # Enter this query at https://query.wikidata.org/ SELECT diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql similarity index 97% rename from src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql rename to src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql index 70bfe9479..5a641c8fe 100644 --- a/src/scribe_data/language_data_extraction/Igbo/nouns/noun_query_2.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# Igbo nouns and their corresponding grammatical features. +# Igbo (Q33578) nouns (Q1084) and their corresponding grammatical features. # Enter this query at https://query.wikidata.org/ SELECT diff --git a/src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql similarity index 89% rename from src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql rename to src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql index 6bfe7063b..7d065be5b 100644 --- a/src/scribe_data/language_data_extraction/Igbo/prepositions/preposition_query.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# Igbo preposition and their corresponding grammatical features. +# Igbo (Q33578) preposition (Q4833830) and their corresponding grammatical features. # Enter this query at https://query.wikidata.org/ SELECT From 674f29f4ff55d63821d02a1b8fee55e0c8c230fd Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 00:46:40 +0200 Subject: [PATCH 09/30] Add forms to adjectives and header to both queries --- .../adjectives/query_adjectives.sparql | 43 +++++++++++++++++-- .../prepositions/query_prepositions.sparql | 2 +- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql index 515038070..1b72d7048 100644 --- a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/adjectives/query_adjectives.sparql @@ -1,15 +1,52 @@ # tool: scribe-data -# All Nynorsk Norwegian (Q25164) adjectives. +# All Nynorsk Norwegian (Q25164) adjectives (Q34698) and the given forms. # Enter this query at https://query.wikidata.org/. # Note: This query is for Nynorsk (Q25164) rather than Bokmål (Q25167). SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?adjectives + ?adjective + ?commonSingularIndefinite + ?neuterSingularIndefinite + ?singularDefinite + ?plural + WHERE { ?lexeme dct:language wd:Q25164 ; wikibase:lexicalCategory wd:Q34698 ; - wikibase:lemma ?adjectives . + wikibase:lemma ?adjective . + + # MARK: Common Indefinite + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?commonSingularIndefiniteForm . + ?commonSingularIndefiniteForm ontolex:representation ?commonSingularIndefinite ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q499327, wd:Q110786, wd:Q53997857. + } + + # MARK: Neuter Indefinite + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterSingularIndefiniteForm . + ?neuterSingularIndefiniteForm ontolex:representation ?neuterSingularIndefinite ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q110786, wd:Q53997857 . + } + + # MARK: Definite + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?singularDefiniteForm . + ?singularDefiniteForm ontolex:representation ?singularDefinite ; + wikibase:grammaticalFeature wd:Q110786, wd:Q53997851 . + } + + # MARK: Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?pluralForm . + ?pluralForm ontolex:representation ?plural ; + wikibase:grammaticalFeature wd:Q146786 . + } } diff --git a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql index 0c72e8cfe..017e77fba 100644 --- a/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Norwegian/Nynorsk/prepositions/query_prepositions.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# All Nynorsk Norwegian (Q25164) prepositions. +# All Nynorsk Norwegian (Q25164) prepositions (Q4833830) and the given forms. # Enter this query at https://query.wikidata.org/. # Note: This query is for Nynorsk (Q25164) rather than Bokmål (Q25167). From d2b11f53f8577042bcd40f53eadac0b140b457e1 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 01:09:26 +0200 Subject: [PATCH 10/30] Add missing forms to Latvian nouns --- .../Latvian/nouns/nouns_query.sparql | 133 +++++++++++++++--- 1 file changed, 115 insertions(+), 18 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql index 9abcd0212..6d8fed194 100644 --- a/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql +++ b/src/scribe_data/language_data_extraction/Latvian/nouns/nouns_query.sparql @@ -1,34 +1,131 @@ # tool: scribe-data -# All Latvian (Q9078) nouns, their plurals and their genders. +# All Latvian (Q9078) nouns (Q1084) and the given forms. # Enter this query at https://query.wikidata.org/. -# All Masculine and Feminine forms of nouns for latvian SELECT DISTINCT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?singular - ?plural + ?nominativeSingular + ?nominativePlural + ?genitiveSingular + ?genitivePlural + ?dativeSingular + ?dativePlural + ?accusativeSingular + ?accusativePlural + ?instrumentalSingular + ?instrumentalPlural + ?locativeSingular + ?locativePlural + ?vocativeSingular + ?vocativePlural ?gender WHERE { - VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns & pronouns - ?lexeme dct:language wd:Q9078 ; - wikibase:lexicalCategory ?nounTypes ; - wikibase:lemma ?singular . - - # MARK: Plural - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pluralForm . - ?pluralForm ontolex:representation ?plural ; - wikibase:grammaticalFeature wd:Q146786 ; - } . + wikibase:lexicalCategory wd:Q1084 . + + # MARK: Nominative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativeSingularForm . + ?nominativeSingularForm ontolex:representation ?nominativeSingular ; + wikibase:grammaticalFeature wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativePluralForm . + ?nominativePluralForm ontolex:representation ?nominativePlural ; + wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . + } + + # MARK: Genitive + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveSingularForm . + ?genitiveSingularForm ontolex:representation ?genitiveSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitivePluralForm . + ?genitivePluralForm ontolex:representation ?genitivePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . + } + + # MARK: Dative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativeSingularForm . + ?dativeSingularForm ontolex:representation ?dativeSingular ; + wikibase:grammaticalFeature wd:Q145599, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativePluralForm . + ?dativePluralForm ontolex:representation ?dativePlural ; + wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . + } + + # MARK: Accusative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativeSingularForm . + ?accusativeSingularForm ontolex:representation ?accusativeSingular ; + wikibase:grammaticalFeature wd:Q146078, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativePluralForm . + ?accusativePluralForm ontolex:representation ?accusativePlural ; + wikibase:grammaticalFeature wd:Q146078, wd:Q146786 . + } + + # MARK: Instrumental + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalSingularForm . + ?instrumentalSingularForm ontolex:representation ?instrumentalSingular ; + wikibase:grammaticalFeature wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalPluralForm . + ?instrumentalPluralForm ontolex:representation ?instrumentalPlural ; + wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . + } + + # MARK: Locative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativeSingularForm . + ?locativeSingularForm ontolex:representation ?locativeSingular ; + wikibase:grammaticalFeature wd:Q202142, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativePluralForm . + ?locativePluralForm ontolex:representation ?locativePlural ; + wikibase:grammaticalFeature wd:Q202142, wd:Q146786 . + } + + # MARK: Vocative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativeSingularForm . + ?vocativeSingularForm ontolex:representation ?vocativeSingular ; + wikibase:grammaticalFeature wd:Q185077, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativePluralForm . + ?vocativePluralForm ontolex:representation ?vocativePlural ; + wikibase:grammaticalFeature wd:Q185077, wd:Q146786 . + } # MARK: Gender(s) + OPTIONAL { ?lexeme wdt:P5185 ?nounGender . - FILTER NOT EXISTS { - ?lexeme wdt:P31 wd:Q202444 . - } } . SERVICE wikibase:label { From b5f840b8b72251cbdad079d07aabdadc1cfe409c Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sun, 20 Oct 2024 03:27:16 +0300 Subject: [PATCH 11/30] russian adjectives sparql file --- .../Russian/adjectives/query_adjectives.sparql | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql diff --git a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql new file mode 100644 index 000000000..e69de29bb From 413c32af5771c058de5a4257724522aa8d60a171 Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sun, 20 Oct 2024 03:31:30 +0300 Subject: [PATCH 12/30] sparql query for russian adjectives with most common forms included and the new header --- .../adjectives/query_adjectives.sparql | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql index e69de29bb..f81b023d7 100644 --- a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql @@ -0,0 +1,97 @@ +# tool: scribe-data +# All Russian (Q7737) adjectives (Q34698) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adjective + ?masculineNominativeSingular + ?neuterNominativeSingular + ?feminineNominativeSingular + ?nominativePlural + ?genitivePlural + ?dativePlural + ?animateAccusativePlural + ?inanimateAccusativePlural + ?femininePrepositionalSingular + ?prepositionalPlural + +WHERE { + ?lexeme dct:language wd:Q7737 ; + wikibase:lexicalCategory wd:Q34698 ; + wikibase:lemma ?adjective . + + # MARK: Nominative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineNominativeSingularForm . + ?masculineNominativeSingularForm ontolex:representation ?masculineNominativeSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterNominativeSingularForm . + ?neuterNominativeSingularForm ontolex:representation ?neuterNominativeSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineNominativeSingularForm . + ?feminineNominativeSingularForm ontolex:representation ?feminineNominativeSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativePluralForm . + ?nominativePluralForm ontolex:representation ?nominativePlural ; + wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . + } + + # MARK: Genitive, Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitivePluralForm . + ?genitivePluralForm ontolex:representation ?genitivePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . + } + + # MARK: Dative Case, Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativePluralForm . + ?dativePluralForm ontolex:representation ?dativePlural ; + wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . + } + + # MARK: Animate, Accusative, Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?animateAccusativePluralForm . + ?animateAccusativePluralForm ontolex:representation ?animateAccusativePlural ; + wikibase:grammaticalFeature wd:Q51927507, wd:Q146078, wd:Q146786 . + } + + # MARK: Inanimate, Accusative, Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?inanimateAccusativePluralForm . + ?inanimateAccusativePluralForm ontolex:representation ?inanimateAccusativePlural ; + wikibase:grammaticalFeature wd:Q51927539, wd:Q146078, wd:Q146786 . + } + + # MARK: Prepositional, Singular + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?femininePrepositionalSingularForm . + ?femininePrepositionalSingularForm ontolex:representation ?femininePrepositionalSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q2114906, wd:Q110786 . + } + + # MARK: Prepositional, Plural + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?prepositionalPluralForm . + ?prepositionalPluralForm ontolex:representation ?prepositionalPlural ; + wikibase:grammaticalFeature wd:Q2114906, wd:Q146786 . + } +} From f90bed9ce4de7ac3abe97f47215d550e279f7a78 Mon Sep 17 00:00:00 2001 From: Lee Eo Jin Date: Sun, 20 Oct 2024 11:16:19 +0900 Subject: [PATCH 13/30] create korean adjectives query --- .../Korean/adjectives/query_adjectives.sparql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Korean/adjectives/query_adjectives.sparql diff --git a/src/scribe_data/language_data_extraction/Korean/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Korean/adjectives/query_adjectives.sparql new file mode 100644 index 000000000..ec6e54490 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Korean/adjectives/query_adjectives.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Korean (Q9176) adjectives (Q34698) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?adjective + +WHERE { + ?lexeme dct:language wd:Q9176 ; + wikibase:lexicalCategory wd:Q34698 ; + wikibase:lemma ?adjective . +} From 4467865cd7f54e6747bca1070bb065e133d3d1be Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 12:40:02 +0200 Subject: [PATCH 14/30] Simplify queries as not enough forms are present to know models --- .../Igbo/adjectives/query_adjectives.sparql | 195 +----------------- .../Igbo/adverbs/query_adverbs.sparql | 64 +----- .../Igbo/nouns/query_nouns.sparql | 13 ++ .../Igbo/nouns/query_nouns_1.sparql | 176 ---------------- .../Igbo/nouns/query_nouns_2.sparql | 141 ------------- .../prepositions/query_prepositions.sparql | 18 +- 6 files changed, 28 insertions(+), 579 deletions(-) create mode 100644 src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql delete mode 100644 src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql delete mode 100644 src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql diff --git a/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql index fc808b3dc..6f53fa4ef 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql @@ -1,5 +1,5 @@ # tool: scribe-data -# Igbo (Q33578) adjective (Q34698) and their corresponding grammatical features. +# All Igbo (Q33578) adjective (Q34698) and the given forms. # Enter this query at https://query.wikidata.org/ SELECT @@ -7,36 +7,14 @@ SELECT ?adjective ?singular ?plural - ?pastParticiple - ?presentParticiple - ?presentTense - ?gerund - ?adjectivalAttribute - ?naAdjective - ?comparative - ?superlative - ?numeral - ?positive - ?demonstrativeAdjective - ?abstractNoun - ?verb - ?synonym - ?preposition - ?numeralSystem - ?adjectiveReduplication - ?adjectivePrenomial - ?pastTense - ?presentContinuous - ?noun - ?presentTensePastTense - ?nominal WHERE { ?lexeme dct:language wd:Q33578; - wikibase:lexicalCategory wd:Q34698; - wikibase:lemma ?adjective . + wikibase:lexicalCategory wd:Q34698; + wikibase:lemma ?adjective . # MARK: Singular + OPTIONAL { ?lexeme ontolex:lexicalForm ?singularForm . ?singularForm ontolex:representation ?singular ; @@ -44,173 +22,10 @@ WHERE { } # MARK: Plural + OPTIONAL { ?lexeme ontolex:lexicalForm ?pluralForm . ?pluralForm ontolex:representation ?plural ; wikibase:grammaticalFeature wd:Q146786 . } - - # MARK: Past Participle - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastParticipleForm . - ?pastParticipleForm ontolex:representation ?pastParticiple ; - wikibase:grammaticalFeature wd:Q12717679 . - } - - # MARK: Present Participle - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentParticipleForm . - ?presentParticipleForm ontolex:representation ?presentParticiple ; - wikibase:grammaticalFeature wd:Q10345583 . - } - - # MARK: Present Tense - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentTenseForm . - ?presentTenseForm ontolex:representation ?presentTense ; - wikibase:grammaticalFeature wd:Q192613 . - - # MARK: Gerund - OPTIONAL { - ?lexeme ontolex:lexicalForm ?gerundForm . - ?gerundForm ontolex:representation ?gerund ; - wikibase:grammaticalFeature wd:Q1923028 . - } - - # MARK: Adjectival Attribute - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectivalAttributeForm . - ?adjectivalAttributeForm ontolex:representation ?adjectivalAttribute ; - wikibase:grammaticalFeature wd:Q10401368 . - } - - # MARK: Na-Adjective - OPTIONAL { - ?lexeme ontolex:lexicalForm ?naAdjectiveForm . - ?naAdjectiveForm ontolex:representation ?naAdjective ; - wikibase:grammaticalFeature wd:Q1091269 . - } - - # MARK: Comparative - OPTIONAL { - ?lexeme ontolex:lexicalForm ?comparativeForm . - ?comparativeForm ontolex:representation ?comparative ; - wikibase:grammaticalFeature wd:Q14169499 . - } - - # MARK: Superlative - OPTIONAL { - ?lexeme ontolex:lexicalForm ?superlativeForm . - ?superlativeForm ontolex:representation ?superlative ; - wikibase:grammaticalFeature wd:Q1817208 . - } - - # MARK: Numeral - OPTIONAL { - ?lexeme ontolex:lexicalForm ?numeralForm . - ?numeralForm ontolex:representation ?numeral ; - wikibase:grammaticalFeature wd:Q63116 . - } - - # MARK: Positive - OPTIONAL { - ?lexeme ontolex:lexicalForm ?positiveForm . - ?positiveForm ontolex:representation ?positive ; - wikibase:grammaticalFeature wd:Q3482678 . - } - - # MARK: Demonstrative Adjective - OPTIONAL { - ?lexeme ontolex:lexicalForm ?demonstrativeAdjectiveForm . - ?demonstrativeAdjectiveForm ontolex:representation ?demonstrativeAdjective ; - wikibase:grammaticalFeature wd:Q2824480 . - } - - # MARK: Abstract Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?abstractNounForm . - ?abstractNounForm ontolex:representation ?abstractNoun ; - wikibase:grammaticalFeature wd:Q2712963 . - } - - # MARK: Verb - OPTIONAL { - ?lexeme ontolex:lexicalForm ?verbForm . - ?verbForm ontolex:representation ?verb ; - wikibase:grammaticalFeature wd:Q24905 . - } - - # MARK: Synonym - OPTIONAL { - ?lexeme ontolex:lexicalForm ?synonymForm . - ?synonymForm ontolex:representation ?synonym ; - wikibase:grammaticalFeature wd:Q42106 . - } - - # MARK: Preposition - OPTIONAL { - ?lexeme ontolex:lexicalForm ?prepositionForm . - ?prepositionForm ontolex:representation ?preposition ; - wikibase:grammaticalFeature wd:Q4833830 . - } - - # MARK: Numeral System - OPTIONAL { - ?lexeme ontolex:lexicalForm ?numeralSystemForm . - ?numeralSystemForm ontolex:representation ?numeralSystem ; - wikibase:grammaticalFeature wd:Q122653 . - } - - # MARK: Adjective Reduplication - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectiveReduplicationForm . - ?adjectiveReduplicationForm ontolex:representation ?adjectiveReduplication ; - wikibase:grammaticalFeature wd:Q221446 . - } - - # MARK: Prenominal adjective - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectivePositiveForm . - ?adjectivePositiveForm ontolex:representation ?adjectivePositive ; - wikibase:grammaticalFeature wd:Q12259986 . - } - - # MARK: Past Tense - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastTenseForm . - ?pastTenseForm ontolex:representation ?pastTense ; - wikibase:grammaticalFeature wd:Q1994301 . - } - - # MARK: Present Continuous - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentContinuousForm . - ?presentContinuousForm ontolex:representation ?presentContinuous ; - wikibase:grammaticalFeature wd:Q7240943 . - } - - # MARK: Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectiveSuperlativeForm . - ?adjectiveSuperlativeForm ontolex:representation ?adjectiveSuperlative ; - wikibase:grammaticalFeature wd:Q1084 . - } - - # MARK: Present Tense and Past Tense - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentTensePastTenseForm . - ?presentTensePastTenseForm ontolex:representation ?presentTensePastTense ; - wikibase:grammaticalFeature wd:Q192613 ; - wikibase:grammaticalFeature wd:Q1994301 . - } - - # MARK: Nominal - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectiveNaAdjectiveForm . - ?adjectiveNaAdjectiveForm ontolex:representation ?adjectiveNaAdjective ; - wikibase:grammaticalFeature wd:Q503992 . - } - -} - } diff --git a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql index 7ed8c8765..345e32687 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql @@ -1,69 +1,13 @@ # tool: scribe-data -# Igbo (Q33578) adverbs (Q380057) and their corresponding grammatical features. +# All Igbo (Q33578) adverbs (Q380057) and the given forms. # Enter this query at https://query.wikidata.org/ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?adverb - ?adverbialPhrase - ?pastParticiple - ?synonym - ?adverbial - ?determiner - ?futureTense - ?noun + WHERE { ?lexeme dct:language wd:Q33578 ; - wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?adverb . - - # MARK: Adverbial phrases - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adverbialPhraseForm . - ?adverbialPhraseForm ontolex:representation ?adverbialPhrase ; - wikibase:grammaticalFeature wd:Q3734650 . - } - - # MARK: Past participles - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastParticipleForm . - ?pastParticipleForm ontolex:representation ?pastParticiple ; - wikibase:grammaticalFeature wd:Q12717679 . - } - - # MARK: Synonyms - OPTIONAL { - ?lexeme ontolex:lexicalForm ?synonymForm . - ?synonymForm ontolex:representation ?synonym ; - wikibase:grammaticalFeature wd:Q42106 . - } - - # MARK: Adverbials - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adverbialForm . - ?adverbialForm ontolex:representation ?adverbial ; - wikibase:grammaticalFeature wd:Q380012. - } - - # MARK: Determiners - OPTIONAL { - ?lexeme ontolex:lexicalForm ?determinerForm . - ?determinerForm ontolex:representation ?determiner ; - wikibase:grammaticalFeature wd:Q576271 . - } - - # MARK: Future tense forms - OPTIONAL { - ?lexeme ontolex:lexicalForm ?futureTenseForm . - ?futureTenseForm ontolex:representation ?futureTense ; - wikibase:grammaticalFeature wd:Q501405 . - } - - # MARK: Nouns - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nounForm . - ?nounForm ontolex:representation ?noun ; - wikibase:grammaticalFeature wd:Q1084 . - } - + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?adverb . } diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql new file mode 100644 index 000000000..382324ef1 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Igbo (Q33578) 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 + +WHERE { + ?lexeme dct:language wd:Q33578 ; + wikibase:lexicalCategory wd:Q1084 ; + wikibase:lemma ?noun . +} diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql deleted file mode 100644 index 30d007bda..000000000 --- a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_1.sparql +++ /dev/null @@ -1,176 +0,0 @@ -# tool: scribe-data -# Igbo (Q33578) nouns (Q1084) and their grammatical features. -# Enter this query at https://query.wikidata.org/ - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?noun - ?singular - ?countNoun - ?massNoun - ?commonNoun - ?nounPhrase - ?numeral - ?uncountableSet - ?synonym - ?antonym - ?plural - ?concreteNoun - ?article - ?determiner - ?pluraleTantum - ?nominal - ?properNoun - ?abstractNoun - ?compoundNoun - ?gender - ?nominativeCase - - -WHERE { - ?lexeme dct:language wd:Q33578 ; # Igbo language - wikibase:lexicalCategory wd:Q1084 ; # noun - wikibase:lemma ?noun . - - # MARK: Singular - OPTIONAL { - ?lexeme ontolex:lexicalForm ?singularForm . - ?singularForm ontolex:representation ?singular ; - wikibase:grammaticalFeature wd:Q110786 . - } - - # MARK: Count Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?countNounForm . - ?countNounForm ontolex:representation ?countNoun ; - wikibase:grammaticalFeature wd:Q1520033 . - } - - # MARK: Mass Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?massNounForm . - ?massNounForm ontolex:representation ?massNoun ; - wikibase:grammaticalFeature wd:Q489168 . - } - - # MARK: Common Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?commonNounForm . - ?commonNounForm ontolex:representation ?commonNoun ; - wikibase:grammaticalFeature wd:Q2428747 . - } - - # MARK: Noun Phrase - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nounPhraseForm . - ?nounPhraseForm ontolex:representation ?nounPhrase ; - wikibase:grammaticalFeature wd:Q1401131 . - } - - # MARK: Numeral - OPTIONAL { - ?lexeme ontolex:lexicalForm ?numeralForm . - ?numeralForm ontolex:representation ?numeral ; - wikibase:grammaticalFeature wd:Q63116 . - } - - # MARK: Uncountable Set - OPTIONAL { - ?lexeme ontolex:lexicalForm ?uncountableSetForm . - ?uncountableSetForm ontolex:representation ?uncountableSet ; - wikibase:grammaticalFeature wd:Q1128796 . - } - - # MARK: Synonym - OPTIONAL { - ?lexeme ontolex:lexicalForm ?synonymForm . - ?synonymForm ontolex:representation ?synonym ; - wikibase:grammaticalFeature wd:Q42106 . - } - - # MARK: Antonym - OPTIONAL { - ?lexeme ontolex:lexicalForm ?antonymForm . - ?antonymForm ontolex:representation ?antonym ; - wikibase:grammaticalFeature wd:Q131779 . - } - - # MARK: Plural - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pluralForm . - ?pluralForm ontolex:representation ?plural ; - wikibase:grammaticalFeature wd:Q146786 . - } - - # MARK: Concrete Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?concreteNounForm . - ?concreteNounForm ontolex:representation ?concreteNoun ; - wikibase:grammaticalFeature wd:Q2646610 . - } - - # MARK: Article - OPTIONAL { - ?lexeme ontolex:lexicalForm ?articleForm . - ?articleForm ontolex:representation ?article ; - wikibase:grammaticalFeature wd:Q103184 . - } - - # MARK: Determiner - OPTIONAL { - ?lexeme ontolex:lexicalForm ?determinerForm . - ?determinerForm ontolex:representation ?determiner ; - wikibase:grammaticalFeature wd:Q576271 . - } - - # MARK: Plurale Tantum - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pluraleTantumForm . - ?pluraleTantumForm ontolex:representation ?pluraleTantum ; - wikibase:grammaticalFeature wd:Q138246 . - } - - # MARK: Nominal - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nominalForm . - ?nominalForm ontolex:representation ?nominal ; - wikibase:grammaticalFeature wd:Q503992 . - } - - # MARK: Proper Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?properNounForm . - ?properNounForm ontolex:representation ?properNoun ; - wikibase:grammaticalFeature wd:Q147276 . - } - - # MARK: Abstract Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?abstractNounForm . - ?abstractNounForm ontolex:representation ?abstractNoun ; - wikibase:grammaticalFeature wd:Q2712963 . - } - - # MARK: Compound Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?compoundNounForm . - ?compoundNounForm ontolex:representation ?compoundNoun ; - wikibase:grammaticalFeature wd:Q43369910 . - } - - # MARK: Gender - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genderForm . - ?genderForm ontolex:representation ?gender ; - wikibase:grammaticalFeature wd:Q48277 . - } - - # MARK: Nominative Case - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nominativeCaseForm . - ?nominativeCaseForm ontolex:representation ?nominativeCase ; - wikibase:grammaticalFeature wd:Q131105 . - } - - -} diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql deleted file mode 100644 index 5a641c8fe..000000000 --- a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns_2.sparql +++ /dev/null @@ -1,141 +0,0 @@ -# tool: scribe-data -# Igbo (Q33578) nouns (Q1084) and their corresponding grammatical features. -# Enter this query at https://query.wikidata.org/ - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?noun - ?presentParticiple - ?pastParticiple - ?presentTense - ?imperative - ?pastTense - ?adjective - ?verbalNoun - ?infinitive - ?agent - ?verbPhrase - ?syntax - ?phoneme - ?phonology - ?soundSymbolism - ?suffix - ?numeralAdjective - -WHERE { - ?lexeme dct:language wd:Q33578 ; # Igbo language - wikibase:lexicalCategory wd:Q1084 ; # Lexical category: noun - wikibase:lemma ?noun . - - # MARK: Present Participle - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentParticipleForm . - ?presentParticipleForm ontolex:representation ?presentParticiple ; - wikibase:grammaticalFeature wd:Q10345583 . - } - - # MARK: Past Participle - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastParticipleForm . - ?pastParticipleForm ontolex:representation ?pastParticiple ; - wikibase:grammaticalFeature wd:Q12717679 . - } - - # MARK: Present Tense - OPTIONAL { - ?lexeme ontolex:lexicalForm ?presentTenseForm . - ?presentTenseForm ontolex:representation ?presentTense ; - wikibase:grammaticalFeature wd:Q192613 . - } - - # MARK: Imperative - OPTIONAL { - ?lexeme ontolex:lexicalForm ?imperativeForm . - ?imperativeForm ontolex:representation ?imperative ; - wikibase:grammaticalFeature wd:Q22716 . - } - - # MARK: Past Tense - OPTIONAL { - ?lexeme ontolex:lexicalForm ?pastTenseForm . - ?pastTenseForm ontolex:representation ?pastTense ; - wikibase:grammaticalFeature wd:Q1994301 . - } - - # MARK: Adjective - OPTIONAL { - ?lexeme ontolex:lexicalForm ?adjectiveForm . - ?adjectiveForm ontolex:representation ?adjective ; - wikibase:grammaticalFeature wd:Q34698 . - } - - # MARK: Verbal Noun - OPTIONAL { - ?lexeme ontolex:lexicalForm ?verbalNounForm . - ?verbalNounForm ontolex:representation ?verbalNoun ; - wikibase:grammaticalFeature wd:Q7920975 . - } - - # MARK: Infinitive - OPTIONAL { - ?lexeme ontolex:lexicalForm ?infinitiveForm . - ?infinitiveForm ontolex:representation ?infinitive ; - wikibase:grammaticalFeature wd:Q179230 . - } - - # MARK: Agent - OPTIONAL { - ?lexeme ontolex:lexicalForm ?agentForm . - ?agentForm ontolex:representation ?agent ; - wikibase:grammaticalFeature wd:Q392648 . - } - - # MARK: Verb Phrase - OPTIONAL { - ?lexeme ontolex:lexicalForm ?verbPhraseForm . - ?verbPhraseForm ontolex:representation ?verbPhrase ; - wikibase:grammaticalFeature wd:Q1778442 . - } - - # MARK: Syntax - OPTIONAL { - ?lexeme ontolex:lexicalForm ?syntaxForm . - ?syntaxForm ontolex:representation ?syntax ; - wikibase:grammaticalFeature wd:Q37437 . - } - - # MARK: Phoneme - OPTIONAL { - ?lexeme ontolex:lexicalForm ?phonemeForm . - ?phonemeForm ontolex:representation ?phoneme ; - wikibase:grammaticalFeature wd:Q8183 . - } - - # MARK: Phonology - OPTIONAL { - ?lexeme ontolex:lexicalForm ?phonologyForm . - ?phonologyForm ontolex:representation ?phonology ; - wikibase:grammaticalFeature wd:Q40998 . - } - - # MARK: Sound Symbolism - OPTIONAL { - ?lexeme ontolex:lexicalForm ?soundSymbolismForm . - ?soundSymbolismForm ontolex:representation ?soundSymbolism ; - wikibase:grammaticalFeature wd:Q2475268 . - } - - # MARK: Suffix - OPTIONAL { - ?lexeme ontolex:lexicalForm ?suffixForm . - ?suffixForm ontolex:representation ?suffix ; - wikibase:grammaticalFeature wd:Q102047 . - } - - # MARK: Numeral Adjective - OPTIONAL { - ?lexeme ontolex:lexicalForm ?numeralAdjectiveForm . - ?numeralAdjectiveForm ontolex:representation ?numeralAdjective ; - wikibase:grammaticalFeature wd:Q55951821. - } -} diff --git a/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql index 7d065be5b..6ec64813d 100644 --- a/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql @@ -1,28 +1,22 @@ # tool: scribe-data -# Igbo (Q33578) preposition (Q4833830) and their corresponding grammatical features. +# All Igbo (Q33578) prepositions (Q4833830) and the given forms. # Enter this query at https://query.wikidata.org/ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?preposition - ?synonym ?contraction + WHERE { ?lexeme dct:language wd:Q33578 ; - wikibase:lexicalCategory wd:Q4833830 ; - wikibase:lemma ?preposition . - - # MARK: Synonym - OPTIONAL { - ?lexeme ontolex:lexicalForm ?synonymForm . - ?synonymForm ontolex:representation ?synonym ; - wikibase:grammaticalFeature wd:Q42106. - } + wikibase:lexicalCategory wd:Q4833830 ; + wikibase:lemma ?preposition . # MARK: Contraction + OPTIONAL { ?lexeme ontolex:lexicalForm ?contractionForm . ?contractionForm ontolex:representation ?contraction ; wikibase:grammaticalFeature wd:Q126473 . } - } +} From 7430253367b8117341e4da6c3253438681171067 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 12:42:15 +0200 Subject: [PATCH 15/30] Add periods to docstring comments --- .../Estonian/adverbs/query_adverbs_1.sparql | 2 +- .../Estonian/adverbs/query_adverbs_2.sparql | 2 +- .../language_data_extraction/Estonian/verbs/query_verbs.sparql | 2 +- .../Igbo/adjectives/query_adjectives.sparql | 2 +- .../language_data_extraction/Igbo/adverbs/query_adverbs.sparql | 2 +- .../language_data_extraction/Igbo/nouns/query_nouns.sparql | 2 +- .../Igbo/prepositions/query_prepositions.sparql | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_1.sparql b/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_1.sparql index 3d64381b3..14d08b526 100644 --- a/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_1.sparql +++ b/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_1.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Estonian (Q380057) adverbs (Q380057) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_2.sparql b/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_2.sparql index 062012c7d..fb2f97a79 100644 --- a/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_2.sparql +++ b/src/scribe_data/language_data_extraction/Estonian/adverbs/query_adverbs_2.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Estonian (Q380057) adverbs (Q380057) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Estonian/verbs/query_verbs.sparql b/src/scribe_data/language_data_extraction/Estonian/verbs/query_verbs.sparql index bcbfc13f0..7e3f6af66 100644 --- a/src/scribe_data/language_data_extraction/Estonian/verbs/query_verbs.sparql +++ b/src/scribe_data/language_data_extraction/Estonian/verbs/query_verbs.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Estonian (Q9072) verbs (Q24905) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql index 6f53fa4ef..2a5804a47 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adjectives/query_adjectives.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Igbo (Q33578) adjective (Q34698) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql index 345e32687..f0a8b891a 100644 --- a/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/adverbs/query_adverbs.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Igbo (Q33578) adverbs (Q380057) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql index 382324ef1..1c615a564 100644 --- a/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/nouns/query_nouns.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Igbo (Q33578) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) diff --git a/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql index 6ec64813d..405635ca3 100644 --- a/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Igbo/prepositions/query_prepositions.sparql @@ -1,6 +1,6 @@ # tool: scribe-data # All Igbo (Q33578) prepositions (Q4833830) and the given forms. -# Enter this query at https://query.wikidata.org/ +# Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) From 1554251df2b275e3b0dd0aba198e5f41dd88b33e Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sun, 20 Oct 2024 15:17:02 +0300 Subject: [PATCH 16/30] all the 26 grammatical forms for russian adjectives --- .../adjectives/query_adjectives.sparql | 133 ++++++++++++++++-- 1 file changed, 121 insertions(+), 12 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql index f81b023d7..3165add3b 100644 --- a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql @@ -9,19 +9,34 @@ SELECT ?neuterNominativeSingular ?feminineNominativeSingular ?nominativePlural + ?masculineGenitiveSingular + ?neuterGenitiveSingular + ?feminineGenitiveSingular ?genitivePlural + ?masculineDativeSingular + ?neuterDativeSingular + ?feminineDativeSingular ?dativePlural + ?masculineAnimateAccusativeSingular + ?neuterAnimateAccusativeSingular + ?feminineAnimateAccusativeSingular ?animateAccusativePlural - ?inanimateAccusativePlural + ?masculineInstrumentalSingular + ?neuterInstrumentalSingular + ?feminineInstrumentalSingular + ?instrumentalPlural + ?masculinePrepositionalSingular + ?neuterPrepositionalSingular ?femininePrepositionalSingular ?prepositionalPlural - + ?inanimateAccusativeSingular + ?inanimateAccusativePlural WHERE { ?lexeme dct:language wd:Q7737 ; wikibase:lexicalCategory wd:Q34698 ; wikibase:lemma ?adjective . - # MARK: Nominative + # MARK: Nominative Forms OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineNominativeSingularForm . @@ -47,7 +62,25 @@ WHERE { wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . } - # MARK: Genitive, Plural + # MARK: Genitive Forms + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineGenitiveSingularForm . + ?masculineGenitiveSingularForm ontolex:representation ?masculineGenitiveSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q146233, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterGenitiveSingularForm . + ?neuterGenitiveSingularForm ontolex:representation ?neuterGenitiveSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q146233, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineGenitiveSingularForm . + ?feminineGenitiveSingularForm ontolex:representation ?feminineGenitiveSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q146233, wd:Q110786 . + } OPTIONAL { ?lexeme ontolex:lexicalForm ?genitivePluralForm . @@ -55,7 +88,25 @@ WHERE { wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . } - # MARK: Dative Case, Plural + # MARK: Dative Forms + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineDativeSingularForm . + ?masculineDativeSingularForm ontolex:representation ?masculineDativeSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q145599, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterDativeSingularForm . + ?neuterDativeSingularForm ontolex:representation ?neuterDativeSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q145599, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineDativeSingularForm . + ?feminineDativeSingularForm ontolex:representation ?feminineDativeSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q145599, wd:Q110786 . + } OPTIONAL { ?lexeme ontolex:lexicalForm ?dativePluralForm . @@ -63,7 +114,25 @@ WHERE { wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . } - # MARK: Animate, Accusative, Plural + # MARK: Accusative Forms + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineAnimateAccusativeSingularForm . + ?masculineAnimateAccusativeSingularForm ontolex:representation ?masculineAnimateAccusativeSingular ; + wikibase:grammaticalFeature wd:Q499327,wd:Q51927507, wd:Q146078, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterAnimateAccusativeSingularForm . + ?neuterAnimateAccusativeSingularForm ontolex:representation ?neuterAnimateAccusativeSingular ; + wikibase:grammaticalFeature wd:Q1775461,wd:Q51927507, wd:Q146078, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineAnimateAccusativeSingularForm . + ?feminineAnimateAccusativeSingularForm ontolex:representation ?feminineAnimateAccusativeSingular ; + wikibase:grammaticalFeature wd:Q1775415,wd:Q51927507 ,wd:Q146078, wd:Q110786 . + } OPTIONAL { ?lexeme ontolex:lexicalForm ?animateAccusativePluralForm . @@ -71,7 +140,11 @@ WHERE { wikibase:grammaticalFeature wd:Q51927507, wd:Q146078, wd:Q146786 . } - # MARK: Inanimate, Accusative, Plural + OPTIONAL { + ?lexeme ontolex:lexicalForm ?inanimateAccusativeSingularForm . + ?inanimateAccusativeSingularForm ontolex:representation ?inanimateAccusativeSingular ; + wikibase:grammaticalFeature wd:Q51927539, wd:Q146078, wd:Q110786 . + } OPTIONAL { ?lexeme ontolex:lexicalForm ?inanimateAccusativePluralForm . @@ -79,19 +152,55 @@ WHERE { wikibase:grammaticalFeature wd:Q51927539, wd:Q146078, wd:Q146786 . } - # MARK: Prepositional, Singular + # MARK: Instrumental Forms + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineInstrumentalSingularForm . + ?masculineInstrumentalSingularForm ontolex:representation ?masculineInstrumentalSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterInstrumentalSingularForm . + ?neuterInstrumentalSingularForm ontolex:representation ?neuterInstrumentalSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineInstrumentalSingularForm . + ?feminineInstrumentalSingularForm ontolex:representation ?feminineInstrumentalSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalPluralForm . + ?instrumentalPluralForm ontolex:representation ?instrumentalPlural ; + wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . + } + + # MARK: Prepositional Forms + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculinePrepositionalSingularForm . + ?masculinePrepositionalSingularForm ontolex:representation ?masculinePrepositionalSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q2114906, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterPrepositionalSingularForm . + ?neuterPrepositionalSingularForm ontolex:representation ?neuterPrepositionalSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q2114906, wd:Q110786 . + } OPTIONAL { ?lexeme ontolex:lexicalForm ?femininePrepositionalSingularForm . ?femininePrepositionalSingularForm ontolex:representation ?femininePrepositionalSingular ; - wikibase:grammaticalFeature wd:Q1775415, wd:Q2114906, wd:Q110786 . + wikibase:grammaticalFeature wd:Q1775415, wd:Q2114906, wd:Q110786 . } - # MARK: Prepositional, Plural - OPTIONAL { ?lexeme ontolex:lexicalForm ?prepositionalPluralForm . ?prepositionalPluralForm ontolex:representation ?prepositionalPlural ; - wikibase:grammaticalFeature wd:Q2114906, wd:Q146786 . + wikibase:grammaticalFeature wd:Q2114906, wd:Q146786 . } } From 0d9794b48fc3082acfe0f39ae173f15bd26e3d4c Mon Sep 17 00:00:00 2001 From: Omar Agiez Date: Sun, 20 Oct 2024 15:38:25 +0300 Subject: [PATCH 17/30] adding another form short: term of an adjective --- .../adjectives/query_adjectives.sparql | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql index 3165add3b..c8a2da273 100644 --- a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql @@ -31,6 +31,10 @@ SELECT ?prepositionalPlural ?inanimateAccusativeSingular ?inanimateAccusativePlural + ?masculineShortFormSingular + ?neuterShortFormSingular + ?feminineShortFormSingular + ?ShortFormplural WHERE { ?lexeme dct:language wd:Q7737 ; wikibase:lexicalCategory wd:Q34698 ; @@ -203,4 +207,29 @@ WHERE { ?prepositionalPluralForm ontolex:representation ?prepositionalPlural ; wikibase:grammaticalFeature wd:Q2114906, wd:Q146786 . } + # MARK: Short Form + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?masculineShortFormSingularForm . + ?masculineShortFormSingularForm ontolex:representation ?masculineShortFormSingular ; + wikibase:grammaticalFeature wd:Q499327, wd:Q4239848, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?neuterShortFormSingularForm . + ?neuterShortFormSingularForm ontolex:representation ?neuterShortFormSingular ; + wikibase:grammaticalFeature wd:Q1775461, wd:Q4239848, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?feminineShortFormSingularForm . + ?feminineShortFormSingularForm ontolex:representation ?feminineShortFormSingular ; + wikibase:grammaticalFeature wd:Q1775415, wd:Q4239848, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?ShortFormpluralForm . + ?ShortFormpluralForm ontolex:representation ?ShortFormplural ; + wikibase:grammaticalFeature wd:Q4239848, wd:Q146786 . + } } From 699011840b65ec966d64535eddca9183ae652426 Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:51:58 +0530 Subject: [PATCH 18/30] Added the folder for Northern Sami --- .../adjectives/query_adjectives.sparql | 13 ++ .../adverbs/query_adverbs.sparql | 13 ++ .../Northern_Sami/nouns/query_nouns.sparql | 123 ++++++++++++++++++ .../Northern_Sami/verbs/query_verbs.sparql | 13 ++ 4 files changed, 162 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql new file mode 100644 index 000000000..769799438 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) adjectives (Q34698) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q34698 ; + wikibase:lemma ?verb . +} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql new file mode 100644 index 000000000..96d4a2994 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) adverbs (Q380057) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?verb . +} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql new file mode 100644 index 000000000..02023257c --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql @@ -0,0 +1,123 @@ +# tool: scribe-data +# All Northern Sami(Q33947) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT DISTINCT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nominativeSingular + ?nominativePlural + ?genitiveSingular + ?genitivePlural + ?dativeSingular + ?dativePlural + ?accusativeSingular + ?accusativePlural + ?instrumentalSingular + ?instrumentalPlural + ?locativeSingular + ?locativePlural + ?vocativeSingular + ?vocativePlural + +WHERE { + ?lexeme dct:language wd:Q9078 ; + wikibase:lexicalCategory wd:Q1084 . + + # MARK: Nominative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativeSingularForm . + ?nominativeSingularForm ontolex:representation ?nominativeSingular ; + wikibase:grammaticalFeature wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativePluralForm . + ?nominativePluralForm ontolex:representation ?nominativePlural ; + wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . + } + + # MARK: Genitive + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveSingularForm . + ?genitiveSingularForm ontolex:representation ?genitiveSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitivePluralForm . + ?genitivePluralForm ontolex:representation ?genitivePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . + } + + # MARK: Dative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativeSingularForm . + ?dativeSingularForm ontolex:representation ?dativeSingular ; + wikibase:grammaticalFeature wd:Q145599, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativePluralForm . + ?dativePluralForm ontolex:representation ?dativePlural ; + wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . + } + + # MARK: Accusative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativeSingularForm . + ?accusativeSingularForm ontolex:representation ?accusativeSingular ; + wikibase:grammaticalFeature wd:Q146078, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativePluralForm . + ?accusativePluralForm ontolex:representation ?accusativePlural ; + wikibase:grammaticalFeature wd:Q146078, wd:Q146786 . + } + + # MARK: Instrumental + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalSingularForm . + ?instrumentalSingularForm ontolex:representation ?instrumentalSingular ; + wikibase:grammaticalFeature wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalPluralForm . + ?instrumentalPluralForm ontolex:representation ?instrumentalPlural ; + wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . + } + + # MARK: Locative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativeSingularForm . + ?locativeSingularForm ontolex:representation ?locativeSingular ; + wikibase:grammaticalFeature wd:Q202142, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativePluralForm . + ?locativePluralForm ontolex:representation ?locativePlural ; + wikibase:grammaticalFeature wd:Q202142, wd:Q146786 . + } + + # MARK: Vocative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativeSingularForm . + ?vocativeSingularForm ontolex:representation ?vocativeSingular ; + wikibase:grammaticalFeature wd:Q185077, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativePluralForm . + ?vocativePluralForm ontolex:representation ?vocativePlural ; + wikibase:grammaticalFeature wd:Q185077, wd:Q146786 . + } +} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql new file mode 100644 index 000000000..1c7d36de6 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) verbs (Q24905) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q24905 ; + wikibase:lemma ?verb . +} From 0eff6c21b158bfdc8550d7b323f0c8d7e5cd23e3 Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:09:29 +0530 Subject: [PATCH 19/30] Delete src/scribe_data/language_data_extraction/Northern_Sami directory --- .../adjectives/query_adjectives.sparql | 13 -- .../adverbs/query_adverbs.sparql | 13 -- .../Northern_Sami/nouns/query_nouns.sparql | 123 ------------------ .../Northern_Sami/verbs/query_verbs.sparql | 13 -- 4 files changed, 162 deletions(-) delete mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql delete mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql delete mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql delete mode 100644 src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql deleted file mode 100644 index 769799438..000000000 --- a/src/scribe_data/language_data_extraction/Northern_Sami/adjectives/query_adjectives.sparql +++ /dev/null @@ -1,13 +0,0 @@ -# tool: scribe-data -# All Northern Sami(Q33947) adjectives (Q34698) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?verb - -WHERE { - ?lexeme dct:language wd:Q33947 ; - wikibase:lexicalCategory wd:Q34698 ; - wikibase:lemma ?verb . -} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql deleted file mode 100644 index 96d4a2994..000000000 --- a/src/scribe_data/language_data_extraction/Northern_Sami/adverbs/query_adverbs.sparql +++ /dev/null @@ -1,13 +0,0 @@ -# tool: scribe-data -# All Northern Sami(Q33947) adverbs (Q380057) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?verb - -WHERE { - ?lexeme dct:language wd:Q33947 ; - wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?verb . -} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql deleted file mode 100644 index 02023257c..000000000 --- a/src/scribe_data/language_data_extraction/Northern_Sami/nouns/query_nouns.sparql +++ /dev/null @@ -1,123 +0,0 @@ -# tool: scribe-data -# All Northern Sami(Q33947) nouns (Q1084) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT DISTINCT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nominativeSingular - ?nominativePlural - ?genitiveSingular - ?genitivePlural - ?dativeSingular - ?dativePlural - ?accusativeSingular - ?accusativePlural - ?instrumentalSingular - ?instrumentalPlural - ?locativeSingular - ?locativePlural - ?vocativeSingular - ?vocativePlural - -WHERE { - ?lexeme dct:language wd:Q9078 ; - wikibase:lexicalCategory wd:Q1084 . - - # MARK: Nominative - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nominativeSingularForm . - ?nominativeSingularForm ontolex:representation ?nominativeSingular ; - wikibase:grammaticalFeature wd:Q131105, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?nominativePluralForm . - ?nominativePluralForm ontolex:representation ?nominativePlural ; - wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . - } - - # MARK: Genitive - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genitiveSingularForm . - ?genitiveSingularForm ontolex:representation ?genitiveSingular ; - wikibase:grammaticalFeature wd:Q146233, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?genitivePluralForm . - ?genitivePluralForm ontolex:representation ?genitivePlural ; - wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . - } - - # MARK: Dative - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?dativeSingularForm . - ?dativeSingularForm ontolex:representation ?dativeSingular ; - wikibase:grammaticalFeature wd:Q145599, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?dativePluralForm . - ?dativePluralForm ontolex:representation ?dativePlural ; - wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . - } - - # MARK: Accusative - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?accusativeSingularForm . - ?accusativeSingularForm ontolex:representation ?accusativeSingular ; - wikibase:grammaticalFeature wd:Q146078, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?accusativePluralForm . - ?accusativePluralForm ontolex:representation ?accusativePlural ; - wikibase:grammaticalFeature wd:Q146078, wd:Q146786 . - } - - # MARK: Instrumental - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?instrumentalSingularForm . - ?instrumentalSingularForm ontolex:representation ?instrumentalSingular ; - wikibase:grammaticalFeature wd:Q192997, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?instrumentalPluralForm . - ?instrumentalPluralForm ontolex:representation ?instrumentalPlural ; - wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . - } - - # MARK: Locative - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?locativeSingularForm . - ?locativeSingularForm ontolex:representation ?locativeSingular ; - wikibase:grammaticalFeature wd:Q202142, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?locativePluralForm . - ?locativePluralForm ontolex:representation ?locativePlural ; - wikibase:grammaticalFeature wd:Q202142, wd:Q146786 . - } - - # MARK: Vocative - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?vocativeSingularForm . - ?vocativeSingularForm ontolex:representation ?vocativeSingular ; - wikibase:grammaticalFeature wd:Q185077, wd:Q110786 . - } - - OPTIONAL { - ?lexeme ontolex:lexicalForm ?vocativePluralForm . - ?vocativePluralForm ontolex:representation ?vocativePlural ; - wikibase:grammaticalFeature wd:Q185077, wd:Q146786 . - } -} diff --git a/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql b/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql deleted file mode 100644 index 1c7d36de6..000000000 --- a/src/scribe_data/language_data_extraction/Northern_Sami/verbs/query_verbs.sparql +++ /dev/null @@ -1,13 +0,0 @@ -# tool: scribe-data -# All Northern Sami(Q33947) verbs (Q24905) and the given forms. -# Enter this query at https://query.wikidata.org/. - -SELECT - (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?verb - -WHERE { - ?lexeme dct:language wd:Q33947 ; - wikibase:lexicalCategory wd:Q24905 ; - wikibase:lemma ?verb . -} From fc78cc80ca59016df1617edeb2e25bde1c1cc7bb Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:09:58 +0530 Subject: [PATCH 20/30] Add files via upload --- .../adjectives/query_adjectives.sparql | 13 ++ .../adverbs/query_adverbs.sparql | 13 ++ .../Northern Sami/nouns/query_nouns.sparql | 123 ++++++++++++++++++ .../Northern Sami/verbs/query_verbs.sparql | 13 ++ 4 files changed, 162 insertions(+) create mode 100644 src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql create mode 100644 src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql diff --git a/src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql new file mode 100644 index 000000000..769799438 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) adjectives (Q34698) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q34698 ; + wikibase:lemma ?verb . +} diff --git a/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql new file mode 100644 index 000000000..96d4a2994 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) adverbs (Q380057) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?verb . +} diff --git a/src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql new file mode 100644 index 000000000..02023257c --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql @@ -0,0 +1,123 @@ +# tool: scribe-data +# All Northern Sami(Q33947) nouns (Q1084) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT DISTINCT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?nominativeSingular + ?nominativePlural + ?genitiveSingular + ?genitivePlural + ?dativeSingular + ?dativePlural + ?accusativeSingular + ?accusativePlural + ?instrumentalSingular + ?instrumentalPlural + ?locativeSingular + ?locativePlural + ?vocativeSingular + ?vocativePlural + +WHERE { + ?lexeme dct:language wd:Q9078 ; + wikibase:lexicalCategory wd:Q1084 . + + # MARK: Nominative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativeSingularForm . + ?nominativeSingularForm ontolex:representation ?nominativeSingular ; + wikibase:grammaticalFeature wd:Q131105, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?nominativePluralForm . + ?nominativePluralForm ontolex:representation ?nominativePlural ; + wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . + } + + # MARK: Genitive + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitiveSingularForm . + ?genitiveSingularForm ontolex:representation ?genitiveSingular ; + wikibase:grammaticalFeature wd:Q146233, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?genitivePluralForm . + ?genitivePluralForm ontolex:representation ?genitivePlural ; + wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . + } + + # MARK: Dative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativeSingularForm . + ?dativeSingularForm ontolex:representation ?dativeSingular ; + wikibase:grammaticalFeature wd:Q145599, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?dativePluralForm . + ?dativePluralForm ontolex:representation ?dativePlural ; + wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . + } + + # MARK: Accusative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativeSingularForm . + ?accusativeSingularForm ontolex:representation ?accusativeSingular ; + wikibase:grammaticalFeature wd:Q146078, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativePluralForm . + ?accusativePluralForm ontolex:representation ?accusativePlural ; + wikibase:grammaticalFeature wd:Q146078, wd:Q146786 . + } + + # MARK: Instrumental + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalSingularForm . + ?instrumentalSingularForm ontolex:representation ?instrumentalSingular ; + wikibase:grammaticalFeature wd:Q192997, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?instrumentalPluralForm . + ?instrumentalPluralForm ontolex:representation ?instrumentalPlural ; + wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . + } + + # MARK: Locative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativeSingularForm . + ?locativeSingularForm ontolex:representation ?locativeSingular ; + wikibase:grammaticalFeature wd:Q202142, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?locativePluralForm . + ?locativePluralForm ontolex:representation ?locativePlural ; + wikibase:grammaticalFeature wd:Q202142, wd:Q146786 . + } + + # MARK: Vocative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativeSingularForm . + ?vocativeSingularForm ontolex:representation ?vocativeSingular ; + wikibase:grammaticalFeature wd:Q185077, wd:Q110786 . + } + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?vocativePluralForm . + ?vocativePluralForm ontolex:representation ?vocativePlural ; + wikibase:grammaticalFeature wd:Q185077, wd:Q146786 . + } +} diff --git a/src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql b/src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql new file mode 100644 index 000000000..1c7d36de6 --- /dev/null +++ b/src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All Northern Sami(Q33947) verbs (Q24905) and the given forms. +# Enter this query at https://query.wikidata.org/. + +SELECT + (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) + ?verb + +WHERE { + ?lexeme dct:language wd:Q33947 ; + wikibase:lexicalCategory wd:Q24905 ; + wikibase:lemma ?verb . +} From 7b9aaeef272f2f17b793bc9fc0ca92932c3c0133 Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:24:57 +0530 Subject: [PATCH 21/30] Added northern sami --- tests/load/test_update_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/load/test_update_utils.py b/tests/load/test_update_utils.py index 6f232846d..743d30d52 100644 --- a/tests/load/test_update_utils.py +++ b/tests/load/test_update_utils.py @@ -162,6 +162,7 @@ def test_list_all_languages(): "malayalam", "mandarin", "nigerian", + "northern sami", "nynorsk", "polish", "portuguese", From e46553244e5968cc9bfc8e892991c4de40f3002c Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:25:59 +0530 Subject: [PATCH 22/30] Added northern sami --- src/scribe_data/resources/language_metadata.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scribe_data/resources/language_metadata.json b/src/scribe_data/resources/language_metadata.json index 088cd7552..711ea21a2 100755 --- a/src/scribe_data/resources/language_metadata.json +++ b/src/scribe_data/resources/language_metadata.json @@ -119,6 +119,10 @@ "iso": "ml", "qid": "Q36236" }, + "Northern Sami": { + "iso": "se", + "qid": "Q33947" + }, "norwegian": { "sub_languages": { "bokmål": { From 061a6a1ddc33396ec2b0fd0b4619a77353bbfa20 Mon Sep 17 00:00:00 2001 From: Arpita kesharwani <107834813+KesharwaniArpita@users.noreply.github.com> Date: Sun, 20 Oct 2024 19:26:41 +0530 Subject: [PATCH 23/30] corrected northern sami --- src/scribe_data/resources/language_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scribe_data/resources/language_metadata.json b/src/scribe_data/resources/language_metadata.json index 711ea21a2..1b2a21972 100755 --- a/src/scribe_data/resources/language_metadata.json +++ b/src/scribe_data/resources/language_metadata.json @@ -119,7 +119,7 @@ "iso": "ml", "qid": "Q36236" }, - "Northern Sami": { + "northern sami": { "iso": "se", "qid": "Q33947" }, From 05bad5dcf3764eb06deec2ca39c5e4add5409b81 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 19:44:35 +0200 Subject: [PATCH 24/30] Remove label service from queries that don't need it --- .../Basque/adjectives/query_adjectives.sparql | 7 +------ .../Bengali/adjectives/query_adjectives.sparql | 7 +------ .../English/adjectives/query_adjectives.sparql | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Basque/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Basque/adjectives/query_adjectives.sparql index 3459504ac..024f64ce0 100644 --- a/src/scribe_data/language_data_extraction/Basque/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Basque/adjectives/query_adjectives.sparql @@ -9,10 +9,5 @@ SELECT WHERE { ?lexeme dct:language wd:Q8752 ; wikibase:lexicalCategory wd:Q34698 ; - wikibase:lemma ?lemma . - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?lemma rdfs:label ?adjective . - } + wikibase:lemma ?adjective . } diff --git a/src/scribe_data/language_data_extraction/Bengali/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Bengali/adjectives/query_adjectives.sparql index db94547eb..ec89ff98b 100644 --- a/src/scribe_data/language_data_extraction/Bengali/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Bengali/adjectives/query_adjectives.sparql @@ -9,10 +9,5 @@ SELECT WHERE { ?lexeme dct:language wd:Q9610 ; wikibase:lexicalCategory wd:Q34698 ; - wikibase:lemma ?lemma . - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?lemma rdfs:label ?adjective . - } + wikibase:lemma ?adjective . } diff --git a/src/scribe_data/language_data_extraction/English/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/English/adjectives/query_adjectives.sparql index 17e4d7f40..66302f614 100644 --- a/src/scribe_data/language_data_extraction/English/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/English/adjectives/query_adjectives.sparql @@ -9,10 +9,5 @@ SELECT WHERE { ?lexeme dct:language wd:Q1860 ; wikibase:lexicalCategory wd:Q34698 ; - wikibase:lemma ?lemma . - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?lemma rdfs:label ?adjective . - } + wikibase:lemma ?adjective . } From 7b2568b60bbe60c196e53d771649d78368d0bbe1 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 19:54:16 +0200 Subject: [PATCH 25/30] Minor fix in adverbs query --- .../Northern Sami/adverbs/query_adverbs.sparql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql index 96d4a2994..f2d484928 100644 --- a/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql @@ -4,10 +4,10 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?verb + ?adverb WHERE { ?lexeme dct:language wd:Q33947 ; wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?verb . -} + wikibase:lemma ?adverb . +} From 85afa7b97023bf1ba2bcb8c9784034404e10d11a Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 20:11:25 +0200 Subject: [PATCH 26/30] Minor formatting +rename for adjectives query --- .../adjectives/query_adjectives.sparql | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql index c8a2da273..c78e38832 100644 --- a/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql +++ b/src/scribe_data/language_data_extraction/Russian/adjectives/query_adjectives.sparql @@ -31,16 +31,17 @@ SELECT ?prepositionalPlural ?inanimateAccusativeSingular ?inanimateAccusativePlural - ?masculineShortFormSingular - ?neuterShortFormSingular - ?feminineShortFormSingular - ?ShortFormplural + ?masculineShortSingular + ?neuterShortSingular + ?feminineShortSingular + ?pluralShort + WHERE { ?lexeme dct:language wd:Q7737 ; wikibase:lexicalCategory wd:Q34698 ; wikibase:lemma ?adjective . - # MARK: Nominative Forms + # MARK: Nominative OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineNominativeSingularForm . @@ -66,7 +67,7 @@ WHERE { wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . } - # MARK: Genitive Forms + # MARK: Genitive OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineGenitiveSingularForm . @@ -92,7 +93,7 @@ WHERE { wikibase:grammaticalFeature wd:Q146233, wd:Q146786 . } - # MARK: Dative Forms + # MARK: Dative OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineDativeSingularForm . @@ -118,7 +119,7 @@ WHERE { wikibase:grammaticalFeature wd:Q145599, wd:Q146786 . } - # MARK: Accusative Forms + # MARK: Accusative OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineAnimateAccusativeSingularForm . @@ -156,7 +157,7 @@ WHERE { wikibase:grammaticalFeature wd:Q51927539, wd:Q146078, wd:Q146786 . } - # MARK: Instrumental Forms + # MARK: Instrumental OPTIONAL { ?lexeme ontolex:lexicalForm ?masculineInstrumentalSingularForm . @@ -182,7 +183,7 @@ WHERE { wikibase:grammaticalFeature wd:Q192997, wd:Q146786 . } - # MARK: Prepositional Forms + # MARK: Prepositional OPTIONAL { ?lexeme ontolex:lexicalForm ?masculinePrepositionalSingularForm . @@ -207,29 +208,30 @@ WHERE { ?prepositionalPluralForm ontolex:representation ?prepositionalPlural ; wikibase:grammaticalFeature wd:Q2114906, wd:Q146786 . } - # MARK: Short Form + + # MARK: Short OPTIONAL { - ?lexeme ontolex:lexicalForm ?masculineShortFormSingularForm . - ?masculineShortFormSingularForm ontolex:representation ?masculineShortFormSingular ; + ?lexeme ontolex:lexicalForm ?masculineShortSingularForm . + ?masculineShortSingularForm ontolex:representation ?masculineShortSingular ; wikibase:grammaticalFeature wd:Q499327, wd:Q4239848, wd:Q110786 . } OPTIONAL { - ?lexeme ontolex:lexicalForm ?neuterShortFormSingularForm . - ?neuterShortFormSingularForm ontolex:representation ?neuterShortFormSingular ; + ?lexeme ontolex:lexicalForm ?neuterShortSingularForm . + ?neuterShortSingularForm ontolex:representation ?neuterShortSingular ; wikibase:grammaticalFeature wd:Q1775461, wd:Q4239848, wd:Q110786 . } OPTIONAL { - ?lexeme ontolex:lexicalForm ?feminineShortFormSingularForm . - ?feminineShortFormSingularForm ontolex:representation ?feminineShortFormSingular ; + ?lexeme ontolex:lexicalForm ?feminineShortSingularForm . + ?feminineShortSingularForm ontolex:representation ?feminineShortSingular ; wikibase:grammaticalFeature wd:Q1775415, wd:Q4239848, wd:Q110786 . } OPTIONAL { - ?lexeme ontolex:lexicalForm ?ShortFormpluralForm . - ?ShortFormpluralForm ontolex:representation ?ShortFormplural ; + ?lexeme ontolex:lexicalForm ?pluralShortForm . + ?pluralShortForm ontolex:representation ?pluralShort ; wikibase:grammaticalFeature wd:Q4239848, wd:Q146786 . } } From 0eae8c78b88bfd1975547be13b972ffbcc9b2b88 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 20:26:45 +0200 Subject: [PATCH 27/30] Rename Northern Sami directory --- .../Northern}/adjectives/query_adjectives.sparql | 0 .../Northern}/adverbs/query_adverbs.sparql | 0 .../Northern}/nouns/query_nouns.sparql | 0 .../Northern}/verbs/query_verbs.sparql | 0 src/scribe_data/resources/language_metadata.json | 7 ++++--- tests/load/test_update_utils.py | 2 +- 6 files changed, 5 insertions(+), 4 deletions(-) rename src/scribe_data/language_data_extraction/{Northern Sami => Sami/Northern}/adjectives/query_adjectives.sparql (100%) rename src/scribe_data/language_data_extraction/{Northern Sami => Sami/Northern}/adverbs/query_adverbs.sparql (100%) rename src/scribe_data/language_data_extraction/{Northern Sami => Sami/Northern}/nouns/query_nouns.sparql (100%) rename src/scribe_data/language_data_extraction/{Northern Sami => Sami/Northern}/verbs/query_verbs.sparql (100%) diff --git a/src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql b/src/scribe_data/language_data_extraction/Sami/Northern/adjectives/query_adjectives.sparql similarity index 100% rename from src/scribe_data/language_data_extraction/Northern Sami/adjectives/query_adjectives.sparql rename to src/scribe_data/language_data_extraction/Sami/Northern/adjectives/query_adjectives.sparql diff --git a/src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Sami/Northern/adverbs/query_adverbs.sparql similarity index 100% rename from src/scribe_data/language_data_extraction/Northern Sami/adverbs/query_adverbs.sparql rename to src/scribe_data/language_data_extraction/Sami/Northern/adverbs/query_adverbs.sparql diff --git a/src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql similarity index 100% rename from src/scribe_data/language_data_extraction/Northern Sami/nouns/query_nouns.sparql rename to src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql diff --git a/src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql b/src/scribe_data/language_data_extraction/Sami/Northern/verbs/query_verbs.sparql similarity index 100% rename from src/scribe_data/language_data_extraction/Northern Sami/verbs/query_verbs.sparql rename to src/scribe_data/language_data_extraction/Sami/Northern/verbs/query_verbs.sparql diff --git a/src/scribe_data/resources/language_metadata.json b/src/scribe_data/resources/language_metadata.json index 1b2a21972..595be8bf3 100755 --- a/src/scribe_data/resources/language_metadata.json +++ b/src/scribe_data/resources/language_metadata.json @@ -119,9 +119,10 @@ "iso": "ml", "qid": "Q36236" }, - "northern sami": { - "iso": "se", - "qid": "Q33947" + "sami": { + "sub_languages": { + "northern": { "iso": "se", "qid": "Q33947" } + } }, "norwegian": { "sub_languages": { diff --git a/tests/load/test_update_utils.py b/tests/load/test_update_utils.py index 743d30d52..28a77f8f5 100644 --- a/tests/load/test_update_utils.py +++ b/tests/load/test_update_utils.py @@ -162,7 +162,7 @@ def test_list_all_languages(): "malayalam", "mandarin", "nigerian", - "northern sami", + "northern", "nynorsk", "polish", "portuguese", From ffb44a94b7cfc69bfca666dc4da7350a8d4d5cc3 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 20:59:43 +0200 Subject: [PATCH 28/30] Convert structure check over to use metadata files --- .../check/check_project_structure.py | 100 ++++-------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/src/scribe_data/check/check_project_structure.py b/src/scribe_data/check/check_project_structure.py index a304722ff..cb95f7a8c 100644 --- a/src/scribe_data/check/check_project_structure.py +++ b/src/scribe_data/check/check_project_structure.py @@ -25,83 +25,23 @@ """ import os -from pathlib import Path -# Expected languages and data types. -LANGUAGES = { - "Arabic", - "English", - "Greek", - "Italian", - "Malayalam", - "Russian", - "Tamil", - "Basque", - "Esperanto", - "Hausa", - "Japanese", - "Norwegian", - "Slovak", - "Dagbani", - "Ukrainian", - "Bengali", - "Estonian", - "Hebrew", - "Korean", - "Pidgin", - "Spanish", - "Yoruba", - "Chinese", - "Finnish", - "Hindustani", - "Kurmanji", - "Polish", - "Swahili", - "Czech", - "French", - "Indonesian", - "Latin", - "Latvian", - "Portuguese", - "Swedish", - "Danish", - "German", - "Malay", - "Punjabi", - "Tajik", - "Igbo", -} +from scribe_data.cli.cli_utils import ( + LANGUAGE_DATA_EXTRACTION_DIR, + data_type_metadata, + language_metadata, +) -DATA_TYPES = { - "adjectives", - "adverbs", - "articles", - "autosuggestions", - "conjunctions", - "emoji_keywords", - "nouns", - "personal_pronouns", - "postpositions", - "prepositions", - "pronouns", - "proper_nouns", - "verbs", -} - -# Sub-subdirectories expected for specific languages. +# Expected languages and data types. +LANGUAGES = [lang.capitalize() for lang in language_metadata.keys()] +DATA_TYPES = data_type_metadata.keys() SUB_DIRECTORIES = { - "Chinese": ["Mandarin"], - "Hindustani": ["Urdu", "Hindi"], - "Norwegian": ["Nynorsk", "Bokmål"], - "Pidgin": ["Nigerian"], - "Punjabi": ["Shahmukhi", "Gurmukhi"], + k.capitalize(): [lang.capitalize() for lang in v["sub_languages"].keys()] + for k, v in language_metadata.items() + if len(v.keys()) == 1 and "sub_languages" in v.keys() } -# Base directory path. -BASE_DIR = Path(__file__).parent.parent / "language_data_extraction" - - def check_for_sparql_files(folder_path, data_type, language, subdir, missing_queries): """ Check if a data-type folder contains at least one .sparql file. @@ -215,19 +155,21 @@ def validate_project_structure(): missing_folders = [] missing_queries = [] - if not os.path.exists(BASE_DIR): - print(f"Error: Base directory '{BASE_DIR}' does not exist.") + if not os.path.exists(LANGUAGE_DATA_EXTRACTION_DIR): + print(f"Error: Base directory '{LANGUAGE_DATA_EXTRACTION_DIR}' does not exist.") exit(1) - # Check for unexpected files in BASE_DIR. - for item in os.listdir(BASE_DIR): - item_path = os.path.join(BASE_DIR, item) + # Check for unexpected files in LANGUAGE_DATA_EXTRACTION_DIR. + for item in os.listdir(LANGUAGE_DATA_EXTRACTION_DIR): + item_path = os.path.join(LANGUAGE_DATA_EXTRACTION_DIR, item) if os.path.isfile(item_path) and item != "__init__.py": - errors.append(f"Unexpected file found in BASE_DIR: {item}") + errors.append( + f"Unexpected file found in the 'language_data_extraction' files: {item}" + ) # Iterate through the language directories. - for language in os.listdir(BASE_DIR): - language_path = os.path.join(BASE_DIR, language) + for language in os.listdir(LANGUAGE_DATA_EXTRACTION_DIR): + language_path = os.path.join(LANGUAGE_DATA_EXTRACTION_DIR, language) if not os.path.isdir(language_path) or language == "__init__.py": continue From 1af7d91490bb719125c86f406e3c809ea1ef1df5 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 21:06:11 +0200 Subject: [PATCH 29/30] Standardize workflows and fix incorrect language QID --- .../workflows/check_project_structure.yaml | 23 ++++++++++++++++++- .../workflows/check_query_identifiers.yaml | 3 +-- .../Sami/Northern/nouns/query_nouns.sparql | 4 ++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check_project_structure.yaml b/.github/workflows/check_project_structure.yaml index 6c131e0d8..b4cd100b7 100644 --- a/.github/workflows/check_project_structure.yaml +++ b/.github/workflows/check_project_structure.yaml @@ -8,12 +8,33 @@ on: jobs: structure-check: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + python-version: + - "3.9" + + runs-on: ${{ matrix.os }} steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Add project root to PYTHONPATH + run: echo "PYTHONPATH=$(pwd)/src" >> $GITHUB_ENV + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run check_project_structure.py working-directory: ./src/scribe_data/check run: python check_project_structure.py diff --git a/.github/workflows/check_query_identifiers.yaml b/.github/workflows/check_query_identifiers.yaml index d486394a9..ef3e7bd48 100644 --- a/.github/workflows/check_query_identifiers.yaml +++ b/.github/workflows/check_query_identifiers.yaml @@ -3,8 +3,7 @@ on: push: branches: [main] pull_request: - branches: - - main + branches: [main] types: [opened, reopened, synchronize] jobs: diff --git a/src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql b/src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql index 02023257c..24205204e 100644 --- a/src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql +++ b/src/scribe_data/language_data_extraction/Sami/Northern/nouns/query_nouns.sparql @@ -20,7 +20,7 @@ SELECT DISTINCT ?vocativePlural WHERE { - ?lexeme dct:language wd:Q9078 ; + ?lexeme dct:language wd:Q33947 ; wikibase:lexicalCategory wd:Q1084 . # MARK: Nominative @@ -120,4 +120,4 @@ WHERE { ?vocativePluralForm ontolex:representation ?vocativePlural ; wikibase:grammaticalFeature wd:Q185077, wd:Q146786 . } -} +} From a37ed3141391bac0e1a67130adca25b1a5cc1a06 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Sun, 20 Oct 2024 21:22:08 +0200 Subject: [PATCH 30/30] Expand Latin queries and remove unneeded case calls --- .../prepositions/query_prepositions.sparql | 14 +---------- .../Latin/adverbs/query_adverbs.sparql | 23 ++++++++++++++++-- .../prepositions/query_prepositions.sparql | 24 +++++++++++++++++-- .../prepositions/query_prepositions.sparql | 18 +++----------- 4 files changed, 47 insertions(+), 32 deletions(-) diff --git a/src/scribe_data/language_data_extraction/Estonian/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Estonian/prepositions/query_prepositions.sparql index 68d12f333..f8f1cb2b4 100644 --- a/src/scribe_data/language_data_extraction/Estonian/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Estonian/prepositions/query_prepositions.sparql @@ -1,25 +1,13 @@ # tool: scribe-data -# All Estonian (Q9072) prepositions and the given forms. +# All Estonian (Q9072) prepositions (Q4833830) and the given forms. # Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?preposition - ?case WHERE { ?lexeme dct:language wd:Q9072 ; wikibase:lexicalCategory wd:Q4833830 ; wikibase:lemma ?preposition . - - # MARK: Corresponding Case - - OPTIONAL { - ?lexeme wdt:P5713 ?caseForm . - } - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?caseForm rdfs:label ?case . - } } diff --git a/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql b/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql index 2c76c2867..04904622d 100644 --- a/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql +++ b/src/scribe_data/language_data_extraction/Latin/adverbs/query_adverbs.sparql @@ -5,8 +5,27 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?adverb + ?comparative + ?superlative + WHERE { ?lexeme dct:language wd:Q397 ; - wikibase:lexicalCategory wd:Q380057 ; - wikibase:lemma ?adverb . # Retrieve the lemma (base form) of the adverb + wikibase:lexicalCategory wd:Q380057 ; + wikibase:lemma ?adverb . + + # MARK: Comparative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?comparativeForm . + ?comparativeForm ontolex:representation ?comparative ; + wikibase:grammaticalFeature wd:Q14169499 . + } + + # MARK: Superlative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?superlativeForm . + ?superlativeForm ontolex:representation ?superlative ; + wikibase:grammaticalFeature wd:Q1817208 . + } } diff --git a/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql index aa4dcde78..43a114a8e 100644 --- a/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Latin/prepositions/query_prepositions.sparql @@ -5,8 +5,28 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) ?preposition + ?accusative + ?ablative + WHERE { ?lexeme dct:language wd:Q397 ; - wikibase:lexicalCategory wd:Q4833830 ; - wikibase:lemma ?preposition . # Retrieve the lemma (base form) of the preposition + wikibase:lexicalCategory wd:Q4833830 ; + wikibase:lemma ?preposition . + + + # MARK: Accusative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?accusativeForm . + ?accusativeForm ontolex:representation ?accusative ; + wikibase:grammaticalFeature wd:Q146078 . + } + + # MARK: Ablative + + OPTIONAL { + ?lexeme ontolex:lexicalForm ?ablativeForm . + ?ablativeForm ontolex:representation ?ablative ; + wikibase:grammaticalFeature wd:Q156986 . + } } diff --git a/src/scribe_data/language_data_extraction/Slovak/prepositions/query_prepositions.sparql b/src/scribe_data/language_data_extraction/Slovak/prepositions/query_prepositions.sparql index 9fb3a06eb..c485bd0ed 100644 --- a/src/scribe_data/language_data_extraction/Slovak/prepositions/query_prepositions.sparql +++ b/src/scribe_data/language_data_extraction/Slovak/prepositions/query_prepositions.sparql @@ -1,25 +1,13 @@ # tool: scribe-data -# All Slovak (Q9058) prepositions and the given forms. +# All Slovak (Q9058) prepositions (Q4833830) and the given forms. # Enter this query at https://query.wikidata.org/. SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?preposition ?case + ?preposition WHERE { ?lexeme dct:language wd:Q9058 ; wikibase:lexicalCategory wd:Q4833830 ; - wikibase:lemma ?lemma . - - # MARK: Corresponding Case - - OPTIONAL { - ?lexeme wdt:P5713 ?caseForm . - } - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". - ?lemma rdfs:label ?preposition . - ?caseForm rdfs:label ?case . - } + wikibase:lemma ?preposition . }