Item https://www.wikidata.org/wiki/Q17183050 (Beer Lane) has a P582 (end time) property:

Despite that, it is shown by the app as existing:

Latest master
Its pin should be black, and it should not be shown when the "Existing" checkbox is checked. Example of how it should look (item):

@nicolas-raoul can I work on this issue ...and also can you please tell me what is or how can I see endtime?
@Anu-123-gif yes thanks!
At https://www.wikidata.org/wiki/Q17183050 you can see the end time section.
A first step is to replace the content of app/src/main/resources/queries/nearby_query.rq with this:
SELECT
(SAMPLE(?location) as ?location)
?item
(SAMPLE(COALESCE(?itemLabelPreferredLanguage, ?itemLabelAnyLanguage)) as ?label)
(SAMPLE(?classId) as ?class)
(SAMPLE(COALESCE(?classLabelPreferredLanguage, ?classLabelAnyLanguage, "?")) as ?classLabel)
(SAMPLE(COALESCE(?icon0, ?icon1)) as ?icon)
?wikipediaArticle
?commonsArticle
(SAMPLE(?commonsCategory) as ?commonsCategory)
(SAMPLE(?pic) as ?pic)
(SAMPLE(?destroyed) as ?destroyed)
(SAMPLE(?endTime) as ?endTime)
WHERE {
# Around given location...
SERVICE wikibase:around {
?item wdt:P625 ?location.
bd:serviceParam wikibase:center "Point(${LONG} ${LAT})"^^geo:wktLiteral.
bd:serviceParam wikibase:radius "${RAD}" . # Radius in kilometers.
}
# Get the label in the preferred language of the user, or any other language if no label is available in that language.
OPTIONAL {?item rdfs:label ?itemLabelPreferredLanguage. FILTER (lang(?itemLabelPreferredLanguage) = "${LANG}")}
OPTIONAL {?item rdfs:label ?itemLabelAnyLanguage}
# Get Commons category (P373)
OPTIONAL { ?item wdt:P373 ?commonsCategory. }
# Get (P18)
OPTIONAL { ?item wdt:P18 ?pic. }
# Get (P576)
OPTIONAL { ?item wdt:P576 ?destroyed. }
# Get (P582)
OPTIONAL { ?item wdt:P582 ?endTime. }
# Get the class label in the preferred language of the user, or any other language if no label is available in that language.
OPTIONAL {
?item p:P31/ps:P31 ?classId.
OPTIONAL {?classId rdfs:label ?classLabelPreferredLanguage. FILTER (lang(?classLabelPreferredLanguage) = "${LANG}")}
OPTIONAL {?classId rdfs:label ?classLabelAnyLanguage}
OPTIONAL {
?wikipediaArticle schema:about ?item ;
schema:isPartOf <https://${LANG}.wikipedia.org/> .
}
OPTIONAL {
?wikipediaArticle schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/> .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
OPTIONAL {
?commonsArticle schema:about ?item ;
schema:isPartOf <https://commons.wikimedia.org/> .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
}
}
GROUP BY ?item ?wikipediaArticle ?commonsArticle
Then in app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java and app/src/main/java/fr/free/nrw/commons/nearby/NearbyController.java treat endTime the same as destroyed (maybe using some factorization).
You will also need to modify app/src/main/java/fr/free/nrw/commons/nearby/Place.java app/src/main/java/fr/free/nrw/commons/nearby/model/NearbyResultItem.kt maybe a few others.
Thanks!
Thank you for giving me a start !
Actually the app is only interested in one thing: whether the place exists or not.
So rather than carrying around both destroyed and endTime, please carry around a boolean that you can call exists.
I believe the best is to do that in app/src/main/java/fr/free/nrw/commons/nearby/Place.java, replace public final String destroyed; with public final boolean exists; and modify the constructors to do this.exists = (destroyedString == null) && (endTime == null).
If anything is unclear please do not hesitate to ask, thanks!
I had a few doubts :
How should I initialize endTime in app/src/main/java/fr/free/nrw/commons/nearby/Place.java?
After replacing public final String destroyed; with public final boolean exists;
I will have to remove destroyed from constructor calls as well. Should I replace it with exists everywhere?
I think I should replace the condition to check whether place is destroyed with exists == true. Is my understanding correct?
destroyed is read from the database.
Your first task is to similarly read the end time from the database :-)
My advice would be to first study how destroyed is read, study the SPARQL network response and the various classes that the information comes through.
Hi! @Anu-123-gif, Are you still working on it, if not I would love to work on this one. Thanks!
Hi! I've been working on this issue but I still can't get it right. Maybe you'll have better luck!
Go ahead ,thanks!
@Anu-123-gif Sorry to hear that, please feel free to take another issue, and also do not hesitate to ask any question :-)
Also, feel free to share with Pratham what you tried, interesting things you found about the issue, etc. Cheers!