Search code examples
rdfdata-conversiontxtturtle-rdf

how to convert a triple text file to RDF format


I have a file which each line includes three parts which are separated via 'tab', please take a look at the following example of my input data:

<fb:m.0100zv6s> <fb:common.topic.notable_for>   <fb:g.1q3sj7rb3>
<fb:m.0100zv6s> <fb:common.topic.notable_types> <fb:m.0kpv1_>
<fb:m.0100zv6s> <fb:music.group_member.membership>  <fb:m.0100zv6q>
<fb:m.0100zv6s> <fb:people.person.nationality>  <fb:m.03_r3>
<fb:m.0100zv6s> <fb:people.person.place_of_birth>   <fb:m.03_r3>

How can I convert the file ino a turtle/n3/owl or xml format? The file is around 2GB.


Solution

  • Your values already seem to be legal URIs. All you need to do is add a full stop at the end of each line:

    <fb:m.0100zv6s> <fb:common.topic.notable_for>   <fb:g.1q3sj7rb3> .
    <fb:m.0100zv6s> <fb:common.topic.notable_types> <fb:m.0kpv1_> .
    <fb:m.0100zv6s> <fb:music.group_member.membership>  <fb:m.0100zv6q> .
    <fb:m.0100zv6s> <fb:people.person.nationality>  <fb:m.03_r3> .
    <fb:m.0100zv6s> <fb:people.person.place_of_birth>   <fb:m.03_r3> .
    

    That's all. Your file is now legal N-Triples syntax.