Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Dear Mr., I thank you for your answer. This is absolutely useful. Yours Sincerely, Houcemeddine Turki
________________________________________ De : Wikidata wikidata-bounces@lists.wikimedia.org de la part de Mbch331 mbch331.wikipedia@gmail.com Envoyé : dimanche 4 mars 2018 15:10:14 À : Discussion list for the Wikidata project. Objet : Re: [Wikidata] How to eliminate items not having a label in a particular language from the Wikidata query results
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.orgmailto:Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Ups, I replied to Houcemeddine Turki with practically the same answer that Mbch331. Excuse me, I didn't check it.
Regards, Iván
On 04/03/18 14:10, Mbch331 wrote:
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Hi Iván,
You provided an explanation, where I only gave the updated query. There's one difference between our queries: I removed the service line because that doesn't add anything in this case. Since you only use it to fetch the label and you're already doing that with rdfs:label.
If you needed labels for other claims or needed descriptions, than the adding the service line would still be useful.
Mbch331
Op 4-3-2018 om 22:33 schreef Iván Hernández Cazorla:
Ups, I replied to Houcemeddine Turki with practically the same answer that Mbch331. Excuse me, I didn't check it.
Regards, Iván
On 04/03/18 14:10, Mbch331 wrote:
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Hi Mbch331, Excuse me the delay answering, but sometimes there is many incoming messages in this mailing list and with the another ones, sometimes I feel like in a boat in torment (of messages, of course hehe).
Thanks for your comment about my message and thank you for your note about the unnecessary use of the service lines when there is a rdfs:label. I note it in my SPARQL notebook, there are many things I have to learn yet.
Regards, Iván
On 05/03/18 18:44, Mbch331 wrote:
Hi Iván,
You provided an explanation, where I only gave the updated query. There's one difference between our queries: I removed the service line because that doesn't add anything in this case. Since you only use it to fetch the label and you're already doing that with rdfs:label.
If you needed labels for other claims or needed descriptions, than the adding the service line would still be useful.
Mbch331
Op 4-3-2018 om 22:33 schreef Iván Hernández Cazorla:
Ups, I replied to Houcemeddine Turki with practically the same answer that Mbch331. Excuse me, I didn't check it.
Regards, Iván
On 04/03/18 14:10, Mbch331 wrote:
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Hi Iván,
I need to learn a lot too about SPARQL. The best way to learn is by doing it. And if you don't succeed, Google it or ask for others to help.
Mbch331
Op 12-3-2018 om 19:23 schreef Iván Hernández Cazorla:
Hi Mbch331, Excuse me the delay answering, but sometimes there is many incoming messages in this mailing list and with the another ones, sometimes I feel like in a boat in torment (of messages, of course hehe).
Thanks for your comment about my message and thank you for your note about the unnecessary use of the service lines when there is a rdfs:label. I note it in my SPARQL notebook, there are many things I have to learn yet.
Regards, Iván
On 05/03/18 18:44, Mbch331 wrote:
Hi Iván,
You provided an explanation, where I only gave the updated query. There's one difference between our queries: I removed the service line because that doesn't add anything in this case. Since you only use it to fetch the label and you're already doing that with rdfs:label.
If you needed labels for other claims or needed descriptions, than the adding the service line would still be useful.
Mbch331
Op 4-3-2018 om 22:33 schreef Iván Hernández Cazorla:
Ups, I replied to Houcemeddine Turki with practically the same answer that Mbch331. Excuse me, I didn't check it.
Regards, Iván
On 04/03/18 14:10, Mbch331 wrote:
This should do the trick:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain rdfs:label ?_tre_humainLabel . ?_tre_humain wdt:P31 wd:Q34770. FILTER (lang(?_tre_humainLabel)="aeb-arab") }
Mbch331
Op 4-3-2018 om 14:57 schreef abdelwaheb turki:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Hi Houcemeddine Turki, What you have to do is filter the results to show only the items with a label in Tunisian. I modified your query with the filter, check it:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain wdt:P31 wd:Q34770. ?_tre_humain rdfs:label ?itemLabelAebArab .
FILTER(lang(?itemLabelAebArab) = "aeb-arab")
SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } }
You can test it [0]. To explain the query now, what I added is:
?_tre_humain rdfs:label ?itemLabelAebArab .
FILTER(lang(?itemLabelAebArab)="aeb-arab")
The first line query the label with the ?itemLabelAebArab object and the second filter the language. Note that the object (?itemLabelAebArab) must to be in the filter.
I hope it helps you.
Regards, Iván
[0]: http://tinyurl.com/y7vhsncy
On 04/03/18 13:57, abdelwaheb turki wrote:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Dear Mr., I thank you for your answer. This is absolutely helpful. Yours Sincerely, Houcemeddine Turki
________________________________________ De : Wikidata wikidata-bounces@lists.wikimedia.org de la part de Iván Hernández Cazorla ivanhercaz@gmail.com Envoyé : dimanche 4 mars 2018 22:29:20 À : wikidata@lists.wikimedia.org Objet : Re: [Wikidata] How to eliminate items not having a label in a particular language from the Wikidata query results
Hi Houcemeddine Turki, What you have to do is filter the results to show only the items with a label in Tunisian. I modified your query with the filter, check it:
SELECT ?_tre_humain ?_tre_humainLabel WHERE { ?_tre_humain wdt:P31 wd:Q34770. ?_tre_humain rdfs:label ?itemLabelAebArab .
FILTER(lang(?itemLabelAebArab) = "aeb-arab")
SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } }
You can test it [0]. To explain the query now, what I added is:
?_tre_humain rdfs:label ?itemLabelAebArab .
FILTER(lang(?itemLabelAebArab)="aeb-arab")
The first line query the label with the ?itemLabelAebArab object and the second filter the language. Note that the object (?itemLabelAebArab) must to be in the filter.
I hope it helps you.
Regards, Iván
[0]: http://tinyurl.com/y7vhsncy
On 04/03/18 13:57, abdelwaheb turki wrote:
Dear Mr. or Ms., I thank you for your efforts. I have written the following query to find the languages that have a label in Tunisian in Wikidata: SELECT ?_tre_humain ?_tre_humainLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "aeb-arab". } ?_tre_humain wdt:P31 wd:Q34770. } However, I found that many languages not having a label in Tunisian are sorted as well. For these languages, the featured label is the Wikidata ID of the language. I ask about how to eliminate these languages from the results of my wikidata query. Yours Sincerely, Houcemeddine Turki _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
-- Iván Hernández Cazorla Miembro de Wikimedia España
_______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata