Petr Křemen created JENA-2341:
---------------------------------

             Summary: Configurable CSV format of SPARQL query output
                 Key: JENA-2341
                 URL: https://issues.apache.org/jira/browse/JENA-2341
             Project: Apache Jena
          Issue Type: New Feature
          Components: ARQ, Jena
    Affects Versions: Jena 4.5.0
            Reporter: Petr Křemen


org.apache.jena.riot.resultset.rw.ResultsWriter outputs a CSV where some fields 
are double quoted and some are not, based on their content (this is fully 
compliant with [RFC-4180|https://datatracker.ietf.org/doc/html/rfc4180]), for 
example:

entity,language
[http://test.org/c1],"";
[http://test.org/c2,en]

Output format configuration makes it more flexible for subsequent processing. 
For example, parsing of CSVs which contain double quotes all the times 
simplifies their processing, once  a custom parser needs to be used:

This feature request is to allow the ResultsWriter clients to decide when to 
use double quotes - e.g. like 
[https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/QuoteMode.html]

However, given this minimal requirement, an option would be to have a fully 
OpenCSV compliant implementation of CSV output similarly to CSV parsing 
(JENA-699) and allow other configurations too (e.g. the quote symbol, as per 
[https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html|https://commons.apache.org/proper/commons-csv/apidocs/org/apache/commons/csv/CSVFormat.html#EXCEL]).

(The discussion to this issue can be found at JENA-2338)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to