openRDF.org Welcome Guest   | Login   
  Search  
  Index  | Recent Threads  | Who's Online  | User List  | Search  | Help  | RSS feeds

Forum has been closed down
This forum has been closed down due to extensive spamming activities. Please use the mailing list instead.


Quick Go »
Thread Status: Normal
Total posts in this thread: 2
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 1331 times and has 1 reply Next Thread
Jan 31, 2008 9:08:20 PM

josh
Visitor



Joined: Jun 13, 2007
Posts: 3
Status: Offline

confused   string-typed literals and Elmo

Hello. I'd like to know if it's possible to have Elmo create string-typed literals instead of plain literals. For instance, this interface has a "set" method which takes a String as an argument:
@rdf("http://www.example.com/onto#SomeClass")
public interface SomeClass {
@rdf("http://www.example.com/onto#stringTypedProperty")
String getStringTypedProperty();
void setStringTypedProperty(String value);
}
Supposing that the domain of stringTypedProperty is xsd:string, the objects of the statements created by setStringTypedProperty must (in my application) have a datatype of xsd:string. I notice that the org.openrdf.elmo.literals file included with Elmo does map java.lang.String to xsd:string, and I've even tried adding the association programmatically using ElmoModule.recordLiteral, yet I only manage to get plain literals for Strings. Is there anything I've overlooked?
Show Printable Version of Post        Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Feb 1, 2008 5:33:09 PM

james
OpenRDF.org Consultant
Member's Avatar

Canada
Joined: Jul 21, 2005
Posts: 650
Status: Offline
Re: string-typed literals and Elmo

There is no way to override that behaviour through resources files. You will have to override the behaviour in Java.

All String are converted into Literals using the ValueFactory#createLiteral(String) method, which is called from the SesameLiteralManager#getLiteral(Object)

For each SesameManager, create a LiteralManager wrapper around the one returned by SesameManagerFactory and override the getLiteral(Object) method.

http://www.openrdf.org/doc/elmo/1.0-beta2/apidocs/org/openrdf/elmo/sesame/SesameManagerFactory.html
http://www.openrdf.org/doc/elmo/1.0-beta2/apidocs/org/openrdf/elmo/sesame/SesameManager.html
----------------------------------------
Sesame Consultant
http://leighnet.ca
http://jamesrdf.blogspot.com
Show Printable Version of Post        Hidden to Guest    http://leighnet.ca [Link] Report threatening or abusive post: please login first  Go to top 
[Show Printable Version of Thread]