You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Stephan Zednik <ze...@rpi.edu> on 2012/12/15 08:18:43 UTC

Can you create plain literals with language tag using ResourceFactory?

Is there a way to create a plain literal with a language tag using ResourceFactory or a similar factory interface?

--Stephan

Re: Can you create plain literals with language tag using ResourceFactory?

Posted by Stephan Zednik <ze...@rpi.edu>.
Thanks Andy for the clarification and the response.

--Stephan

On Dec 17, 2012, at 3:30 AM, Andy Seaborne <an...@apache.org> wrote:

> On 15/12/12 08:08, Stephan Zednik wrote:
>> I misread the webpage I was looking at on Literals.  I do not want a
>> "plain" literal, but a typed literal with xml:lang string.
>> 
>> To make my question grounded in an example; If I wanted to create
>> "Hello World"@en, how could I do it?
> 
> Oddly, there is a missing operation.
> 
> Add in SVN -- ResourceFcatrory.createLangLiteral.
> 
> 
> You do want a "plain literal".
> 
> "Plain literal" in RDF-2004-speak is one without a datatype, and includes with and without a language tag.
> 
> SPARQL (1.0) calls a plain literal with no language tag a "simple literal" because it has to deal with the differences.
> 
> RDF 1.1 sorts this out:
> 
> * All literals have a datatype.
> 
> * "simple literals" syntax remains but the literal has
>  a datatype of xsd:string.  So "simple literals" and
>  xsd:string are merged.
> 
> * "language-tagged string" has a datatype of rdf:langString
>  It still has a language tag as well.
>  SPARQL 1.1 includes this in datatype().
> 
> That should not be big change to real applications (or so the RDF-WG believes), which don't often seem to mix use of simple literals and xsd:strings.  But it will affect Jena's tests and writers more than most.
> 
> 	Andy
> 
> 
>> 
>> Thanks, --Stephan
>> 
>> On Dec 15, 2012, at 12:18 AM, Stephan Zednik <ze...@rpi.edu> wrote:
>> 
>>> Is there a way to create a plain literal with a language tag using
>>> ResourceFactory or a similar factory interface?
>>> 
>>> --Stephan
>> 
> 
> 


Re: Can you create plain literals with language tag using ResourceFactory?

Posted by Andy Seaborne <an...@apache.org>.
On 15/12/12 08:08, Stephan Zednik wrote:
> I misread the webpage I was looking at on Literals.  I do not want a
> "plain" literal, but a typed literal with xml:lang string.
>
> To make my question grounded in an example; If I wanted to create
> "Hello World"@en, how could I do it?

Oddly, there is a missing operation.

Add in SVN -- ResourceFcatrory.createLangLiteral.


You do want a "plain literal".

"Plain literal" in RDF-2004-speak is one without a datatype, and 
includes with and without a language tag.

SPARQL (1.0) calls a plain literal with no language tag a "simple 
literal" because it has to deal with the differences.

RDF 1.1 sorts this out:

* All literals have a datatype.

* "simple literals" syntax remains but the literal has
   a datatype of xsd:string.  So "simple literals" and
   xsd:string are merged.

* "language-tagged string" has a datatype of rdf:langString
   It still has a language tag as well.
   SPARQL 1.1 includes this in datatype().

That should not be big change to real applications (or so the RDF-WG 
believes), which don't often seem to mix use of simple literals and 
xsd:strings.  But it will affect Jena's tests and writers more than most.

	Andy


>
> Thanks, --Stephan
>
> On Dec 15, 2012, at 12:18 AM, Stephan Zednik <ze...@rpi.edu> wrote:
>
>> Is there a way to create a plain literal with a language tag using
>> ResourceFactory or a similar factory interface?
>>
>> --Stephan
>


Re: Can you create plain literals with language tag using ResourceFactory?

Posted by Stephan Zednik <lo...@gmail.com>.
I misread the webpage I was looking at on Literals.  I do not want a "plain" literal, but a typed literal with xml:lang string.

To make my question grounded in an example; If I wanted to create "Hello World"@en, how could I do it?

Thanks,
--Stephan

On Dec 15, 2012, at 12:18 AM, Stephan Zednik <ze...@rpi.edu> wrote:

> Is there a way to create a plain literal with a language tag using ResourceFactory or a similar factory interface?
> 
> --Stephan