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

Nameservice hides some results #403

Open
graue70 opened this issue May 14, 2021 · 3 comments
Open

Nameservice hides some results #403

graue70 opened this issue May 14, 2021 · 3 comments

Comments

@graue70
Copy link
Contributor

graue70 commented May 14, 2021

When ticking the checkbox 'Automatically add names to result', the following query yields 37 results:

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?0 WHERE {
  ?0 wdt:P136 wd:Q11424 .
} LIMIT 300

If I untick the checkbox and run it again, it yields 105 results instead.

These are the respective API requests:

https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX%20wd:%20%3Chttp://www.wikidata.org/entity/%3E%20PREFIX%20wdt:%20%3Chttp://www.wikidata.org/prop/direct/%3E%20SELECT%20DISTINCT%20?0%20WHERE%20{%20?0%20wdt:P136%20wd:Q11424%20.%20}%20LIMIT%20300&name_service=true&send=40
https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX%20wd:%20%3Chttp://www.wikidata.org/entity/%3E%20PREFIX%20wdt:%20%3Chttp://www.wikidata.org/prop/direct/%3E%20SELECT%20DISTINCT%20?0%20WHERE%20{%20?0%20wdt:P136%20wd:Q11424%20.%20}%20LIMIT%20300&name_service=false&send=40

I expect a name service to add names to entities that have one, but not to hide results that don't have a label.

The generated query is probably missing an 'OPTIONAL'.

@hannahbast
Copy link
Member

You are absolutely right.

It currently does not have an optional for efficiency reasons and because the OPTIONAL is not yet 100% correct. This will hopefully change soon.

Do you need this for anything or is this just something that occurred to you?

@graue70
Copy link
Contributor Author

graue70 commented May 14, 2021

Do you need this for anything or is this just something that occurred to you?

Not needed. Just unexpected behavior.

@graue70
Copy link
Contributor Author

graue70 commented Jun 8, 2021

The problem occurs more often than I thought. Check the following example:

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?wife ?child WHERE {
  wd:Q35332 wdt:P26 ?wife .
  OPTIONAL { ?wife wdt:P40 ?child }
}

The API request yields only two results:

https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX wd: <http://www.wikidata.org/entity/> SELECT ?wife ?child WHERE { wd:Q35332 wdt:P26 ?wife . OPTIONAL { ?wife wdt:P40 ?child } } &name_service=true&send=40

However, the same request without name_service yields three results:

https://qlever.informatik.uni-freiburg.de/api/wikidata-proxy?query=PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX wd: <http://www.wikidata.org/entity/> SELECT ?wife ?child WHERE { wd:Q35332 wdt:P26 ?wife . OPTIONAL { ?wife wdt:P40 ?child } } &name_service=false&send=40

Other than in the first example, this happens even though there is a label for the result that is hidden by the name_service (Q32522 in this case).

Apparently the name_service doesn't let results with any NULL cells pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants