Skip to content

Commit

Permalink
Expand lexeme metadata and fix forms
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Oct 22, 2024
1 parent ef5f6a4 commit ca15554
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 164 deletions.
3 changes: 3 additions & 0 deletions src/scribe_data/check/check_query_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def check_form_label(form_text: str):
form_label = label_match[1].strip()
current_form_rep_label = form_label.split("Form")[0]

if not line_match:
return False

onto_rep_pattern = r"{form_label} ontolex:representation .* ;".format(
form_label=form_label
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,49 @@
# tool: scribe-data
# tool: scribe-data
# All Persian (Q9168) verbs (Q24905) and the given forms.
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?infinitive
?presentTenseParticiple
?pastTenseParticiple
?presentTenseWordStem
?pastTenseWordStem
?presentParticiple
?pastParticiple
?presentWordStem
?pastWordStem

WHERE {
?lexeme dct:language wd:Q9168;
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitiveForm.
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitive.

#MARK: infinitive
OPTIONAL {
?lexeme ontolex:lexicalForm ?infinitiveLexForm.
?infinitiveLexForm ontolex:representation ?infinitive;
wikibase:grammaticalFeature wd:Q179230.
}
#MARK: Past Participle

#MARK: present tense and past participle
OPTIONAL {
?lexeme ontolex:lexicalForm ?presentParticipleForm.
?presentParticipleForm ontolex:representation ?presentTenseParticiple;
wikibase:grammaticalFeature wd:Q192613 , wd:Q814722.
FILTER(lang(?presentTenseParticiple) = "fa").
?lexeme ontolex:lexicalForm ?presentParticipleForm .
?presentParticipleForm ontolex:representation ?presentParticiple ;
wikibase:grammaticalFeature wd:Q192613, wd:Q814722 .
FILTER(lang(?presentParticiple) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?pastParticipleForm.
?pastParticipleForm ontolex:representation ?pastTenseParticiple;
wikibase:grammaticalFeature wd:Q814722 , wd:Q1994301.
FILTER(lang(?pastTenseParticiple) = "fa").
?lexeme ontolex:lexicalForm ?pastParticipleForm .
?pastParticipleForm ontolex:representation ?pastParticiple ;
wikibase:grammaticalFeature wd:Q814722, wd:Q1994301 .
FILTER(lang(?pastParticiple) = "fa").
}

#MARK: present tense and past word stem
#MARK: Word Stem

OPTIONAL {
?lexeme ontolex:lexicalForm ?presentWordStemForm.
?presentWordStemForm ontolex:representation ?presentTenseWordStem;
wikibase:grammaticalFeature wd:Q192613 , wd:Q210523.
FILTER(lang(?presentTenseWordStem) = "fa").
?lexeme ontolex:lexicalForm ?presentWordStemForm .
?presentWordStemForm ontolex:representation ?presentWordStem ;
wikibase:grammaticalFeature wd:Q192613, wd:Q210523 .
FILTER(lang(?presentWordStem) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?pastWordStemForm.
?pastWordStemForm ontolex:representation ?pastTenseWordStem;
wikibase:grammaticalFeature wd:Q1994301, wd:Q210523.
FILTER(lang(?pastTenseWordStem) = "fa").
?lexeme ontolex:lexicalForm ?pastWordStemForm .
?pastWordStemForm ontolex:representation ?pastWordStem ;
wikibase:grammaticalFeature wd:Q1994301, wd:Q210523 .
FILTER(lang(?pastWordStem) = "fa").
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,59 @@
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?infinitive
?firstPersonSingularIndicativeAorist
?secondPersonSingularIndicativeAorist
?thirdPersonSingularIndicativeAorist
?firstPersonPluralIndicativeAorist
?secondPersonPluralIndicativeAorist
?thirdPersonPluralIndicativeAorist
?indicativeFirstPersonAoristSingular
?indicativeSecondPersonAoristSingular
?indicativeThirdPersonAoristSingular
?indicativeFirstPersonAoristPlural
?indicativeSecondPersonAoristPlural
?indicativeThirdPersonAoristPlural

WHERE {
?lexeme dct:language wd:Q9168;
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitiveForm.
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitive.

#MARK: infinitive
OPTIONAL {
?lexeme ontolex:lexicalForm ?infinitiveLexForm.
?infinitiveLexForm ontolex:representation ?infinitive;
wikibase:grammaticalFeature wd:Q179230.
}
#MARK: Indicative Aorist

#MARK: indicative aorist
OPTIONAL {
?lexeme ontolex:lexicalForm ?firstSingularAoristForm.
?firstSingularAoristForm ontolex:representation ?firstPersonSingularIndicativeAorist;
wikibase:grammaticalFeature wd:Q21714344 , wd:Q110786 , wd:Q682111 , wd:Q216497.
FILTER(lang(?firstPersonSingularIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeFirstPersonAoristSingularForm .
?indicativeFirstPersonAoristSingularForm ontolex:representation ?indicativeFirstPersonAoristSingular ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q110786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeFirstPersonAoristSingular) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondSingularAoristForm.
?secondSingularAoristForm ontolex:representation ?secondPersonSingularIndicativeAorist;
wikibase:grammaticalFeature wd:Q51929049 , wd:Q110786, wd:Q682111 , wd:Q216497.
FILTER(lang(?secondPersonSingularIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeSecondPersonAoristSingularForm .
?indicativeSecondPersonAoristSingularForm ontolex:representation ?indicativeSecondPersonAoristSingular ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q110786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeSecondPersonAoristSingular) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdSingularAoristForm.
?thirdSingularAoristForm ontolex:representation ?thirdPersonSingularIndicativeAorist;
wikibase:grammaticalFeature wd:Q51929074 , wd:Q110786 , wd:Q682111 , wd:Q216497.
FILTER(lang(?thirdPersonSingularIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeThirdPersonAoristSingularForm .
?indicativeThirdPersonAoristSingularForm ontolex:representation ?indicativeThirdPersonAoristSingular ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q110786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeThirdPersonAoristSingular) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?firstPluralAoristForm.
?firstPluralAoristForm ontolex:representation ?firstPersonPluralIndicativeAorist;
wikibase:grammaticalFeature wd:Q21714344 ,wd:Q146786 , wd:Q682111 , wd:Q216497.
FILTER(lang(?firstPersonPluralIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeFirstPersonAoristPluralForm .
?indicativeFirstPersonAoristPluralForm ontolex:representation ?indicativeFirstPersonAoristPlural ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q146786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeFirstPersonAoristPlural) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondPluralAoristForm.
?secondPluralAoristForm ontolex:representation ?secondPersonPluralIndicativeAorist;
wikibase:grammaticalFeature wd:Q51929049 ,wd:Q146786 , wd:Q682111 ,wd:Q216497.
FILTER(lang(?secondPersonPluralIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeSecondPersonAoristPluralForm .
?indicativeSecondPersonAoristPluralForm ontolex:representation ?indicativeSecondPersonAoristPlural ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q146786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeSecondPersonAoristPlural) = "fa").
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdPluralAoristForm.
?thirdPluralAoristForm ontolex:representation ?thirdPersonPluralIndicativeAorist;
wikibase:grammaticalFeature wd:Q51929074 , wd:Q146786 ,wd:Q682111 ,wd:Q216497.
FILTER(lang(?thirdPersonPluralIndicativeAorist) = "fa").
?lexeme ontolex:lexicalForm ?indicativeThirdPersonAoristPluralForm .
?indicativeThirdPersonAoristPluralForm ontolex:representation ?indicativeThirdPersonAoristPlural ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q146786, wd:Q682111, wd:Q216497 .
FILTER(lang(?indicativeThirdPersonAoristPlural) = "fa").
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,53 @@
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?infinitive
?firstPersonSingularPastTenseIndicative
?secondPersonSingularPastTenseIndicative
?thirdPersonSingularPastTenseIndicative
?firstPersonPluralPastTenseIndicative
?secondPersonPluralPastTenseIndicative
?thirdPersonPluralPastTenseIndicative
?indicativePastFirstPersonSingular
?indicativePastSecondPersonSingular
?indicativePastThirdPersonSingular
?indicativePastFirstPersonPlural
?indicativePastSecondPersonPlural
?indicativePastThirdPersonPlural

WHERE {
?lexeme dct:language wd:Q9168 ;
wikibase:lexicalCategory wd:Q24905 .

#MARK: infinitive
?lexeme ontolex:lexicalForm ?infinitiveForm .
?infinitiveForm ontolex:representation ?infinitive ;
wikibase:grammaticalFeature wd:Q179230 .
?lexeme dct:language wd:Q9168;
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitive.

# MARK: Past and Present Indicative

OPTIONAL {
?lexeme ontolex:lexicalForm ?firstPersonSingularPastTenseForm .
?firstPersonSingularPastTenseForm ontolex:representation ?firstPersonSingularPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q110786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastFirstPersonSingularForm .
?indicativePastFirstPersonSingularForm ontolex:representation ?indicativePastFirstPersonSingular ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q110786, wd:Q1994301, wd:Q682111 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondPersonSingularPastTenseForm .
?secondPersonSingularPastTenseForm ontolex:representation ?secondPersonSingularPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q110786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastSecondPersonSingularForm .
?indicativePastSecondPersonSingularForm ontolex:representation ?indicativePastSecondPersonSingular ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q110786, wd:Q1994301, wd:Q682111 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdPersonSingularPastTenseForm .
?thirdPersonSingularPastTenseForm ontolex:representation ?thirdPersonSingularPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q110786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastThirdPersonSingularForm .
?indicativePastThirdPersonSingularForm ontolex:representation ?indicativePastThirdPersonSingular ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q110786, wd:Q1994301, wd:Q682111 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?firstPersonPluralPastTenseForm .
?firstPersonPluralPastTenseForm ontolex:representation ?firstPersonPluralPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q146786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastFirstPersonPluralForm .
?indicativePastFirstPersonPluralForm ontolex:representation ?indicativePastFirstPersonPlural ;
wikibase:grammaticalFeature wd:Q21714344, wd:Q146786, wd:Q1994301, wd:Q682111 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondPersonPluralPastTenseForm .
?secondPersonPluralPastTenseForm ontolex:representation ?secondPersonPluralPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q146786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastSecondPersonPluralForm .
?indicativePastSecondPersonPluralForm ontolex:representation ?indicativePastSecondPersonPlural ;
wikibase:grammaticalFeature wd:Q51929049, wd:Q146786, wd:Q1994301, wd:Q682111 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdPersonPluralPastTenseForm .
?thirdPersonPluralPastTenseForm ontolex:representation ?thirdPersonPluralPastTenseIndicative ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q146786, wd:Q1994301 , wd:Q682111;
?lexeme ontolex:lexicalForm ?indicativePastThirdPersonPluralForm .
?indicativePastThirdPersonPluralForm ontolex:representation ?indicativePastThirdPersonPlural ;
wikibase:grammaticalFeature wd:Q51929074, wd:Q146786, wd:Q1994301, wd:Q682111 .
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,53 @@
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") AS ?lexemeID)
?infinitive
?firstPersonSingPresentPerfect
?secondPersonSingPresentPerfect
?thirdPersonSingPresentPerfect
?firstPersonPluralPresentPerfect
?secondPersonPluralPresentPerfect
?thirdPersonPluralPresentPerfect
?presentPerfectFirstPersonSingular
?presentPerfectSecondPersonSingular
?presentPerfectThirdPersonSingular
?presentPerfectFirstPersonPlural
?presentPerfectSecondPersonPlural
?presentPerfectThirdPersonPlural

WHERE {
?lexeme dct:language wd:Q9168;
wikibase:lexicalCategory wd:Q24905.
wikibase:lexicalCategory wd:Q24905;
wikibase:lemma ?infinitive.

# MARK: Infinitive
?lexeme ontolex:lexicalForm ?infinitiveForm .
?infinitiveForm ontolex:representation ?infinitive ;
wikibase:grammaticalFeature wd:Q179230 .
# MARK: Present Perfect

# MARK: Present Perfect Forms
OPTIONAL {
?lexeme ontolex:lexicalForm ?firstPersonSingPresentPerfectForm.
?firstPersonSingPresentPerfectForm ontolex:representation ?firstPersonSingPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q21714344 , wd:Q192613 , wd:Q110786.
?lexeme ontolex:lexicalForm ?presentPerfectFirstPersonSingularForm .
?presentPerfectFirstPersonSingularForm ontolex:representation ?presentPerfectFirstPersonSingular ;
wikibase:grammaticalFeature wd:Q625420, wd:Q21714344, wd:Q192613, wd:Q110786 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondPersonSingPresentPerfectForm.
?secondPersonSingPresentPerfectForm ontolex:representation ?secondPersonSingPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q51929049 ,wd:Q192613 , wd:Q110786.
?lexeme ontolex:lexicalForm ?presentPerfectSecondPersonSingularForm .
?presentPerfectSecondPersonSingularForm ontolex:representation ?presentPerfectSecondPersonSingular ;
wikibase:grammaticalFeature wd:Q625420, wd:Q51929049, wd:Q192613, wd:Q110786 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdPersonSingPresentPerfectForm.
?thirdPersonSingPresentPerfectForm ontolex:representation ?thirdPersonSingPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q51929074 ,wd:Q192613 , wd:Q110786.
?lexeme ontolex:lexicalForm ?presentPerfectThirdPersonSingularForm .
?presentPerfectThirdPersonSingularForm ontolex:representation ?presentPerfectThirdPersonSingular ;
wikibase:grammaticalFeature wd:Q625420, wd:Q51929074, wd:Q192613, wd:Q110786 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?firstPersonPluralPresentPerfectForm.
?firstPersonPluralPresentPerfectForm ontolex:representation ?firstPersonPluralPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q21714344 ,wd:Q192613 , wd:Q146786.
?lexeme ontolex:lexicalForm ?presentPerfectFirstPersonPluralForm .
?presentPerfectFirstPersonPluralForm ontolex:representation ?presentPerfectFirstPersonPlural ;
wikibase:grammaticalFeature wd:Q625420, wd:Q21714344, wd:Q192613, wd:Q146786 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?secondPersonPluralPresentPerfectForm.
?secondPersonPluralPresentPerfectForm ontolex:representation ?secondPersonPluralPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q51929049 ,wd:Q192613 , wd:Q146786.
?lexeme ontolex:lexicalForm ?presentPerfectSecondPersonPluralForm .
?presentPerfectSecondPersonPluralForm ontolex:representation ?presentPerfectSecondPersonPlural ;
wikibase:grammaticalFeature wd:Q625420, wd:Q51929049, wd:Q192613, wd:Q146786 .
}

OPTIONAL {
?lexeme ontolex:lexicalForm ?thirdPersonPluralPresentPerfectForm.
?thirdPersonPluralPresentPerfectForm ontolex:representation ?thirdPersonPluralPresentPerfect;
wikibase:grammaticalFeature wd:Q625420 , wd:Q51929074 ,wd:Q192613 , wd:Q146786.
?lexeme ontolex:lexicalForm ?presentPerfectThirdPersonPluralForm .
?presentPerfectThirdPersonPluralForm ontolex:representation ?presentPerfectThirdPersonPlural ;
wikibase:grammaticalFeature wd:Q625420, wd:Q51929074, wd:Q192613, wd:Q146786 .
}
}
Loading

0 comments on commit ca15554

Please sign in to comment.