summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/intro_to_parsing.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/intro_to_parsing.rst b/docs/intro_to_parsing.rst
index b07b3609..5b50e5ba 100644
--- a/docs/intro_to_parsing.rst
+++ b/docs/intro_to_parsing.rst
@@ -67,3 +67,15 @@ files you'll find on the net.
RDFLib will also happily read RDF from any file-like object,
i.e. anything with a ``.read()`` method.
+
+
+Saving RDF
+----------
+
+To store a graph in a file use the :func:`rdflib.Graph.serialize` function:
+
+.. code-block:: python
+
+ g.parse("http://bigasterisk.com/foaf.rdf")
+ with open("foaf.n3", "wb") as f:
+ g.serialize(f, format="n3") \ No newline at end of file