Feature:Language literal constructor

From SPARQL Working Group
Jump to: navigation, search

[ [ Category:Features ] ]

Feature: Language literal constructor

An operator, such as X@Y, should return a literal whose string value is equal to string value of X and lauguage tag is equal to string value of Y.

Feature description

If CONSTRUCT supports expressions in construction patterns then it should be possible to create literals of all sorts. X@Y can be convenient in FILTERs as well, but FILTER (SAMETERM(X@Y,Z)) can be replaced with FILTER (isLITERAL (Z) and (STR(X)=STR(Y)) and (LANG(X)=LANG(Y)) whereas CONSTRUCT makes the feature next to unavoidable.


  ?component <gui-menu-item>
      `bif:concat (?local-title, " (", ?local-brief-description, ")") @ LANG(?local-title))`
  } ...

Existing Implementation(s)

Virtuoso will support that as soon as syntax of the feature is confirmed by a draft of the spec.

Existing Specification / Documentation

List any existing text that attempts a formal definition of this extension. This could be a draft specification, API or syntax documentation, etc.


In order to ensure the compatibility, the @ operator should have the priority one less than unary minus, so -5@"en" and - (space) 5 @ "en" should both result in "-5"@en, not a value in former and unary minus operator applied to "5"@en in the latter case.

For biggest possible compatibility, a new built-in function can be introduced, not an operator. Nevertheless, there should be something.

Links to postponed Issues

Has this extension/use case some history in the group already? I.e. are there posponed issues or archived mail-threads related to this originating from DAWG?

Related Features


Use cases

A description of one or more use cases, the solution of which requires this feature. Multiple use cases can be added to each feature.