Re: Replacement for CSVInput and TSVInput?

2022-12-15 Thread Martynas Jusevičius
Thanks.

On Mon, Dec 12, 2022 at 7:55 PM Andy Seaborne  wrote:
>
> ResultsSetMgr which uses ResultsReader
>
>
> On 12/12/2022 15:45, Martynas Jusevičius wrote:
> > Hi,
> >
> > I'm upgrading Jena 4.5.0 to 4.6.1.
> >
> > I can see that org.apache.jena.sparql.resultset.CSVInput is gone and
> > org.apache.jena.sparql.resultset.TSVInput is deprecated.
> >
> > What are the replacements for them?
> >
> > My code was the following:
> >
> >  if 
> > (mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_XML_TYPE))
> >  return
> > ResultSetFactory.makeRewindable(ResultSetFactory.fromXML(in));
> >  if 
> > (mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_JSON_TYPE))
> >  return
> > ResultSetFactory.makeRewindable(ResultSetFactory.fromJSON(in));
> >  if 
> > (mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
> >  return ResultSetFactory.makeRewindable(CSVInput.fromCSV(in));
> >  if 
> > (mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
> >  return ResultSetFactory.makeRewindable(TSVInput.fromTSV(in));
> >
> > Thanks.
> >
> > Martynas
> > atomgraph.com


Re: Replacement for CSVInput and TSVInput?

2022-12-12 Thread Andy Seaborne

ResultsSetMgr which uses ResultsReader


On 12/12/2022 15:45, Martynas Jusevičius wrote:

Hi,

I'm upgrading Jena 4.5.0 to 4.6.1.

I can see that org.apache.jena.sparql.resultset.CSVInput is gone and
org.apache.jena.sparql.resultset.TSVInput is deprecated.

What are the replacements for them?

My code was the following:

 if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_XML_TYPE))
 return
ResultSetFactory.makeRewindable(ResultSetFactory.fromXML(in));
 if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_JSON_TYPE))
 return
ResultSetFactory.makeRewindable(ResultSetFactory.fromJSON(in));
 if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
 return ResultSetFactory.makeRewindable(CSVInput.fromCSV(in));
 if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
 return ResultSetFactory.makeRewindable(TSVInput.fromTSV(in));

Thanks.

Martynas
atomgraph.com


Replacement for CSVInput and TSVInput?

2022-12-12 Thread Martynas Jusevičius
Hi,

I'm upgrading Jena 4.5.0 to 4.6.1.

I can see that org.apache.jena.sparql.resultset.CSVInput is gone and
org.apache.jena.sparql.resultset.TSVInput is deprecated.

What are the replacements for them?

My code was the following:

if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_XML_TYPE))
return
ResultSetFactory.makeRewindable(ResultSetFactory.fromXML(in));
if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_JSON_TYPE))
return
ResultSetFactory.makeRewindable(ResultSetFactory.fromJSON(in));
if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
return ResultSetFactory.makeRewindable(CSVInput.fromCSV(in));
if 
(mediaType.isCompatible(com.atomgraph.core.MediaType.APPLICATION_SPARQL_RESULTS_CSV_TYPE))
return ResultSetFactory.makeRewindable(TSVInput.fromTSV(in));

Thanks.

Martynas
atomgraph.com