summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAshley Sommer <ashleysommer@gmail.com>2020-09-17 16:22:17 +1000
committerGitHub <noreply@github.com>2020-09-17 16:22:17 +1000
commitb8ab037f23a204b973dfc31a96155aa9f219138b (patch)
treed4ea0a95102b47c4398e5e37eb776b4e7c03eafb /docs
parent63f46e476e6dd0ae3eef5b71a35e3c8b97a01c6b (diff)
parentc589e762293f3c597a8b671df74c7ef703401efa (diff)
downloadrdflib-b8ab037f23a204b973dfc31a96155aa9f219138b.tar.gz
Merge pull request #1162 from FlorianLudwig/serialize-doc
Small improvement to serialize docs
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