From 49df8d8e0952aa4dca149ef6cf2d596c024d6f1c Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Fri, 10 Jan 2025 12:50:43 +0100 Subject: [PATCH] #549 Split German nouns query into sub queries --- .../german/nouns/query_nouns_1.sparql | 13 +++++++++++ ...uery_nouns.sparql => query_nouns_2.sparql} | 16 +------------ .../german/nouns/query_nouns_3.sparql | 23 +++++++++++++++++++ 3 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_1.sparql rename src/scribe_data/wikidata/language_data_extraction/german/nouns/{query_nouns.sparql => query_nouns_2.sparql} (62%) create mode 100644 src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_3.sparql diff --git a/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_1.sparql b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_1.sparql new file mode 100644 index 00000000..5b590a07 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_1.sparql @@ -0,0 +1,13 @@ +# tool: scribe-data +# All German (Q188) 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) + ?nominativeSingular + +WHERE { + ?lexeme dct:language wd:Q188 ; + wikibase:lexicalCategory wd:Q1084 ; + wikibase:lemma ?nominativeSingular . +} diff --git a/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns.sparql b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_2.sparql similarity index 62% rename from src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns.sparql rename to src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_2.sparql index 7bc5286a..00154622 100644 --- a/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns.sparql +++ b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_2.sparql @@ -4,14 +4,11 @@ SELECT (REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) - ?nominativeSingular ?nominativePlural - ?gender WHERE { ?lexeme dct:language wd:Q188 ; - wikibase:lexicalCategory wd:Q1084 ; - wikibase:lemma ?nominativeSingular . + wikibase:lexicalCategory wd:Q1084 . # MARK: Nominative Plural @@ -20,15 +17,4 @@ WHERE { ?nominativePluralForm ontolex:representation ?nominativePlural ; wikibase:grammaticalFeature wd:Q131105, wd:Q146786 . } - - # MARK: Gender(s) - - OPTIONAL { - ?lexeme wdt:P5185 ?nounGender . - } - - SERVICE wikibase:label { - bd:serviceParam wikibase:language "en" . - ?nounGender rdfs:label ?gender . - } } diff --git a/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_3.sparql b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_3.sparql new file mode 100644 index 00000000..0d0a6061 --- /dev/null +++ b/src/scribe_data/wikidata/language_data_extraction/german/nouns/query_nouns_3.sparql @@ -0,0 +1,23 @@ +# tool: scribe-data +# All German (Q188) 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) + ?gender + +WHERE { + ?lexeme dct:language wd:Q188 ; + wikibase:lexicalCategory wd:Q1084 . + + # MARK: Gender(s) + + OPTIONAL { + ?lexeme wdt:P5185 ?nounGender . + } + + SERVICE wikibase:label { + bd:serviceParam wikibase:language "en" . + ?nounGender rdfs:label ?gender . + } +}