sdsc-ordes / rdfpipe-rs

Quickly convert between RDF file formats. A rust implementation of rdfpipe based on the sophia crate.
GNU General Public License v3.0
5 stars 0 forks source link

Print parsing error #21

Open rmfranken opened 2 months ago

rmfranken commented 2 months ago

I would like to use rdfpipe as a tool to quickly check whether a graph does not contain any syntax errors, and format it. If it does contain syntax errors however, currently the tool just outputs "Could not parse graph". It would be extremely useful to get a pointer to which line in the input contains the mistake. Is that possible to print in addition to the generic error message?

cmdoret commented 2 months ago

I don't think we can do it with the current approach; we just do source.add_to_graph(graph), which calls insert_all(). We should change the approach as suggested in #14 to stream triples (instead of loading the whole graph in RAM as is done now).

Once triples are parsed iteratively, it should be possible to return the exact line raising the error.

rmfranken commented 2 months ago

That makes sense. Great issue for our brand new rustaceans! For now I will use the elsecvier vscode extnesion to do it, if I cannot parse with rdfpipe,