On 29/10/13 09:27, Bardo Nelgen wrote:
Hello,

this time I'm asking for help with a (to me…) seemingly strange SPARQL
matching behavior:

When trying to match a statement using a language tag, something like

<cnt:versionedContent
rdf:about="http://resources.semaworx.eu/timed/version#versioncrediblyuniqueid001";>

<cnt:i18nslug xml:lang="en-us">home</cnt:i18nslug>
</cnt:versionedContent>

this works quite well with

?Version cnt:i18nslug "home"@en-us .

Though, now, when I target a broader match with

?Version cnt:i18nslug "home" .

(intending to match *any* ?Version having a cnt:i18nslug named "home",
regardless of the language/locale used) it unfortunately does *not*
match *any* of the respective statements.

So: Why does leaving away the language tag in the query obviously imply,
the result *must not* have one, rather than just ignoring the existing
one(s)?

Because in RDF there are "simple literals" - strings without a language tag at all. They are different to ones having a language tag.


And: How can this effect be avoided?

Test the lexical form:

{ ?Version cnt:i18nslug ?x .
  FILTER(str(?x) = "home")
}

See also langMatches for, say getting all the "en" ones.


As always, every hint is highly appreciated.

Greets,

Bardo



        Andy

Reply via email to