Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement autosuggestions generation in get_data function #462

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ SELECT
?singular
?plural
?gender
?definite
?indefinite

WHERE {
?lexeme dct:language wd:Q56475 ;
wikibase:lexicalCategory wd:Q1084 ;
wikibase:lemma ?singular .
FILTER(lang(?singular) = "ha")
# FILTER(lang(?singular) = "ha-arabic")
FILTER(lang(?singular) = "ha")
# FILTER(lang(?singular) = "ha-arabic")

# MARK: Plural

OPTIONAL {
?lexeme ontolex:lexicalForm ?pluralForm .
?pluralForm ontolex:representation ?plural ;
wikibase:grammaticalFeature wd:Q146786 .
FILTER(lang(?plural) = "ha")
# FILTER(lang(?plural) = "ha-arabic")
FILTER(lang(?plural) = "ha")
# FILTER(lang(?plural) = "ha-arabic")
}

# MARK: Gender(s)
Expand All @@ -31,6 +33,26 @@ WHERE {
?lexeme wdt:P5185 ?nounGender .
}

# MARK: Definite form

OPTIONAL {
?lexeme ontolex:lexicalForm ?definiteForm .
?definiteForm ontolex:representation ?definite ;
wikibase:grammaticalFeature wd:Q53997851 .
FILTER(lang(?definite) = "ha")
# FILTER(lang(?definite) = "ha-arabic")
}

# MARK: Indefinite form

OPTIONAL {
?lexeme ontolex:lexicalForm ?indefiniteForm .
?indefiniteForm ontolex:representation ?indefinite ;
wikibase:grammaticalFeature wd:Q53997857 .
FILTER(lang(?indefinite) = "ha")
# FILTER(lang(?indefinite) = "ha-arabic")
}

SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
?nounGender rdfs:label ?gender .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
# tool: scribe-data
# All Hausa (Q56475) nouns (Q1084) and the given forms.
# All Hausa (Q56475) proper nouns (Q147276) and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?singular
?gender
?definite
?vocative

WHERE {
?lexeme dct:language wd:Q56475 ;
wikibase:lexicalCategory wd:Q147276 ;
wikibase:lemma ?singular .
FILTER(lang(?singular) = "ha")
# FILTER(lang(?singular) = "ha-arabic")
FILTER(lang(?singular) = "ha")
# FILTER(lang(?singular) = "ha-arabic")

# MARK: Gender(s)

OPTIONAL {
?lexeme wdt:P5185 ?nounGender .
}

# MARK: Definite form

OPTIONAL {
?lexeme ontolex:lexicalForm ?definiteForm .
?definiteForm ontolex:representation ?definite ;
wikibase:grammaticalFeature wd:Q53997851 .
FILTER(lang(?definite) = "ha")
# FILTER(lang(?definite) = "ha-arabic")
}

# MARK: Vocative form

OPTIONAL {
?lexeme ontolex:lexicalForm ?vocativeForm .
?vocativeForm ontolex:representation ?vocative ;
wikibase:grammaticalFeature wd:Q185077 .
FILTER(lang(?vocative) = "ha")
# FILTER(lang(?vocative) = "ha-arabic")
}

SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
?nounGender rdfs:label ?gender .
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,67 @@

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?verb
?infinitive
?pastSimple
?presentContinuous
?futureTense
?imperativeSingular
?imperativePlural

WHERE {
?lexeme dct:language wd:Q56475 ;
wikibase:lexicalCategory wd:Q24905 ;
wikibase:lemma ?verb .
FILTER(lang(?verb) = "ha")
# FILTER(lang(?verb) = "ha-arabic")
}
wikibase:lemma ?infinitive .
FILTER(lang(?infinitive) = "ha")
# FILTER(lang(?infinitive) = "ha-arabic")

# MARK: Past Simple

OPTIONAL {
?lexeme ontolex:lexicalForm ?pastSimpleForm .
?pastSimpleForm ontolex:representation ?pastSimple ;
wikibase:grammaticalFeature wd:Q1392475, wd:Q1240211 .
FILTER(lang(?pastSimple) = "ha")
# FILTER(lang(?pastSimple) = "ha-arabic")
}

# MARK: Present Continuous

OPTIONAL {
?lexeme ontolex:lexicalForm ?presentContinuousForm .
?presentContinuousForm ontolex:representation ?presentContinuous ;
wikibase:grammaticalFeature wd:Q192613, wd:Q1423695 .
FILTER(lang(?presentContinuous) = "ha")
# FILTER(lang(?presentContinuous) = "ha-arabic")
}

# MARK: Future Tense

OPTIONAL {
?lexeme ontolex:lexicalForm ?futureTenseForm .
?futureTenseForm ontolex:representation ?futureTense ;
wikibase:grammaticalFeature wd:Q618612 .
FILTER(lang(?futureTense) = "ha")
# FILTER(lang(?futureTense) = "ha-arabic")
}

# MARK: Imperative Singular

OPTIONAL {
?lexeme ontolex:lexicalForm ?imperativeSingularForm .
?imperativeSingularForm ontolex:representation ?imperativeSingular ;
wikibase:grammaticalFeature wd:Q22716, wd:Q110786 .
FILTER(lang(?imperativeSingular) = "ha")
# FILTER(lang(?imperativeSingular) = "ha-arabic")
}

# MARK: Imperative Plural

OPTIONAL {
?lexeme ontolex:lexicalForm ?imperativePluralForm .
?imperativePluralForm ontolex:representation ?imperativePlural ;
wikibase:grammaticalFeature wd:Q22716, wd:Q146786 .
FILTER(lang(?imperativePlural) = "ha")
# FILTER(lang(?imperativePlural) = "ha-arabic")
}
}