Made changes to the query

This commit is contained in:
Kanahia 2024-05-15 21:11:56 +05:30
parent 8be9deb5d0
commit 3e9c3a6dae
3 changed files with 4 additions and 22 deletions

View file

@ -1,6 +1,7 @@
SELECT SELECT
?item ?item
(SAMPLE(?label) AS ?label) (SAMPLE(?label) AS ?label)
(SAMPLE(?class) AS ?class)
(SAMPLE(?description) AS ?description) (SAMPLE(?description) AS ?description)
(SAMPLE(?classLabel) AS ?classLabel) (SAMPLE(?classLabel) AS ?classLabel)
(SAMPLE(?pic) AS ?pic) (SAMPLE(?pic) AS ?pic)
@ -34,6 +35,9 @@ WHERE {
BIND(COALESCE(?classLabelPreferredLanguage, ?classLabelAnyLanguage, "?") as ?classLabel) BIND(COALESCE(?classLabelPreferredLanguage, ?classLabelAnyLanguage, "?") as ?classLabel)
} }
OPTIONAL {
?item p:P31/ps:P31 ?class.
}
# Get picture # Get picture
OPTIONAL {?item wdt:P18 ?pic} OPTIONAL {?item wdt:P18 ?pic}

View file

@ -1,9 +1,6 @@
SELECT SELECT
?item ?item
(SAMPLE(?location) as ?location) (SAMPLE(?location) as ?location)
(SAMPLE(?class) AS ?class)
(SAMPLE(?destroyed) AS ?destroyed)
(SAMPLE(?endTime) AS ?endTime)
WHERE { WHERE {
# Around given location # Around given location
SERVICE wikibase:box { SERVICE wikibase:box {
@ -12,13 +9,5 @@ WHERE {
bd:serviceParam wikibase:cornerEast "Point(${LONG_EAST} ${LAT_EAST})"^^geo:wktLiteral. bd:serviceParam wikibase:cornerEast "Point(${LONG_EAST} ${LAT_EAST})"^^geo:wktLiteral.
} }
OPTIONAL {
?item p:P31/ps:P31 ?class.
}
# Get existence
OPTIONAL {?item wdt:P576 ?destroyed}
OPTIONAL {?item wdt:P582 ?endTime}
} }
GROUP BY ?item GROUP BY ?item

View file

@ -1,9 +1,6 @@
SELECT SELECT
?item ?item
(SAMPLE(?location) as ?location) (SAMPLE(?location) as ?location)
(SAMPLE(?class) AS ?class)
(SAMPLE(?destroyed) AS ?destroyed)
(SAMPLE(?endTime) AS ?endTime)
(SAMPLE(?monument) AS ?monument) (SAMPLE(?monument) AS ?monument)
WHERE { WHERE {
# Around given location # Around given location
@ -13,14 +10,6 @@ WHERE {
bd:serviceParam wikibase:cornerEast "Point(${LONG_EAST} ${LAT_EAST})"^^geo:wktLiteral. bd:serviceParam wikibase:cornerEast "Point(${LONG_EAST} ${LAT_EAST})"^^geo:wktLiteral.
} }
OPTIONAL {
?item p:P31/ps:P31 ?class.
}
# Get existence
OPTIONAL {?item wdt:P576 ?destroyed}
OPTIONAL {?item wdt:P582 ?endTime}
# Wiki Loves Monuments # Wiki Loves Monuments
OPTIONAL {?item p:P1435 ?monument} OPTIONAL {?item p:P1435 ?monument}
OPTIONAL {?item p:P2186 ?monument} OPTIONAL {?item p:P2186 ?monument}