Hi William,
I have encountered a problem with regard to the Sesame 2 driver in the 5.0.7
release. I have attempted to use the RepositoryConnection.getStatements()
method and resulted in an exception thrown complaining an invalid SPARQL
generated. The object value appears to be missing although the "^^" type
declaration can be seen.
I have delved into the code of the VirtuosoRepositoryConnection class and
the stringForValue() method looks suspicious. The problem being the String
"o" is replaced rather than appended to. Here is the patched method that has
fixed the problem
I have passed your information to the Virtuoso development team and they
have made a permanent fix for this which i have attached in case you are
interested. Note that it is coded slightly different than your version.
Thank you very much for your time and effort in reporting this problem
and please let me know how you are getting on with examining Virtuoso.
Best regards,
Patrick
Index: virtuoso_driver/VirtuosoRepositoryConnection.java
===================================================================
RCS file:
/opldev/opensource/virtuoso-opensource/binsrc/sesame2/virtuoso_driver/VirtuosoRepositoryConnection.java,v
retrieving revision 1.26
diff -u -r1.26 VirtuosoRepositoryConnection.java
--- virtuoso_driver/VirtuosoRepositoryConnection.java 2008/07/28 10:13:59
1.26
+++ virtuoso_driver/VirtuosoRepositoryConnection.java 2008/08/27 22:56:13
@@ -2023,9 +2023,9 @@
Literal lit = (Literal) n;
String o = "\"" + lit.stringValue() + "\"";
if (lit.getLanguage() != null)
- o = "@" + lit.getLanguage();
+ return o + "@" + lit.getLanguage();
else if (lit.getDatatype() != null)
- o = "^^<" + lit.getDatatype() + ">";
+ return o + "^^<" + lit.getDatatype() + ">";
return o;
}
else return "\"" + n.stringValue() + "\"";