You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@any23.apache.org by Spyros Kotoulas <Sp...@ie.ibm.com> on 2012/02/10 12:16:25 UTC

Parsing CSV files

Hi All,

I have been trying to use ANY23 to parse CSV files and I am getting strange
results:

Namely, posting the following input on any23.org:
field1,field2,field3
value1,,value3

I get back this RDF:
<http://any23.org/tmp/field1> <http://www.w3.org/2000/01/rdf-schema#label>
"field1" .
<http://any23.org/tmp/field1> <http://vocab.sindice.net/csv/columnPosition>
"0"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://any23.org/tmp/field2> <http://www.w3.org/2000/01/rdf-schema#label>
"field2" .
<http://any23.org/tmp/field2> <http://vocab.sindice.net/csv/columnPosition>
"1"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://any23.org/tmp/field3> <http://www.w3.org/2000/01/rdf-schema#label>
"field3" .
<http://any23.org/tmp/field3> <http://vocab.sindice.net/csv/columnPosition>
"2"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://any23.org/tmp/row/0>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://vocab.sindice.net/csv/Row> .
<http://any23.org/tmp/row/0> <http://any23.org/tmp/field1>
"value1"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://any23.org/tmp/row/0> <http://any23.org/tmp/field2>
"value3"^^<http://www.w3.org/2001/XMLSchema#string> .
<http://any23.org/tmp/> <http://vocab.sindice.net/csv/row>
<http://any23.org/tmp/row/0> .
<http://any23.org/tmp/row/0> <http://vocab.sindice.net/csv/rowPosition>
"0" .
<http://any23.org/tmp/> <http://vocab.sindice.net/csv/numberOfRows>
"1"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://any23.org/tmp/> <http://vocab.sindice.net/csv/numberOfColumns>
"3"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://any23.org/tmp/> <http://vocab.sindice.net/date>
"2012-02-10T11:13:22+00:00" .
<http://any23.org/tmp/> <http://vocab.sindice.net/size>
"15"^^<http://www.w3.org/2001/XMLSchema#int> .

The triple:
<http://any23.org/tmp/row/0> <http://any23.org/tmp/field2>
"value3"^^<http://www.w3.org/2001/XMLSchema#string> .
has an error (wrong property).

Considering that this code is widely used, I guess there is a parameter for
not discarding empty cells somewhere, but I could not find it. Can you
help?

Regards,
Spyros Kotoulas
IBM Research - Smarter Cities Technology Center


Re: Parsing CSV files

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hi Spyros,

On Fri, Feb 10, 2012 at 11:16 AM, Spyros Kotoulas <
Spyros.Kotoulas@ie.ibm.com> wrote:

>
> I have been trying to use ANY23 to parse CSV files and I am getting strange
> results:
>

Have you been getting strange results when posting to the webservice @
any23.org or when actually parsing CSV files? You start with the latter
then follow on to talk about the webservice. I'm assuming that your
referring to using the web service to process csv's.., can you please
clarify.


>
> Namely, posting the following input on any23.org:
> field1,field2,field3
> value1,,value3
>
> I get back this RDF:
> <http://any23.org/tmp/field1> <http://www.w3.org/2000/01/rdf-schema#label>
> "field1" .
>
> None of the text is RDF syntax...

When using the web service I

> The triple:
> <http://any23.org/tmp/row/0> <http://any23.org/tmp/field2>
> "value3"^^<http://www.w3.org/2001/XMLSchema#string> .
> has an error (wrong property).
>

What were you expecting here instead of the above result. You can produce a
result from the web service, I tried and didn't get any obvious indicators
that anything was incorrect.


>
> Considering that this code is widely used, I guess there is a parameter for
> not discarding empty cells somewhere, but I could not find it. Can you
> help?
>
> Lets see how we do with the above then we can drill down to this more.
Thank you



-- 
*Lewis*