diff options
| author | Graham Higgins <gjh@bel-epa.com> | 2012-01-24 18:41:52 +0000 |
|---|---|---|
| committer | Graham Higgins <gjh@bel-epa.com> | 2012-01-24 18:41:52 +0000 |
| commit | df764efcd0c06b423aeb77b8688cc448543a9135 (patch) | |
| tree | 2f52714e197436657dd0371679023b49fe0781ea /docs | |
| parent | ad6a40de512428ec0a675992cba1bb2669f3270c (diff) | |
| download | rdflib-df764efcd0c06b423aeb77b8688cc448543a9135.tar.gz | |
Addressing sphinx errors and warnings
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/conf.py | 2 | ||||
| -rw-r--r-- | docs/gettingstarted.rst | 133 | ||||
| -rw-r--r-- | docs/graph_utilities.rst | 2 | ||||
| -rw-r--r-- | docs/univrdfstore.rst | 2 |
4 files changed, 134 insertions, 5 deletions
diff --git a/docs/conf.py b/docs/conf.py index 5f9b52e2..28588e7f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -73,7 +73,7 @@ release = '3.2.1' # List of directories, relative to source directory, that shouldn't be searched # for source files. -exclude_trees = ['_build'] +exclude_trees = ['_build', 'draft'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 8eee2be5..ca04a1bf 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -93,28 +93,95 @@ See also .. automethod:: rdflib.graph.Graph.parse :noindex: + Plugin parsers -------------- +The plug-in parsers are listed in :mod:`rdfextras.plugins`: + +.. code-block:: python + + register('n3', Parser, + 'rdflib.plugins.parsers.notation3', 'N3Parser') + register('nquads', Parser, + 'rdflib.plugins.parsers.nquads', 'NQuadsParser') + register('nt', Parser, + 'rdflib.plugins.parsers.nt', 'NTParser') + register('trix', Parser, + 'rdflib.plugins.parsers.trix', 'TriXParser') + register('application/rdf+xml', Parser, + 'rdflib.plugins.parsers.rdfxml', 'RDFXMLParser') + register('xml', Parser, + 'rdflib.plugins.parsers.rdfxml', 'RDFXMLParser') + register('rdfa', Parser, + 'rdflib.plugins.parsers.rdfa', 'RDFaParser') + register('text/html', Parser, + 'rdflib.plugins.parsers.rdfa', 'RDFaParser') + register('application/xhtml+xml', Parser, + 'rdflib.plugins.parsers.rdfa', 'RDFaParser') + + +Notation 3 +^^^^^^^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="n3") + .. module:: rdflib.plugins.parsers.notation3 .. autoclass:: rdflib.plugins.parsers.notation3.N3Parser :members: +NQuads +^^^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="nquads") + .. module:: rdflib.plugins.parsers.nquads .. autoclass:: rdflib.plugins.parsers.nquads.NQuadsParser :members: +NTriples +^^^^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="nt") + .. module:: rdflib.plugins.parsers.nt .. autoclass:: rdflib.plugins.parsers.nt.NTParser :members: -.. module:: rdflib.plugins.parsers.rdfa +RDFa +^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="rdfa") + +.. automodule:: rdflib.plugins.parsers.rdfa .. autoclass:: rdflib.plugins.parsers.rdfa.RDFaParser :members: +RDF/XML +^^^^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="application/rdf+xml") + .. autoclass:: rdflib.plugins.parsers.rdfxml.RDFXMLParser :members: +TriX +^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=data, format="trix") + .. module:: rdflib.plugins.parsers.trix .. autoclass:: rdflib.plugins.parsers.trix.TriXParser :members: @@ -123,30 +190,92 @@ Plugin parsers Plugin serializers ------------------ +The plug-in serializers are listed in :mod:`rdfextras.plugins`: + +.. code-block:: python + + register('n3', Serializer, + 'rdflib.plugins.serializers.n3','N3Serializer') + register('turtle', Serializer, + 'rdflib.plugins.serializers.turtle', 'TurtleSerializer') + register('nt', Serializer, + 'rdflib.plugins.serializers.nt', 'NTSerializer') + register('xml', Serializer, + 'rdflib.plugins.serializers.rdfxml', 'XMLSerializer') + register('pretty-xml', Serializer, + 'rdflib.plugins.serializers.rdfxml', 'PrettyXMLSerializer') + register('trix', Serializer, + 'rdflib.plugins.serializers.trix', 'TriXSerializer') + register('nquads', Serializer, + 'rdflib.plugins.serializers.nquads', 'NQuadsSerializer') + +Notation 3 +^^^^^^^^^^ + +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='n3') + .. module:: rdflib.plugins.serializers.n3 .. autoclass:: rdflib.plugins.serializers.n3.N3Serializer :members: +NQuads +^^^^^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='nquads') + .. module:: rdflib.plugins.serializers.nquads .. autoclass:: rdflib.plugins.serializers.nquads.NQuadsSerializer :members: +NTriples +^^^^^^^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='nt') + .. module:: rdflib.plugins.serializers.nt .. autoclass:: rdflib.plugins.serializers.nt.NTSerializer :members: +RDF/XML +^^^^^^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='xml') + .. module:: rdflib.plugins.serializers.rdfxml .. autoclass:: rdflib.plugins.serializers.rdfxml.XMLSerializer :members: +TriX +^^^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='trix') + .. module:: rdflib.plugins.serializers.trix .. autoclass:: rdflib.plugins.serializers.trix.TriXSerializer :members: +Turtle +^^^^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='turtle') + .. module:: rdflib.plugins.serializers.turtle .. autoclass:: rdflib.plugins.serializers.turtle.TurtleSerializer :members: +XML +^^^ +.. code-block:: python + + ConjunctiveGraph().parse(data=s, format='pretty-xml') + .. module:: rdflib.plugins.serializers.xmlwriter .. autoclass:: rdflib.plugins.serializers.xmlwriter.XMLWriter :members: @@ -233,7 +362,7 @@ The results are tuples of values in the same order as your SELECT arguments. Namespaces ^^^^^^^^^^ -The :meth:`~rdflib.graph.Graph.parse` :keyword:`initNs` argument is a dictionary of namespaces to be expanded in the query string. In a large program, it is common to use the same ``dict`` for every single query. You might even hack your graph instance so that the ``initNs`` arg is already filled in. +The `initNs` argument supplied to :meth:`~rdflib.graph.Graph.parse` is a dictionary of namespaces to be expanded in the query string. In a large program, it is common to use the same ``dict`` for every single query. You might even hack your graph instance so that the ``initNs`` arg is already filled in. .. warning:: rdfextras.store.SPARQL.query does not support `initNs`. diff --git a/docs/graph_utilities.rst b/docs/graph_utilities.rst index 3a08cea8..30194929 100644 --- a/docs/graph_utilities.rst +++ b/docs/graph_utilities.rst @@ -45,7 +45,7 @@ Triples can be added in two ways: .. automethod:: rdflib.graph.Graph.parse :noindex: - The first argument can be a *source* of many kinds, but the most common is the serialization (in various formats: RDF/XML, Notation 3, NTriples of an RDF graph as a string. The :keyword:`format` parameter is one of ``n3``, ``xml``, or ``ntriples``. :keyword:`publicID` is the name of the graph into which the RDF serialization will be parsed. + The first argument can be a *source* of many kinds, but the most common is the serialization (in various formats: RDF/XML, Notation 3, NTriples of an RDF graph as a string. The ``format`` parameter is one of ``n3``, ``xml``, or ``ntriples``. ``publicID`` is the name of the graph into which the RDF serialization will be parsed. * Triples can also be added with the :meth:`add` function: diff --git a/docs/univrdfstore.rst b/docs/univrdfstore.rst index 81bdf6d5..6ba884ae 100644 --- a/docs/univrdfstore.rst +++ b/docs/univrdfstore.rst @@ -193,7 +193,7 @@ The following methods are defined to provide this capability (see below for desc The *configuration* string is understood by the store implementation and represents all the parameters needed to locate an individual instance of a store. This could be similar to an ODBC string or in fact be an ODBC string, if the connection protocol to the underlying database is ODBC. -The :meth:`~rdflib.graph.Graph.open` function needs to fail intelligently in order to clearly express that a store (identified by the given configuration string) already exists or that there is no store (at the location specified by the configuration string) depending on the value of :keyword:`create`. +The :meth:`~rdflib.graph.Graph.open` function needs to fail intelligently in order to clearly express that a store (identified by the given configuration string) already exists or that there is no store (at the location specified by the configuration string) depending on the value of ``create``. Triple Interfaces ================= |
