Skip to content

Commit

Permalink
Trimed trailing white-spaces I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarAI2003 committed Oct 7, 2024
1 parent 301d4c7 commit ebc56ed
Showing 1 changed file with 38 additions and 34 deletions.
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

0 comments on commit ebc56ed

Please sign in to comment.