Hi Olivier,

Thanks for the tips for using your library.
It may be useful one day.
Can I have a look at it? I'm wondering how the n3 graph is read (from a
file?)
Is it possible to manage an other data source from? like a RDF Store?

For my case, my code is inside a java servlet and I don't manage to set up
the application with data from a IHM. So there is no way to use a
javascript library (not yet ;-))

Thanks anyway,


Brice


2013/6/5 Olivier Rossel <[email protected]>

> i have a small javascript that converts a n3 graph into a javascript graph
> of objects.
> if your problem is related to XML stuff and such a lib could help, let me
> know.
> (it might be interesting to contribute it directly to exhibit, btw)
>
>
> On Wed, Jun 5, 2013 at 6:13 PM, Brice Sommacal <[email protected]
> >wrote:
>
> > Hello everyone,
> >
> > I'm facing a "java.lang.OutOfMemoryError: GC overhead limit exceeded"
> error
> > and I would like an advice about how I could optimize my code.
> >
> > The aim of this method is to run a SPARQL query, convert it on a XML
> format
> > and then apply a XSL stylesheet[1] to write a JSON format (readable by
> > Exhibit - Scripted [2]).
> >
> >  My piece of code was working well untill today. (I have been trying to
> > query a big model and the query returns too much results).
> > This makes my program break.
> >
> > <quote>
> > Query queryToExec = QueryFactory.create(query, Syntax.syntaxARQ);
> > QueryExecution qexec = QueryExecutionFactory.create(queryToExec, ontoIn);
> >  ResultSet result = null;
> > BufferedOutputStream buf;
> > try{
> >  result = qexec.execSelect();
> > buf = new BufferedOutputStream(new FileOutputStream(new File(root +
> > "XML/JSON_XML/"+qNameClass+".xml")));
> >  //Serialization of the resultSet
> > ResultSetFormatter.outputAsXML(buf, result);
> > buf.close();
> >  }
> > catch (Exception e) {
> > e.printStackTrace();
> >  }
> > finally{
> > qexec.close();
> > }
> > </quote>
> >
> > I know that writing XML file use loads memory....
> >
> > I was thinking of:
> >  - creating several XML files by tracing the ResullSetFormatter memory
> > usage. (is there possible?)
> >  - avoiding XML intermediate format and write directly in one or several
> > JSON file...
> >  - ...
> >
> >
> > >  Is there someone whom find a way to avoid this kind of error (without
> > increasing Xms Xmx) ??
> >
> > Thanks in advance,
> >
> >
> > Brice
> >
> > [1] http://data-gov.tw.rpi.edu/wiki/Sparqlxml2exhibitjson.xsl
> > [2] http://www.simile-widgets.org/exhibit3/
> >
>

Reply via email to