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

Missing URL formatter #3

Closed
laBecasse opened this issue Aug 18, 2020 · 2 comments
Closed

Missing URL formatter #3

laBecasse opened this issue Aug 18, 2020 · 2 comments

Comments

@laBecasse
Copy link

Hello,
Thank you a lot for your project, it gives me many ideas.

I discovered that the person ID for France Culture (wd:P5301) is not working in Entity Explosion. By exploring the code, it turns out that the query:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?prop ?regex ?formatter_url WHERE {
{?prop wdt:P1630 ?formatter_url .}
UNION
{?prop wdt:P3303 ?formatter_url .}
FILTER (CONTAINS( ?formatter_url, "$1" ) )
?prop wdt:P1793 ?regex .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}

does not return the entity wd:P5301, since it has no regex defined using the property wdt:P1793. But it has a regex defined by the path ?prop <http://www.wikidata.org/prop/P2302> ?o. ?o <http://www.wikidata.org/prop/qualifier/P1793> ?regex. and reformulating the above query as:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?prop ?regex ?formatter_url WHERE {
{?prop wdt:P1630 ?formatter_url .}
UNION
{?prop wdt:P3303 ?formatter_url .}
FILTER (CONTAINS( ?formatter_url, "$1" ) )
?prop <http://www.wikidata.org/prop/P2302> ?o.
?o <http://www.wikidata.org/prop/qualifier/P1793> ?regex.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}

allows to obtained wd:P5301 in the answer set. It also returns more answers: 5660 against 4428 with the previous query. The answers may be different anyway.

What do you think of changing the first query by the second one ?

@99of9
Copy link
Owner

99of9 commented Aug 25, 2020

You're welcome, I'm glad you like it. I hope you'll tell us all your good ideas!

Yes, your SPARQL is an improvement thanks. Maybe the broadest way to catch it is to do the union of the two.

@99of9
Copy link
Owner

99of9 commented Aug 25, 2020

I've implemented it, and it will be in the next release.

@99of9 99of9 closed this as completed Aug 25, 2020
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