Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wikidata SPARQL Property Paths: asterisk and plus - wdt:P40+ vs wdt:P40/wdt:P40*

It seems that wdt:P40+ is not exactly the same as wdt:P40/wdt:P40*.

Example:

SELECT ?ancetre ?ancetreLabel
WHERE
{
  ?ancetre wdt:P40+ wd:Q346
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}

It returns 852 results. (10 June 2019)

SELECT ?ancetre ?ancetreLabel
WHERE
{
  ?ancetre wdt:P40/wdt:P40* wd:Q346
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}

The last returns 1046 results. (10 June 2019, same date as above)

I would expects the same results for both queries

Could someone explains this ?

like image 309
jlguenego Avatar asked Oct 25 '25 18:10

jlguenego


1 Answers

I think I have found an explanation: wdt:P40/wdt:P40* can get more result because of duplicate. So if we replace SELECT with SELECT DISTINCT, there is no more difference between the queries.

like image 119
jlguenego Avatar answered Oct 29 '25 19:10

jlguenego