question

Upvotes
Accepted
1 1 1 2

How to read TTL/n-triple dumps?

I got organisations ttl file from https://permid.org/download. While trying to parse it with RDFLib, I get parsing errors. I tried it with n-triple file as well.
How do I read this file? I want to convert this to csv and I'm open to any programming language to do so.
Thanks

permid-apiintelligent-tagging-apiopen-permid-apirdf
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
80.1k 257 52 75

I found one solution to convert the ttl to csv in stack overflow. It uses arq command in Apache Jena.

To convert to CSV, I have to create a SPARQL query.

For example, the query for converting OpenPermID-bulk-assetClass-20180506_071050.ttl to CSV looks like:

The above query is saved in assetQuery.rq.

Then, run the arq tool.

arq --data Open
PermID-bulk-assetClass-20180506_071050.ttl --query assetQuery.rq --results csv > asset.csv

The content in asset.csv file is:


asset.png (44.2 KiB)
assetquery.png (18.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.