Skip to content

Commit

Permalink
#124 Fixes for update_data.py and reformat/add to noun queries
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jun 2, 2024
1 parent 22632f5 commit bff1da6
Show file tree
Hide file tree
Showing 87 changed files with 605 additions and 483 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# tool: scribe-data
# All Arabic (Q13955) nouns.
# All Arabic (Q13955) nouns, their plurals and their dual forms.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?noun
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?singular
?plural
?dual

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns # Nouns and pronouns
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q13955 ;
wikibase:lexicalCategory ?nounType ;
wikibase:lemma ?noun .
wikibase:lemma ?singular .

FILTER(?nounType = ?nounTypes)

# Optional selection of indefinite plural forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?pluralForm .
?pluralForm ontolex:representation ?plural ;
wikibase:grammaticalFeature wd:Q53997857 ;
wikibase:grammaticalFeature wd:Q146786 ;
} .

# Optional selection of indefinite dual form.
OPTIONAL {
?lexeme ontolex:lexicalForm ?dualForm .
?dualForm ontolex:representation ?dual ;
wikibase:grammaticalFeature wd:Q53997857 ;
wikibase:grammaticalFeature wd:Q110022 ;
} .
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?verb
?presFPS ?presSPSM ?presSPSF ?presTPSM ?presTPSF
?presSPD ?presTPDM ?presTPDF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?verb
?pastFPS ?pastSPSM ?pastSPSF ?pastTPSM ?pastTPSF
?pastSPD ?pastTPDM ?pastTPDF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?verb
?impSPSM ?impSPSF ?impSPD
?impSPPM ?impSPPF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# tool: scribe-data
# All Basque (Q8752) nouns.
# All Basque (Q8752) nouns and all implemented singular and plural forms.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?noun
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?absIndefinite
?absSingular
?absPlural

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q8752 ;
wikibase:lexicalCategory ?nounType ;
wikibase:lemma ?noun .
wikibase:lemma ?absIndefinite .

FILTER(?nounType = ?nounTypes)

# Optional selection of absolutive singular forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?absSingularForm .
?absSingularForm ontolex:representation ?absSingular ;
wikibase:grammaticalFeature wd:Q332734 ;
wikibase:grammaticalFeature wd:Q110786 ;
} .

# Optional selection of absolutive plural forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?absPluralForm .
?absPluralForm ontolex:representation ?absPlural ;
wikibase:grammaticalFeature wd:Q332734 ;
wikibase:grammaticalFeature wd:Q146786 ;
} .
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

WHERE {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

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

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

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9610 ;
wikibase:lexicalCategory ?nounType ;
wikibase:lemma ?noun .

FILTER(?nounType = ?nounTypes)

# Optional selection of nominative form.
OPTIONAL {
?lexeme ontolex:lexicalForm ?nomForm .
?nomForm ontolex:representation ?nominative ;
wikibase:grammaticalFeature wd:Q131105 ;
} .

# Optional selection of genitive form.
OPTIONAL {
?lexeme ontolex:lexicalForm ?genForm .
?genForm ontolex:representation ?genitive ;
wikibase:grammaticalFeature wd:Q146233 ;
} .

# Optional selection of accusative form.
OPTIONAL {
?lexeme ontolex:lexicalForm ?accForm .
?accForm ontolex:representation ?accusative ;
wikibase:grammaticalFeature wd:Q146078 ;
} .

# Optional selection of locative form.
OPTIONAL {
?lexeme ontolex:lexicalForm ?locForm .
?locForm ontolex:representation ?locative ;
wikibase:grammaticalFeature wd:Q202142 ;
} .
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

WHERE {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
# tool: scribe-data
# All Bokmål (Norwegian) (Q9043) nouns, their plural and their gender.
# All Bokmål Norwegian (Q9043) nouns, their plurals and their genders.
# Enter this query at https://query.wikidata.org/.
# Note that this query is for Bokmål (Q25167) rather than Nynorsk (Q25164).

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?indefSingular
?defSingular
?indefPlural
?defPlural
?gender

WHERE {

# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q25167 ;
wikibase:lexicalCategory ?noun .
FILTER(?noun = ?nounTypes)
wikibase:lexicalCategory ?nounType ;
wikibase:lemma ?indefSingular .

FILTER(?nounType = ?nounTypes)

# Optional selection of singular forms.
# Optional selection of definite singular forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?singularForm .
?singularForm ontolex:representation ?singular ;
?lexeme ontolex:lexicalForm ? ?defSingularForm .
?defSingularForm ontolex:representation ?defSingular ;
wikibase:grammaticalFeature wd:Q110786 ;
wikibase:grammaticalFeature wd:Q53997851 ;
} .

# Optional selection of indefinite plural forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?indefPluralForm .
?indefPluralForm ontolex:representation ?indefPlural ;
wikibase:grammaticalFeature wd:Q146786 ;
wikibase:grammaticalFeature wd:Q53997857 ;
} .

# Optional selection of plural forms.
# Optional selection of definite plural forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?pluralForm .
?pluralForm ontolex:representation ?plural ;
?lexeme ontolex:lexicalForm ?defPluralForm .
?defPluralForm ontolex:representation ?defPlural ;
wikibase:grammaticalFeature wd:Q146786 ;
wikibase:grammaticalFeature wd:Q53997851 ;
} .

# Optional selection of genders.
OPTIONAL {
?lexeme wdt:P5185 ?nounGender .
FILTER NOT EXISTS { ?lexeme wdt:P31 wd:Q202444 . }
FILTER NOT EXISTS {
?lexeme wdt:P31 wd:Q202444 .
}
} .

SERVICE wikibase:label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Note that this query is for Bokmål (Q25167) rather than Nynorsk (Q25164).

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

WHERE {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# tool: scribe-data
# All Czeck (Q9056) nouns, their plural, and their gender.
# All Czeck (Q9056) nouns, their plurals and their genders.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?nomSingular
?nomPlural
?gender

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9056 ;
wikibase:lexicalCategory ?noun .
FILTER(?noun = ?nounTypes)
wikibase:lexicalCategory ?nounType .

# Optional selection of singular forms.
FILTER(?nounType = ?nounTypes)

# Optional selection of nominative singular forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?singularForm .
?singularForm ontolex:representation ?singular ;
wikibase:grammaticalFeature wd:Q110786 ;
?lexeme ontolex:lexicalForm ?nomSingularForm .
?nomSingularForm ontolex:representation ?nomSingular ;
wikibase:grammaticalFeature wd:Q131105 ;
wikibase:grammaticalFeature wd:Q110786 ;
} .

# Optional selection of plural forms.
# Optional selection of nominative plural forms.
OPTIONAL {
?lexeme ontolex:lexicalForm ?pluralForm .
?pluralForm ontolex:representation ?plural ;
wikibase:grammaticalFeature wd:Q146786 ;
?lexeme ontolex:lexicalForm ?nomPluralForm .
?nomPluralForm ontolex:representation ?nomPlural ;
wikibase:grammaticalFeature wd:Q131105 ;
wikibase:grammaticalFeature wd:Q146786 ;
} .

# Optional selection of genders.
OPTIONAL {
?lexeme wdt:P5185 ?nounGender .
FILTER NOT EXISTS { ?lexeme wdt:P31 wd:Q202444 . }
FILTER NOT EXISTS {
?lexeme wdt:P31 wd:Q202444 .
}
} .

SERVICE wikibase:label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Enter this query at https://query.wikidata.org/.

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

WHERE {
Expand Down
Loading

0 comments on commit bff1da6

Please sign in to comment.