Tuesday 7 July 2009

Converting from one version of semantic data to another (.N3, N-Triples, RDF/XML, OWL)

I have found a very useful little tool that allows converting data (schema/instaces) to and from .N3, N-Triples, RDF/XML and OWL. This utility is particularly handy when your RDF stores accepts schemas in particular format only (in majority of cases N3/N-Triples). Here is the link to the tool and syntax which allows you to do so ( It took me sometime to find the exact syntax so I hope it will save some of your time).

http://www.w3.org/2000/10/swap/doc/cwm.html
&
http://infomesh.net/2001/cwm/

syntax to convert from RDF/OWL to N3.

python cwm.py --rdf file-to-be-converted.owl --n3 > file-as-output.n3


or even better....
you can use Protege :)
Open .owl file in protege and go to File -> SaveAs and save it as .N3 or turtle. So easy, isnt it?

2 comments:

  1. Do you encounter any problems when rdf file contains unicode characters?

    ReplyDelete
  2. Hello,
    Thanks for the info. i have installed Python in my computer. then I didnt know how to install cwm.
    Actually my problem is to convert owl file to N-triple.
    I have tried protege (3.4) but i have an error when i ask for the conversion :(
    Thanks if you can help me.

    ReplyDelete