-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to use Turtle-like syntax for language filtering #17
Comments
Could be related to #13 |
Previous workWikidata has a special service that returns a single label and/or description per result entity, using a list of languages, with fallback: select ?x ?xLabel ?xDescription {
?x foo bar.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en,it". }
} If my user lang is
|
In SPARQL 1.1, variable names may not contain One could imagine Something like |
I think my initial point was really really a point of pure syntactic sugar, to mimic Turtle syntax and have a easier learning curve for SPARQL beginners to whom we have teached Turtle already. So:
I want the same behavior as langMatches()
It should skip that result if there is no prefLabel in fr. I wan the same behavior as when using a FILTER with langMatches().
I like that idea. |
A fallback would pick one value. This is what optional {?x skos:prefLabel ?label_fr_CA@fr-CA}
optional {?x skos:prefLabel ?label_fr@fr}
bind(coalesce(?label_fr_CA,?label_fr) as ?label) with the inefficiency that all wanted languages are fetched, not just the first one matching. |
In case preference order in language tags is desired, would a similar syntax as in the |
this is definitely intertwined with #13 a practial remark though: |
I did not ask for a fallback mechanism; this is, as you wrote, what #13 asks for, and this is a difference with this issue. The 2 issues are related, but not the same (but it could turn out they are solved by some simultaneously). Again, this issue here is really syntactic : I want the same syntax than Turtle for language filtering. |
Why ?
Currently if I want to filter a literal based on its language, I need to write:
or, if I am lazy (which happens often) :
This is tedious for a common use-case.
How could it look like ?
I'd like to be able to use Turtle-like syntax for language filtering:
Considerations for backward-compatibility
This would make the
@
character a special character in variable names.The text was updated successfully, but these errors were encountered: