-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trimed trailing white-spaces I guess
- Loading branch information
1 parent
301d4c7
commit ebc56ed
Showing
1 changed file
with
38 additions
and
34 deletions.
There are no files selected for viewing
72 changes: 38 additions & 34 deletions
72
src/scribe_data/language_data_extraction/Arabic/nouns/query_nouns.sparql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,79 @@ | ||
# tool: scribe-data | ||
# All Arabic (Q13955) nouns, their plurals, definiteSingular, definitePlural, feminineSingular, femininePlural and their dual forms. | ||
# All Arabic (Q13955) nouns and their associated forms with all grammatical features. | ||
# Enter this query at https://query.wikidata.org/. | ||
|
||
SELECT DISTINCT | ||
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID) | ||
?singular | ||
?plural | ||
?dual | ||
?definiteSingular | ||
?definitePlural | ||
?feminineSingular | ||
?femininePlural | ||
# MARK: Columns | ||
?lexemeId | ||
?actualWord | ||
(GROUP_CONCAT(?featureLabel; separator=", ") AS ?features) | ||
|
||
WHERE { | ||
VALUES ?nounTypes {wd:Q1084 wd:Q147276} # Nouns and pronouns | ||
# MARK: Lexeme Selection | ||
?lexeme dct:language wd:Q13955 ; # Language: Arabic (Q13955) | ||
wikibase:lexicalCategory wd:Q1084. # Lexical Category: Noun (Q1084) | ||
|
||
?lexeme dct:language wd:Q13955 ; | ||
wikibase:lexicalCategory ?nounTypes ; | ||
wikibase:lemma ?singular . | ||
# MARK: Form Extraction | ||
?lexeme ontolex:lexicalForm ?form. | ||
|
||
# MARK: Indefinite Plural | ||
# MARK: Lexeme ID Formatting | ||
BIND(STRAFTER(STR(?form), "entity/") AS ?lexemeId). | ||
|
||
# MARK: Word Representation | ||
?form ontolex:representation ?actualWord. | ||
|
||
# MARK: Grammatical Features Extraction | ||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?pluralForm . | ||
?pluralForm ontolex:representation ?plural ; | ||
wikibase:grammaticalFeature wd:Q53997857 ; | ||
wikibase:grammaticalFeature wd:Q146786 ; | ||
} . | ||
?form wikibase:grammaticalFeature ?feature. | ||
} | ||
|
||
# MARK: Indefinite Dual | ||
|
||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?dualForm . | ||
?dualForm ontolex:representation ?dual ; | ||
wikibase:grammaticalFeature wd:Q53997857 ; | ||
wikibase:grammaticalFeature wd:Q110022 ; | ||
wikibase:grammaticalFeature wd:Q53997857 ; # Indefinite | ||
wikibase:grammaticalFeature wd:Q110022 ; # Dual | ||
} . | ||
|
||
# MARK: Definite Singular | ||
|
||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?defSingularForm . | ||
?defSingularForm ontolex:representation ?definiteSingular ; | ||
wikibase:grammaticalFeature wd:Q53997793 ; | ||
wikibase:grammaticalFeature wd:Q131105 ; | ||
wikibase:grammaticalFeature wd:Q53997793 ; # Definite | ||
wikibase:grammaticalFeature wd:Q131105 ; # Singular | ||
} . | ||
|
||
# MARK: Definite Plural | ||
|
||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?defPluralForm . | ||
?defPluralForm ontolex:representation ?definitePlural ; | ||
wikibase:grammaticalFeature wd:Q53997793 ; | ||
wikibase:grammaticalFeature wd:Q146786 ; | ||
wikibase:grammaticalFeature wd:Q53997793 ; # Definite | ||
wikibase:grammaticalFeature wd:Q146786 ; # Plural | ||
} . | ||
|
||
# MARK: Feminine Singular | ||
|
||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?femSingularForm . | ||
?femSingularForm ontolex:representation ?feminineSingular ; | ||
wikibase:grammaticalFeature wd:Q1775415 ; | ||
wikibase:grammaticalFeature wd:Q131105 ; | ||
wikibase:grammaticalFeature wd:Q1775415 ; # Feminine | ||
wikibase:grammaticalFeature wd:Q131105 ; # Singular | ||
} . | ||
|
||
# MARK: Feminine Plural | ||
|
||
OPTIONAL { | ||
?lexeme ontolex:lexicalForm ?femPluralForm . | ||
?femPluralForm ontolex:representation ?femininePlural ; | ||
wikibase:grammaticalFeature wd:Q1775415 ; | ||
wikibase:grammaticalFeature wd:Q146786 ; | ||
wikibase:grammaticalFeature wd:Q1775415 ; # Feminine | ||
wikibase:grammaticalFeature wd:Q146786 ; # Plural | ||
} . | ||
|
||
# MARK: Feature Labeling | ||
SERVICE wikibase:label { | ||
bd:serviceParam wikibase:language "en". | ||
?feature rdfs:label ?featureLabel. | ||
} | ||
} | ||
|
||
# MARK: Grouping and Ordering | ||
GROUP BY ?lexemeId ?actualWord | ||
ORDER BY ?lexemeId |