On 21/02/12 15:28, Chris Dollin wrote:
Dave wrote:

On 21/02/12 14:33, Dick Murray wrote:
Hello all.

I'm looking for a LiteralFactory.createLiteral(String v, String
language) equivalent. I know Model has a createLiteral(String v, String
language) but I don't have a Model at the point I need to create the
Literal. I've followed the Model createLiteral but either got lost or
confused or both!
Looks like an omission from ResourceFactory.

Possibly worth a Jira.
I've created https://issues.apache.org/jira/browse/JENA-213 based on your suggestion Dave.

As a work around you could do something like:

   public Literal createLangLiteral(String lex, String lang) {
      return new LiteralImpl( Node.createLiteral(lex, lang, null), null);
   }
This works :-)
Another workaround is to have a static empty Model lying around,
and ask it to create the literal.

Chris

I thought about that but it seemed "a sledgehammer to crack a nut"...


Reply via email to