Skip to content

Commit

Permalink
Merge pull request #387 from DeleMike/fix/make-sparql-queries-atomic
Browse files Browse the repository at this point in the history
Refactor SPARQL queries into atomic structures:
  • Loading branch information
andrewtavis authored Oct 16, 2024
2 parents 9fdb576 + 986fe3d commit 999d862
Show file tree
Hide file tree
Showing 227 changed files with 1,358 additions and 382 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) adjectives.
# All Arabic (Q13955) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) adverbs.
# All Arabic (Q13955) adverbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) nouns.
# All Arabic (Q13955) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down Expand Up @@ -35,10 +35,8 @@ SELECT
?masPluralPausalIndef

WHERE {
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and proper nouns

?lexeme dct:language wd:Q13955 ;
wikibase:lexicalCategory ?nounTypes ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?noun .

# MARK: Nominative
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# tool: scribe-data
# All Arabic (Q13955) proper nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?properNoun

WHERE {
?lexeme dct:language wd:Q13955 ;
wikibase:lexicalCategory wd:Q147276 ;
wikibase:lemma ?properNoun .
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) verbs and a portion of the currently implemented tenses for each.
# All Arabic (Q13955) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) verbs and a portion of the currently implemented tenses for each.
# All Arabic (Q13955) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Arabic (Q13955) verbs and a portion of the currently implemented tenses for each.
# All Arabic (Q13955) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Basque (Q8752) adjectives.
# All Basque (Q8752) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Basque (Q8752) adverbs.
# All Basque (Q8752) adverbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Basque (Q8752) nouns and all implemented singular and plural forms.
# All Basque (Q8752) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand All @@ -9,10 +9,8 @@ SELECT
?absPlural

WHERE {
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and proper nouns

?lexeme dct:language wd:Q8752 ;
wikibase:lexicalCategory ?nounTypes ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?absIndefinite .

# MARK: Absolutive Singular
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# tool: scribe-data
# All Basque (Q8752) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?properNoun

WHERE {
?lexeme dct:language wd:Q8752 ;
wikibase:lexicalCategory wd:Q147276;
wikibase:lemma ?properNoun .
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Basque (Q8752) verbs and the currently implemented tenses for each.
# All Basque (Q8752) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) adjectives.
# All Bengali (Bangla Q9610) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) adverbs.
# All Bengali (Bangla Q9610) adverbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) nouns and their forms in the various cases.
# All Bengali (Bangla Q9610) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand All @@ -10,10 +10,8 @@ SELECT
?locative

WHERE {
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and proper nouns

?lexeme dct:language wd:Q9610 ;
wikibase:lexicalCategory ?nounTypes ;
wikibase:lexicalCategory wd:Q1084 ;

# MARK: Nminative

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) postpositions 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:Q9610 ;
wikibase:lexicalCategory wd:Q161873 ;
wikibase:lemma ?preposition .

# MARK: Corresponding Case

OPTIONAL {
?lexeme wdt:P5713 ?caseForm .
} .

SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
?caseForm rdfs:label ?case .
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) prepositions and their corresponding cases.
# All Bengali (Bangla Q9610) prepositions and the given forms.
# Enter this query at https://query.wikidata.org/.
# Note: This query includes postpositions that are also used in Bengali.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?preposition
?case

WHERE {
# Prepositions and postpositions.
VALUES ?prePostPositions { wd:Q4833830 wd:Q161873 }

?lexeme dct:language wd:Q9610 ;
wikibase:lexicalCategory ?prePostPositions ;
wikibase:lexicalCategory wd:Q4833830 ;
wikibase:lemma ?preposition .

# MARK: Corresponding Case
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?nominative
?genitive
?accusative
?locative

WHERE {
?lexeme dct:language wd:Q9610 ;
wikibase:lexicalCategory wd:Q147276 ;

# MARK: Nminative

OPTIONAL {
?lexeme ontolex:lexicalForm ?nomForm .
?nomForm ontolex:representation ?nominative ;
wikibase:grammaticalFeature wd:Q131105 ;
} .

# MARK: Genitive

OPTIONAL {
?lexeme ontolex:lexicalForm ?genForm .
?genForm ontolex:representation ?genitive ;
wikibase:grammaticalFeature wd:Q146233 ;
} .

# MARK: Accusative

OPTIONAL {
?lexeme ontolex:lexicalForm ?accForm .
?accForm ontolex:representation ?accusative ;
wikibase:grammaticalFeature wd:Q146078 ;
} .

# MARK: Locative

OPTIONAL {
?lexeme ontolex:lexicalForm ?locForm .
?locForm ontolex:representation ?locative ;
wikibase:grammaticalFeature wd:Q202142 ;
} .
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Bengali (Bangla Q9610) verbs.
# All Bengali (Bangla Q9610) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Mandarin Chinese (Q727694) adjectives.
# All Mandarin Chinese (Q727694) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Standard Mandarin Chinese (Q727694) adverbs.
# All Standard Mandarin Chinese (Q727694) adverbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# tool: scribe-data
# All Standard Mandarin Chinese (Q727694) nouns.
# All Standard Mandarin Chinese (Q727694) nouns 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 {
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and proper nouns

?lexeme dct:language wd:Q727694 ;
wikibase:lexicalCategory ?nounTypes ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?noun .
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Standard Mandarin Chinese (Q727694) prepositions.
# All Standard Mandarin Chinese (Q727694) prepositions and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# tool: scribe-data
# All Standard Mandarin Chinese (Q727694) proper nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?properNoun

WHERE {
?lexeme dct:language wd:Q727694 ;
wikibase:lexicalCategory wd:Q147276 ;
wikibase:lemma ?properNoun .
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Mandarin Chinese (Q727694) verbs.
# All Mandarin Chinese (Q727694) verbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czech (Q9056) adjectives in the given cases.
# All Czech (Q9056) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czech (Q9056) adjectives in the given cases.
# All Czech (Q9056) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czech (Q9056) adjectives in the given cases.
# All Czech (Q9056) adjectives and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czech (Q9056) adverbs in the given cases.
# All Czech (Q9056) adverbs and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czeck (Q9056) nouns, their plurals and their genders.
# All Czeck (Q9056) nouns and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand All @@ -9,10 +9,8 @@ SELECT
?gender

WHERE {
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and proper nouns

?lexeme dct:language wd:Q9056 ;
wikibase:lexicalCategory ?nounTypes .
wikibase:lexicalCategory wd:Q1084 .

# MARK: Nominative Singular

Expand All @@ -34,9 +32,6 @@ WHERE {

OPTIONAL {
?lexeme wdt:P5185 ?nounGender .
FILTER NOT EXISTS {
?lexeme wdt:P31 wd:Q202444 . # not for given names
}
} .

SERVICE wikibase:label {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tool: scribe-data
# All Czech (Q9056) prepositions and their corresponding cases.
# All Czech (Q9056) prepositions and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
Expand Down
Loading

0 comments on commit 999d862

Please sign in to comment.