Can RDFlib take in lines of xml code to be put into a graph in python? I Know triples are generally what is used with RDFlib, but if I didn't have to convert them from XML to Turtle it would save a lot of work.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- Illegal to have multiple roots (start tag in epilo
- How to get the background from multiple images by
- Evil ctypes hack in python
Assuming that when you say “xml code” you actually mean RDF/XML, and that you have the entire RDF/XML document, not just a snippet of it, then yes, RDFlib accepts it. The documentation page Loading and saving RDF starts with an example in N-Triples, but mentions how other formats are specified:
In your case, you just need to use the
xml
(which actually means RDF/XML) format: