mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Exclude past locations (P585) from Nearby query (#6284)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
This commit is contained in:
parent
5b5aeead88
commit
69b3544107
3 changed files with 7 additions and 1 deletions
|
|
@ -154,7 +154,8 @@ public class Place implements Parcelable {
|
||||||
item.getPic().getValue(),
|
item.getPic().getValue(),
|
||||||
// Checking if the place exists or not
|
// Checking if the place exists or not
|
||||||
(item.getDestroyed().getValue() == "") && (item.getEndTime().getValue() == "")
|
(item.getDestroyed().getValue() == "") && (item.getEndTime().getValue() == "")
|
||||||
&& (item.getDateOfOfficialClosure().getValue() == ""),
|
&& (item.getDateOfOfficialClosure().getValue() == "")
|
||||||
|
&& (item.getPointInTime().getValue()==""),
|
||||||
entityId);
|
entityId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class NearbyResultItem(
|
||||||
@field:SerializedName("endTime") private val endTime: ResultTuple?,
|
@field:SerializedName("endTime") private val endTime: ResultTuple?,
|
||||||
@field:SerializedName("monument") private val monument: ResultTuple?,
|
@field:SerializedName("monument") private val monument: ResultTuple?,
|
||||||
@field:SerializedName("dateOfOfficialClosure") private val dateOfOfficialClosure: ResultTuple?,
|
@field:SerializedName("dateOfOfficialClosure") private val dateOfOfficialClosure: ResultTuple?,
|
||||||
|
@field:SerializedName("pointInTime") private val pointInTime: ResultTuple?,
|
||||||
) {
|
) {
|
||||||
fun getItem(): ResultTuple = item ?: ResultTuple()
|
fun getItem(): ResultTuple = item ?: ResultTuple()
|
||||||
|
|
||||||
|
|
@ -52,4 +53,6 @@ class NearbyResultItem(
|
||||||
|
|
||||||
fun getMonument(): ResultTuple? = monument
|
fun getMonument(): ResultTuple? = monument
|
||||||
|
|
||||||
|
fun getPointInTime(): ResultTuple = pointInTime ?: ResultTuple()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ SELECT
|
||||||
(SAMPLE(?commonsArticle) AS ?commonsArticle)
|
(SAMPLE(?commonsArticle) AS ?commonsArticle)
|
||||||
(SAMPLE(?commonsCategory) AS ?commonsCategory)
|
(SAMPLE(?commonsCategory) AS ?commonsCategory)
|
||||||
(SAMPLE(?dateOfOfficialClosure) AS ?dateOfOfficialClosure)
|
(SAMPLE(?dateOfOfficialClosure) AS ?dateOfOfficialClosure)
|
||||||
|
(SAMPLE(?pointInTime) AS ?pointInTime)
|
||||||
WHERE {
|
WHERE {
|
||||||
SERVICE <https://query.wikidata.org/sparql> {
|
SERVICE <https://query.wikidata.org/sparql> {
|
||||||
values ?item {
|
values ?item {
|
||||||
|
|
@ -47,6 +48,7 @@ WHERE {
|
||||||
OPTIONAL {?item wdt:P576 ?destroyed}
|
OPTIONAL {?item wdt:P576 ?destroyed}
|
||||||
OPTIONAL {?item wdt:P582 ?endTime}
|
OPTIONAL {?item wdt:P582 ?endTime}
|
||||||
OPTIONAL {?item wdt:P3999 ?dateOfOfficialClosure}
|
OPTIONAL {?item wdt:P3999 ?dateOfOfficialClosure}
|
||||||
|
OPTIONAL {?item wdt:P585 ?pointInTime}
|
||||||
|
|
||||||
# Get Commons category
|
# Get Commons category
|
||||||
OPTIONAL {?item wdt:P373 ?commonsCategory}
|
OPTIONAL {?item wdt:P373 ?commonsCategory}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue