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

Keep in mind Wikidata's new way of modelling "former" objects #3357

Open
VojtechDostal opened this issue Jan 30, 2020 · 7 comments
Open

Keep in mind Wikidata's new way of modelling "former" objects #3357

VojtechDostal opened this issue Jan 30, 2020 · 7 comments

Comments

@VojtechDostal
Copy link
Collaborator

I just noticed today that Wikidata is slowly changing the way former (demolished or destroyed) objects are modelled. It seems that the instance (of) former entity (and its subclasses) is slowly replaced by a new property P5816 (state of conservation). See this change for example. This discussion seems to suggest it's a preferred new way for the community. We're not in hurry, this is still a minor way of modelling non-existence, but let's keep an eye on the development. Actually, if it is implemented 100% in Wikidata, the query for our app should be performing much quicker if based on P5816 rather than P31 and its subclasses.

@VojtechDostal
Copy link
Collaborator Author

This is now the predominant way of tracking demolished or destroyed objects in WD. As a result our query no longer works for most cases of these, at least in Czech Rep :-)

@misaochan
Copy link
Member

Thanks for letting us know @VojtechDostal ! Just to clarify, you are suggesting that we use P5816 to track which objects exist and which don't, rather than our current method?

@nicolas-raoul
Copy link
Member

@VojtechDostal Wonderful! Would you mind editing the query? :-) I suggest keeping both ways for now, until the former way becomes rare.

@VojtechDostal
Copy link
Collaborator Author

@VojtechDostal Wonderful! Would you mind editing the query? :-) I suggest keeping both ways for now, until the former way becomes rare.

I'd love to, but the mentioned query does not do the filtering based on existence/non-existence of objects. It's probably handled somewhere downstream in the app, and is based on ?class, but I am not sure where.

Interestingly, the app also retrieves P576 ("demolished date") - I have no idea if this is used somewhere in the app but IMO not. Maybe we could remove this to speed up the query a little bit. We could also remove P582 ("end time") - this is largely irrelevant for objects in the app.

@nicolas-raoul
Copy link
Member

Indeed existence is currently calculated in the app, but if that can be done in the SPARQL directly it would be better. A big OR might be enough?

@VojtechDostal
Copy link
Collaborator Author

VojtechDostal commented Aug 23, 2021

Unfortunately it seems I do not understand the app architecture enough to be able to edit the query appropriately.

You'll probably want something along these lines in the query:

OPTIONAL {
{?class wdt:279* wd:Q15893266 .} UNION {?class wdt:P5816 wd:Q56556915 .}
BIND((?state) as ?former) .
}

Anyway I think the query would profit from a thorough check by SPARQL experts, I think it could run a bit quicker if optimized.

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

No branches or pull requests

3 participants