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.

Hello @1092629a-5e28-40ca-9ce9-3b0771e2b992,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@1092629a-5e28-40ca-9ce9-3b0771e2b992
Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.
Thanks,
-AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 249 52 74

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.