I am trying to convert the RDF/XML format to JSON format. Is there any python (library) example that i can look into for this to do ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use rdflib to parse many RDF variants (including RDF/XML), or maybe the simpler rdfparser if it suits your needs. You can then use the standard library Python
jsonmodule (or equivalently third-partysimplejsonif you’re using some Python version older than 2.6) to serialize the in-memory structure built with the parser into JSON. I’m not familiar with any package embodying both steps, unfortunately.With the example at rdfparser’s site, the overall work would be just…: