I have rdf triples with me, now I'm interested in generating an RDF / XML file using rdflib in Python. Could you give me some sample code to get you started.
thanks
rdflib docs can be a good starting point, especially Getting Started . For instance:
import rdflib from rdflib.Graph import Graph g = Graph() g.parse("http://www.w3.org/2000/10/rdf-tests/rdfcore/ntriples/test.nt", format="nt") g.serialize("test.rdf", format="rdf/xml")
If the rdf / xml format is unknown (depending on the rdflib version), use instead:
g.serialize("test.rdf", format="pretty-xml")
Source: https://habr.com/ru/post/889382/More articles:Fix part of Yaw of one quaternion as part of Yaw of another - mathas3How to create a simple GUI project (Hello world) for Android on Clojure? - androidMap is not displayed. Google Maps API V3 - google-mapsWindows print spool manager setjob function not working for windows-7? - vb.netVirtual function returning a small structure - return value and output parameter? - c ++Javascript! and!! differences - javascriptHow can I make persistence easy in Symfony2? - phpWhy is my empty div collapsing even though it has a width when using the built-in display? - htmlIn C #, is there a way to define an enumeration and an instance of this enumeration at the same time? - syntaxAll Articles