You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@atomgraph.com> on 2022/12/12 15:45:25 UTC

Replacement for CSVInput and TSVInput?

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?

Posted by Martynas Jusevičius <ma...@atomgraph.com>.
Thanks.

On Mon, Dec 12, 2022 at 7:55 PM Andy Seaborne <an...@apache.org> 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?

Posted by Andy Seaborne <an...@apache.org>.
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