All,

I have another problem with my SPARQL Endpoint servlet, which is just supposed 
to generate RDF/XML-ABBREV from a query. 

The code is the same as with my previous problem, but the current problem is 
that some of the classes, i.e. the rdf:type triples are lost when 
serializing. 

A test query looks like 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#>
DESCRIBE ?resource ?rest WHERE {

?resource dct:identifier 
<http://rabbit.computas.int:8180/sublima-webapp-1.0-SNAPSHOT/resource/vi_tidiga__foedd_foer_tidigt_004314>
 .
?resource ?p ?rest .
}

If I go directly at the Virtuoso endpoint, I see that the triples are there, 
but if I use my RDF/XML-ABBREV based endpoint the triples that have ?rest as 
subject are lost. 

This is the code, and there is a note further down...:
> 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();

I've checked, and the triples are present in this model, so they seem to be 
lost in the subsequent serialisation.

I suppose that the the model is Virtuoso-code, whereas the serialisation 
itself is Jena, so where does this most likely go wrong?

This is the rest of the code:

>         res.setContentType("application/rdf+xml");
>         PrintWriter out = res.getWriter();
>         model.write(out, "RDF/XML-ABBREV");
>         out.close();

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


Reply via email to