zhys513 / jenabean

Automatically exported from code.google.com/p/jenabean
0 stars 0 forks source link

Make it possible to fetch raw Jena literals #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Jenabean containing a com.hp.hpl.jena.rdf.model.Literal typed field
2. Annotate with @RdfProperty("http://www.w3.org/2000/01/rdf-schema#label")
3. RDF2Bean throws ClassCastException trying to cast String to Literal

What is the expected output? What do you see instead?
We would like to have the raw literal in order to be able to read additional 
properties like the 
language.

What version of the product are you using? On what operating system?
1.0.1, JVM 1.6.0

Please provide any additional information below.
Patch  available at 
http://bitbucket.org/fmancinelli/jenabean/changeset/858723a8d5ea/#chg-
src/main/java/thewebsemantic/JenaHelper.java

(A similar strategy should be implemented in Bean2RDF.toRDFNode() to handle raw 
literal 
serialization)

Original issue reported on code.google.com by fabio.ma...@gmail.com on 6 Nov 2009 at 5:22

GoogleCodeExporter commented 9 years ago
Patch for raw literal seralization available at
http://bitbucket.org/fmancinelli/jenabean/changeset/2003897bf7c1/#chg-src/main/j
ava/thewebsemantic/Bean2RDF.java

This patch also keeps the language information, if the Literal was a plain 
Literal.

Without this patch, a new resource would be created for each Literal and the 
actual
Literal's value is lost in the process.

Original comment by enygma2...@gmail.com on 24 Nov 2009 at 3:02

GoogleCodeExporter commented 9 years ago
Hi Fabio.  These reports don't hit my gmail account...sorry to have let this 
wait so 
long.  Just recently I added a feature called "LocalizedString", which is a 
special 
type that accounts for xml "lang" attribute.  Since 1.0.5

Investigating this now...in the meantime see if the LocalizedString solves the 
need.

Taylor

Original comment by thewebse...@gmail.com on 2 Feb 2010 at 9:36