CSV importer or CSV converter to RDF - How to?

I recently attended a NoSQL event and I introduced the Dgraph to the audience of the event. And many people were interested in Dgraph, but the more focused question was “Is there any way to import CSV into Dgraph?”.

I’ve tried (today) look for some tool in the Dgraph Codebase for this or CSV to RDF converters in the RDF standard used in Dgraph. And I have not found anything close to reasonable yet.

Searching in this forum and in the docs of the Dgraph also did not find anything specific.

I found this Data importers for Dgraph · Issue #120 · dgraph-io/dgraph · GitHub - But links are broken.

I found this with Google http://www.easyrdf.org/converter but I do not think it has the Dgraph oO N-quads standard

This seems most likely http://levelup.networkedplanet.com/instructions but I am in doubt as to the RDF format.

Anyway, if you can give a light, tips and if I’m going the right way. I appreciate it.

Cheers

It’s not particularly hard to do that. In fact, you can use JSON to convert every row in a single JSON object.

For e.g.,

ID,Title,Year Of Release USA
1,The Matrix,1999
2,Star Wars,1977
3,Aliens,1986
4,Dope,2015

Can be converted into 4 JSON objects, like this:

[{ "title": "The Matrix", "year": 1999 },
 { "title": "Star Wars", "year": 1977 }, ... ]
1 Like

In that case I could just send the Json with https://docs.dgraph.io/mutations/#json-mutation-format

yeah, I had not thought about that since I was thinking of a direct conversion from CSV to RDF. Anyway is good for the case.

CSV to Json https://www.csvjson.com/csv2json

Thanks.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.