Skip to content

Commit

Permalink
Fixes to queries to make results more exact
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Oct 7, 2024
1 parent e1dcd46 commit e505256
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ SELECT DISTINCT

WHERE {
# Select lexemes in Esperanto that are adjectives
?lexeme dct:language wd:Q143 ;
wikibase:lexicalCategory wd:Q34698 ; # Adjective category
?lexeme dct:language wd:Q143 ; # Esperanto
wikibase:lexicalCategory wd:Q34698 ; # Adjective
wikibase:lemma ?adjective .

# Ensure we get only the lexeme forms that are adjectives in Esperanto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?infinitive
?present
?past
?future
?indicative
?presIndicative
?pastIndicative
?futIndicative
?conditional
?volitive

Expand All @@ -22,45 +21,39 @@ WHERE {
# MARK: Present Tense

OPTIONAL {
?lexeme ontolex:lexicalForm ?presentForm .
?presentForm ontolex:representation ?present ;
wikibase:grammaticalFeature wd:Q192613 ; # Present tense in Esperanto
FILTER(LANG(?present) = "eo") .
?lexeme ontolex:lexicalForm ?presIndicativeForm .
?presIndicativeForm ontolex:representation ?presIndicative ;
wikibase:grammaticalFeature wd:Q192613 ;
wikibase:grammaticalFeature wd:Q682111 ;
FILTER(LANG(?presIndicative) = "eo") .
} .

# MARK: Past Tense

OPTIONAL {
?lexeme ontolex:lexicalForm ?pastForm .
?pastForm ontolex:representation ?past ;
wikibase:grammaticalFeature wd:Q1994301 ; # Past tense in Esperanto
FILTER(LANG(?past) = "eo") .
?lexeme ontolex:lexicalForm ?pastIndicativeForm .
?pastIndicativeForm ontolex:representation ?pastIndicative ;
wikibase:grammaticalFeature wd:Q1994301 ;
wikibase:grammaticalFeature wd:Q682111 ;
FILTER(LANG(?pastIndicative) = "eo") .
} .

# MARK: Future Tense

OPTIONAL {
?lexeme ontolex:lexicalForm ?futureForm .
?futureForm ontolex:representation ?future ;
wikibase:grammaticalFeature wd:Q501405 ; # Future tense in Esperanto
FILTER(LANG(?future) = "eo") .
} .

# MARK: Indicative

OPTIONAL {
?lexeme ontolex:lexicalForm ?indicativeForm .
?indicativeForm ontolex:representation ?indicative ;
wikibase:grammaticalFeature wd:Q682111 ; # Indicative mood in Esperanto
FILTER(LANG(?indicative) = "eo") .
?lexeme ontolex:lexicalForm ?futIndicativeForm .
?futIndicativeForm ontolex:representation ?futIndicative ;
wikibase:grammaticalFeature wd:Q501405 ;
wikibase:grammaticalFeature wd:Q682111 ;
FILTER(LANG(?futIndicative) = "eo") .
} .

# MARK: Conditional

OPTIONAL {
?lexeme ontolex:lexicalForm ?conditionalForm .
?conditionalForm ontolex:representation ?conditional ;
wikibase:grammaticalFeature wd:Q625581 ; # Conditional mood in Esperanto
wikibase:grammaticalFeature wd:Q625581 ;
FILTER(LANG(?conditional) = "eo") .
} .

Expand All @@ -69,11 +62,7 @@ WHERE {
OPTIONAL {
?lexeme ontolex:lexicalForm ?volitiveForm .
?volitiveForm ontolex:representation ?volitive ;
wikibase:grammaticalFeature wd:Q2532941 ; # Volitive mood in Esperanto
wikibase:grammaticalFeature wd:Q2532941 ;
FILTER(LANG(?volitive) = "eo") .
} .

SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
}
}

0 comments on commit e505256

Please sign in to comment.