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

Extract Lexeme IDs in SPARQL Queries for Language Totals #110

Merged
merged 7 commits into from
Mar 20, 2024
Merged
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
@@ -1,8 +1,11 @@
# All Arabic (Q13955) nouns.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?lexeme ?noun WHERE {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewtavis just one thing, here I am suppose to make change, isnt it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that'd be great, @mhmohona :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the changes I made, are they sufficient?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be find, @mhmohona :) I'll go through and do the review and add in the line for you 😊

SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?noun

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Arabic (Q13955) verbs.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?verb WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?verb

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q13955 ;
wikibase:lexicalCategory wd:Q24905 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# All Basque (Q8752) nouns.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?noun WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?noun

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Basque (Q8752) verbs.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?verb WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?verb

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q8752 ;
wikibase:lexicalCategory wd:Q24905 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# All Bengali (Q9610) nouns.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?lexeme ?noun WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?noun

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Bengali (Q9610) verbs.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?verb WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?verb

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9610 ;
wikibase:lexicalCategory wd:Q24905 ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
# Enter this query at https://query.wikidata.org/.
# Note that this query is for Bokmål (Q25167) rather than Nynorsk (Q25164).

SELECT DISTINCT ?singular ?plural ?gender WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
?gender

WHERE {

# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# Enter this query at https://query.wikidata.org/.
# Note that this query is for Bokmål (Q25167) rather than Nynorsk (Q25164).

SELECT ?lexeme ?infinitive WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q25167 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# All Czeck (Q9056) nouns, their plural and their gender.
# All Czeck (Q9056) nouns, their plural, and their gender.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural ?gender WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
?gender

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All Czech (Q9056) prepositions and their corresponding cases.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?preposition ?case WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?preposition
?case

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9056 ;
wikibase:lexicalCategory wd:Q4833830 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Czech (Q9056) verbs and the currently implemented tenses for each.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?infinitive WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9056 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# All Danish (Q9035) nouns, their plural and their gender.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural ?gender WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
?gender

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Danish (Q9035) verbs and the currently implemented tenses for each.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?infinitive WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9035 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All English (Q1860) nouns and their plural.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# All English (Q1860) verbs and the currently implemented tenses for each.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?infinitive ?presFPS ?presTPS ?simpPast ?pastPart WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive
?presFPS
?presTPS
?simpPast
?pastPart

WHERE {
# Infinitive (required)
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q1860 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All Esperanto (Q143) nouns.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Esperanto (Q143) verbs.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?verb WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?verb

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q143 ;
wikibase:lexicalCategory wd:Q24905 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All Estonian (Q9072) nouns and their plural.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
# Enter this query at https://query.wikidata.org/.
# Note that this query includes postpositions that are also used in Estonian.

SELECT ?lexeme ?preposition ?case WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?preposition
?case

WHERE {
# Prepositions and postpositions.
VALUES ?PrePostPositions { wd:Q4833830 wd:Q161873 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Estonian (Q9072) verbs and the currently implemented tenses for each.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?infinitive WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q9072 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All Finnish (Q1412) nouns and their plural.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?lexeme ?singular ?plural WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# All Finnish (Q1412) verbs.
# Enter this query at https://query.wikidata.org/.

SELECT ?lexeme ?verb WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?verb

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q1412 ;
wikibase:lexicalCategory wd:Q24905 ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# All French (Q150) nouns, their plural and their gender.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural ?gender WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
?gender

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive
?presFPS ?presSPS ?presTPS
?presFPP ?presSPP ?presTPP
?pretFPS ?pretSPS ?pretTPS
?pretFPP ?pretSPP ?pretTPP WHERE {
?pretFPP ?pretSPP ?pretTPP

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q150 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# Enter this query at https://query.wikidata.org/.

SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive
?impFPS ?impSPS ?impTPS
?impFPP ?impSPP ?impTPP
?futFPS ?futSPS ?futTPS
?futFPP ?futSPP ?futTPP WHERE {
?futFPP ?futSPP ?futTPP

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q150 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# All German (Q188) nouns, their plural and their gender.
# Enter this query at https://query.wikidata.org/.

SELECT DISTINCT ?singular ?plural ?gender WHERE {
SELECT DISTINCT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?singular
?plural
?gender

WHERE {
# Nouns and pronouns.
VALUES ?nounTypes { wd:Q1084 wd:Q147276 }
?lexeme a ontolex:LexicalEntry ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# All German (Q188) prepositions and their corresponding cases.
# Enter this query at https://query.wikidata.org/.

SELECT ?preposition ?case WHERE {
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?preposition
?case

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q188 ;
wikibase:lexicalCategory wd:Q4833830 ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

# Not SELECT DISTINCT as we want to get verbs with both sein and haben as auxiliaries
SELECT
(REPLACE(STR(?lexeme), "http://www.wikidata.org/entity/", "") as ?lexemeID)
?infinitive
?presFPS ?presSPS ?presTPS
?presFPP ?presSPP ?presTPP WHERE {
?presFPP ?presSPP ?presTPP

WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q188 ;
wikibase:lexicalCategory wd:Q24905 .
Expand Down
Loading
Loading