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

Viewed 93

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 ?

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.

Related