Hi Kjetil,
What is the version of the Virtuoso JDBC Driver being used (or picked
up if you have multiples) , as it should be the following for a 5.0.9
install:
$ java virtuoso.jdbc3.Driver
OpenLink Virtuoso(TM) Driver for JDBC(TM) Version 3.x [Build 3.25]
Do ensure you only have one JDBC Driver in place as it has been known
for old version to get picked up machine with previous installs on
them ...
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 13 Nov 2008, at 17:38, Kjetil Kjernsmo wrote:
All,
I've created a simple servlet to be able to get RDF/XML-ABBREV
formatted
results for parts of my application, which depends on that syntax.
It works fine for trivial DESCRIBEs (i.e. just DESCRIBE a single
URI), but for
slightly more complex queries, I get this error:
com.hp.hpl.jena.shared.JenaException: Convert results are
FAILED.:virtuoso.jdbc3.VirtuosoException: Bad column number : 2 not
in 1<n<1
virtuoso.jena.driver.VirtuosoQueryExecution.execDescribe(Unknown
Source)
virtuoso.jena.driver.VirtuosoQueryExecution.execDescribe(Unknown
Source)
com.computas.sublima.query.servlets.VirtJenaEndpoint.doGet
(VirtJenaEndpoint.java:41)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.springframework.web.filter.RequestContextFilter.doFilterInternal
(RequestContextFilter.java:63)
org.springframework.web.filter.OncePerRequestFilter.doFilter
(OncePerRequestFilter.java:75)
com.computas.sublima.app.filter.SetCharacterEncodingFilter.doFilter
(SetCharacterEncodingFilter.java:24)
An example of a query is this:
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX wdr: <http://www.w3.org/2007/05/powder#>
DESCRIBE ?resource
<http://xmlns.computas.com/topic/topic000273> ?publisher ?subjects ?
rest
WHERE {
?resource dct:language ?lang;
dct:publisher ?publisher ;
dct:subject
<http://xmlns.computas.com/topic/topic000273>, ?subjects ;
wdr:describedBy
<http://sublima.computas.com/status/godkjent_av_administrator> ;
?p ?rest .}
If I run this through the Virtuoso SPARQL Endpoint, it returns the
correct
results, but crashes if I run it through Jena. The core of my
servlet code is
this:
VirtGraph vGraph = new VirtGraph(
SettingsService.getProperty("sublima.database.url"),
SettingsService.getProperty
("sublima.database.username"),
SettingsService.getProperty
("sublima.database.password")
);
Query sparql = null;
try {
sparql = QueryFactory.create(req.getParameterValues
("query")[0]);
} catch (QueryException e) {
res.sendError(400, "The SPARQL query was malformed: " +
e.getMessage());
e.printStackTrace();
return;
}
VirtuosoQueryExecution exec =
VirtuosoQueryExecutionFactory.create(sparql, vGraph);
Model model = exec.execDescribe();
res.setContentType("application/rdf+xml");
PrintWriter out = res.getWriter();
model.write(out, "RDF/XML-ABBREV");
out.close();
The exception message doesn't mean much to me, can anybody give
more details
about what this means?
Kind regards
Kjetil Kjernsmo
--
Senior Knowledge Engineer
Mobile: +47 986 48 234
Email: kjetil.kjern...@computas.com
Web: http://www.computas.com/
| SHARE YOUR KNOWLEDGE |
Computas AS PO Box 482, N-1327 Lysaker | Phone:+47 6783 1000 | Fax:
+47 6783
1001
----------------------------------------------------------------------
---
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win
great prizes
Grand prize is a trip for two to an Open Source event anywhere in
the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users