Hi Sergio,
I suspect you need to set the charset for the Virtuoso JDBC Driver to
"UTF-8" to match the encoding in Jena as detailed at:
http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/
VirtJenaProvider#Compiling%20Jena%20Sample%20Programs
Best Regards
Hugh Williams
Professional Services
OpenLink Software
Web: http://www.openlinksw.com
Support: http://support.openlinksw.com
Forums: http://boards.openlinksw.com/support
On 31 Aug 2009, at 09:52, Sergio Fernández wrote:
Dear list,
(sorry, I'm not if this topic was previously discussed here, because I
can't check it because search doesn't work properly in the new SF's
interface)
we're having some encoding problems loading RDF/XML data using
VirtModel
in Java. We get "Organizaci?n" instead of "Organización", for
instance.
The code. Firstly we directly tried this:
VirtModel virtModel = VirtModel.createDefaultModel("jdbc:virtuoso://
localhost:1111", "dba", "dba");
virtModel.read(new StringReader(rdf), null);
Then we switched to a InputStream as Jena's doc recommends [2]:
virtModel.read(new ByteArrayInputStream(rdf.getBytes("UTF-8")), null);
But nothing. And then we tried to delegate parsing to Jena:
Model model = ModelFactory.createDefaultModel();
model.read(new StringReader(rdf), null);
VirtModel virtModel = VirtModel.createDefaultModel("jdbc:virtuoso://
localhost:1111", "dba", "dba");
virtModel.add(model);
In this last attempt is where we found that VirtModel makes something
wrong, because Jena's model has the right values for literals, but
virtModel not.
Any idea...? Thanks in advance.
Best,
[1] http://docs.openlinksw.com/jena/virtuoso/jena/driver/
VirtModel.html
[2] http://jena.sourceforge.net/IO/iohowto.html#encoding
--
Sergio Fernández - sergio.fernan...@fundacionctic.org
R&D Deparment
CTIC Foundation - www.fundacionctic.org
Phone: +34 984 29 12 12
Fax: +34 984 39 06 12
Edificio Centros Tecnológicos
Parque Científico Tecnológico
33203 Cabueñes - Gijón - Asturias - Spain
----------------------------------------------------------------------
--------
Let Crystal Reports handle the reporting - Free Crystal Reports
2008 30-Day
trial. Simplify your report design, integration and deployment -
and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users