Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Text file/document into RDF triples?

Tags:

ontology

I want to create "RDF triple" by taking "text file/document" as an input. It means a tool like portege-OWL, which will convert Text file into RDF triple.

And may I know the steps how to do this. And what are all the tools required to do this.

Any one assist on this is appreciated.

Thanks, Babu

like image 795
user2664196 Avatar asked Jan 09 '14 05:01

user2664196


1 Answers

You should give an example of your ontology in text. I suppose your input is not in RDF/XML format. If your data are saved in a custom text file format, then you probably would not find a tool able to do this conversion. This it totally expected because no tool could actually guess what is the format of an unstructured document, unless it follows one. Therefore, I suppose you would have to write a custom convertor.

You could write the convertor in any language you like, since the output could be an RDF/XML document describing the ontology. RDF/XML is actually an XML file which means that the only thing you need is to create an XML file, using an XML parsing library. Then, you could use the RDF/XML document to import it on the Protege and do whatever you want. Since your programming language is Java, you could do it using the JAXP or any other XML library (here you could find alternatives).

An alternative pathway would be to use Apache Jena which is a java API to handle ontologies (including RDF models) and then you could also process the ontology model created. I believe that Jena is a better way to do it (if you are familiar with it).

Anyway, I don't believe there is a tool to help you. You have to do the source text parsing, the hard way. No tool would be able to identify which part of the source text is meant to declare an RDF class or a property in a custom text format. Perhaps your job would be easier if you used some text parsing library like FFP but still you would have to do it yourself.

Hope I helped!

like image 121
Pantelis Natsiavas Avatar answered Sep 30 '22 13:09

Pantelis Natsiavas