The filter by regex clause is ignored, FILTER(!REGEX(STR(?aLabel), "^Q[0-9]+$"))... How to use "filter by label?"
Real case
SELECT ?a ?aLabel ?lat ?long WHERE {
?a wdt:P31 wd:Q274393 . # bakery or scholl or etc.
?a p:P625 ?statement . # that has coordinate-location statement
?statement psv:P625 ?coordinate_node .
?coordinate_node wikibase:geoLatitude ?lat .
?coordinate_node wikibase:geoLongitude ?long .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]" .
}
#FILTER(!REGEX(STR(?aLabel), "^Q[0-9]+$")) # not working, no items !
#FILTER(!REGEX(STR(?a), "^Q[0-9]+$")) # not working, ignored !
}
ORDER BY (?aLabel) # need to eliminate ugly itens with no name
You can edit here.
PS: it is not the question, but another solution for the real-life problem, which is interesting to comment on, is a clause to check "no language labels" or "empty label".
?aLabelare magic vars that come from some special non-standard service, thus, happen after the query has been evaluated.FILTER EXISTS {?a rdfs:label ?someLabel filter(langmatches(lang(?someLabel), "en"))}[AUTO_LANGUAGE]that is the semantic of "any language"...filter( langmatches(lang(?someLabel), "[AUTO_LANGUAGE]") )AUTO_LANGUAGEis not "any", but seems that is working fine as "check something exists".