Skip to content

Commit

Permalink
Add SPARQL query for extracting Nigerian Pidgin nouns with gender and…
Browse files Browse the repository at this point in the history
… plurals

- Implemented a SPARQL query to extract nouns in Nigerian Pidgin (Q33655).
- Extracts the singular form, optional plural form, and optional grammatical gender.
- Ensures readable labels for gender using the Wikibase label service.
- Handles cases where a lexeme doesn't have a plural or specified gender.
  • Loading branch information
DeleMike committed Oct 8, 2024
1 parent dd056df commit f595961
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# tool: scribe-data
# All Nigerian Pidgin (Q33655) nouns and their gender.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?singular
?plural
?gender
WHERE {
VALUES ?nounTypes {wd:Q1084} # Nouns

# Main noun data
?lexeme dct:language wd:Q33655 ; # Nigerian Pidgin
wikibase:lexicalCategory ?nounTypes ;
wikibase:lemma ?singular .

# Plural form (if exists)
OPTIONAL {
?lexeme ontolex:lexicalForm ?pluralForm .
?pluralForm ontolex:representation ?plural ;
wikibase:grammaticalFeature wd:Q146786 ; # Plural
} .

# Gender (if specified)
OPTIONAL {
?lexeme wdt:P5185 ?nounGender . # Grammatical gender
FILTER NOT EXISTS {
?lexeme wdt:P31 wd:Q202444 .
}
} .

# Get readable gender labels
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
?nounGender rdfs:label ?gender .
}
}

0 comments on commit f595961

Please sign in to comment.