W3C home > Mailing lists > Public > public-sparql-dev@w3.org > April to June 2010

Re: Using CONSTRUCT to add language tag?

From: Richard Cyganiak <richard@cyganiak.de>
Date: Mon, 24 May 2010 11:10:49 +0100
Cc: Lee Feigenbaum <lee@thefigtrees.net>, Bob DuCharme <bob@snee.com>, public-sparql-dev@w3.org
Message-Id: <701AA2BB-4F3B-4C8C-A4D9-E731118DB413@cyganiak.de>
To: Andy Seaborne <andy.seaborne@talis.com>

On 24 May 2010, at 08:27, Andy Seaborne wrote:
> SPARQL 1.1 does introduce some constructors for RDF terms: one of  
> them is STRLANG to make a string with language tag:
>
> STRLANG("abc","en") -> "abc"@en

Awesome!

Best,
Richard



>
> 	Andy
>
> On 23/05/2010 11:40 PM, Lee Feigenbaum wrote:
>> In SPARQL 1.1 you'll be able to do this with a subquery, though  
>> it's not
>> as succinct:
>>
>> PREFIX anrecs: <http://www.snee.com/ns/analystRatings#>
>> PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
>> CONSTRUCT {
>> ?company anrecs:company ?coNameWithLanguageTag .
>> }
>> WHERE {
>> {
>> SELECT (fn:concat(?coName,"@en") AS ?coNameWithLanguageTag) WHERE {
>> ?company anrecs:company ?coName .
>> }
>> }
>>
>> (fn:concat is not currently defined by SPARQL -- I expect a
>> concatenation function like this will be defined and (as in this
>> example) imported from XPath.)
>>
>> Lee
>>
>> On 5/23/2010 6:11 PM, Bob DuCharme wrote:
>>> Does anyone have any suggestions about how a SPARQL CONSTRUCT query
>>> might add language tags without using extensions? The query below  
>>> works
>>> with ARQ, but it uses the Jena extension LET and the concat()  
>>> function:
>>>
>>> PREFIX anrecs: <http://www.snee.com/ns/analystRatings#>
>>> PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
>>> CONSTRUCT {
>>> ?company anrecs:company ?coNameWithLanguageTag .
>>> }
>>> WHERE {
>>> ?company anrecs:company ?coName .
>>> LET (?coNameWithLanguageTag := fn:concat(?coName,"@en")) .
>>> }
>>>
>>> thanks,
>>>
>>> Bob
>>>
>>>
>>
>
Received on Monday, 24 May 2010 10:11:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:50 UTC