You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following query is supposed to return all fountains in Zurich, including the WVZ catalog code, when available. However, some fountains also have another catalog code, from the "Kunst im Stadtraum" catalog.
In these cases, the query returns two lines of data.
How can we get the query to only return the catalog information for a fountain if the corresponding catalog is Q53629101?
Here is the query:
SELECT ?place ?placeLabel ?location ?date ?catalog_code ?catalogLabel ?operator
WHERE
{
# Enter coordinates
SERVICE wikibase:box {
?place wdt:P625 ?location .
bd:serviceParam wikibase:cornerWest "Point(8.45960259979614 47.3229261255644)"^^geo:wktLiteral.
bd:serviceParam wikibase:cornerEast "Point(8.61940272745742 47.431119712250506)"^^geo:wktLiteral.
} .
# Is a water well or fountain or subclass of fountain
FILTER (EXISTS { ?place wdt:P31/wdt:P279* wd:Q43483 } || EXISTS { ?place wdt:P31/wdt:P279* wd:Q483453 }).
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de" .
}
OPTIONAL { ?place p:P528 ?catalog_code.
?catalog_code pq:P972 ?catalog.}
OPTIONAL { ?place wdt:P571 ?date.}
OPTIONAL { ?place wdt:P137 ?operator.}
}
The text was updated successfully, but these errors were encountered:
SELECT ?place ?placeLabel ?location ?date ?catalog_code_st ?catalogue_code ?operator
WHERE
{
# Enter coordinates
SERVICE wikibase:box {
?place wdt:P625 ?location .
bd:serviceParam wikibase:cornerWest "Point(8.45960259979614 47.3229261255644)"^^geo:wktLiteral.
bd:serviceParam wikibase:cornerEast "Point(8.61940272745742 47.431119712250506)"^^geo:wktLiteral.
} .
# Is a water well or fountain or subclass of fountain
FILTER (EXISTS { ?place wdt:P31/wdt:P279* wd:Q43483 } || EXISTS { ?place wdt:P31/wdt:P279* wd:Q483453 }).
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de" .
}
?place p:P528 ?catalog_code_st.
?catalog_code_st pq:P972 wd:Q53629101.
?catalog_code_st ps:P528 ?catalogue_code.
#?catalog_code_st ps:P528 ?catalog_code.
OPTIONAL { ?place wdt:P571 ?date.}
OPTIONAL { ?place wdt:P137 ?operator.}
}
I see that the results (https://tinyurl.com/ya2jsxae) include sometimes two values for catalogue_code, but I checked the item description and indeed there are two values coming from the FountainsWVZ catalogue. For example, in this item: https://www.wikidata.org/wiki/Q55166163
Thanks for that. Since we also need fountains with no catalog code, would you then suggest doing a union of two queries: one for all fountains with WVZ code and one for fountains with no WVZ code?
The following query is supposed to return all fountains in Zurich, including the WVZ catalog code, when available. However, some fountains also have another catalog code, from the "Kunst im Stadtraum" catalog.
In these cases, the query returns two lines of data.
How can we get the query to only return the catalog information for a fountain if the corresponding catalog is
Q53629101
?Here is the query:
The text was updated successfully, but these errors were encountered: