diff options
author | Graham Higgins <gjh-github@bel-epa.com> | 2012-02-18 21:16:01 +0000 |
---|---|---|
committer | Graham Higgins <gjh-github@bel-epa.com> | 2012-02-18 21:16:01 +0000 |
commit | 83ae767d949387129baf5a0c6d1b9895be5bfd8a (patch) | |
tree | afcae6615f5a9308a68d82080a4c945e3c82e80b /rdflib/namespace.py | |
parent | 79723c77e205b10afa40558c63a4e6f057eae537 (diff) | |
download | rdflib-83ae767d949387129baf5a0c6d1b9895be5bfd8a.tar.gz |
Re-enable doctests, adjust docstrings for use with py3compat.
Diffstat (limited to 'rdflib/namespace.py')
-rw-r--r-- | rdflib/namespace.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/rdflib/namespace.py b/rdflib/namespace.py index 19396d78..e9848adc 100644 --- a/rdflib/namespace.py +++ b/rdflib/namespace.py @@ -20,29 +20,15 @@ Fully qualified URIs in the namespace can be constructed either by attribute or .. code-block:: pycon >>> fuxi.ruleBase - rdflib.term.URIRef(u'http://metacognition.info/ontologies/FuXi.n3#ruleBase') + rdflib.term.URIRef(%(u)s'http://metacognition.info/ontologies/FuXi.n3#ruleBase') >>> fuxi['ruleBase'] - rdflib.term.URIRef(u'http://metacognition.info/ontologies/FuXi.n3#ruleBase') + rdflib.term.URIRef(%(u)s'http://metacognition.info/ontologies/FuXi.n3#ruleBase') Automatic handling of unknown predicates ----------------------------------------- -As a programming convenience, a namespace binding is automatically created when :class:`rdflib.term.URIRef` predicates are added to the graph: - -.. code-block:: pycon - - >>> from rdflib import Graph, URIRef - >>> g = Graph() - >>> g.add((URIRef("http://example0.com/foo"), - ... URIRef("http://example1.com/bar"), - ... URIRef("http://example2.com/baz"))) - >>> print(g.serialize(format="n3")) - @prefix ns1: <http://example1.com/> . - <BLANKLINE> - <http://example0.com/foo> ns1:bar <http://example2.com/baz> . - <BLANKLINE> - <BLANKLINE> - >>> +As a programming convenience, a namespace binding is automatically +created when :class:`rdflib.term.URIRef` predicates are added to the graph. Importable namespaces ----------------------- @@ -58,7 +44,7 @@ The following namespaces are available by directly importing from rdflib: >>> from rdflib import OWL >>> OWL.seeAlso - rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#seeAlso') + rdflib.term.URIRef(%(u)s'http://www.w3.org/2002/07/owl#seeAlso') """) |