Переглянути джерело

Better documentation for LDPR representation options.

Stefano Cossu 4 роки тому
батько
коміт
399eb454e9
2 змінених файлів з 15 додано та 2 видалено
  1. 12 0
      lakesuperior/endpoints/ldp.py
  2. 3 2
      lakesuperior/model/ldp/ldpr.py

+ 12 - 0
lakesuperior/endpoints/ldp.py

@@ -661,6 +661,18 @@ def parse_repr_options(retr_opts, out_headers):
     Ideally, IMR retrieval is done once per request, so all the options
     Ideally, IMR retrieval is done once per request, so all the options
     are set once in the `imr()` property.
     are set once in the `imr()` property.
 
 
+    Representation options include:
+
+    - ``embed_children``: include full resource representation of all resource
+        children in the resource graph.
+    - ``incl_children``: TODO
+    - ``incl_inbound``: include inbound triples (triples whose object is
+      this resource).
+    - ``incl_srv_mgd``: include server-managed triples.
+
+    All options above are ``False`` by default except for ``incl_srv_mgd``
+    which is only ``False`` if the ``return`` representation is ``minimal``.
+
     :param dict retr_opts:: Options parsed from `Prefer` header.
     :param dict retr_opts:: Options parsed from `Prefer` header.
     :param dict out_headers:: Response headers.
     :param dict out_headers:: Response headers.
     """
     """

+ 3 - 2
lakesuperior/model/ldp/ldpr.py

@@ -158,10 +158,11 @@ class Ldpr(metaclass=ABCMeta):
             set) it refers to the root node. It can also be the full URI or
             set) it refers to the root node. It can also be the full URI or
             URN, in which case it will be converted.
             URN, in which case it will be converted.
         :param dict repr_opts: Options used to retrieve the IMR. See
         :param dict repr_opts: Options used to retrieve the IMR. See
-            `parse_rfc7240` for format details.
+            :py:meth:`~lakesuperior.endpoints.ldp.parse_repr_options` for
+            format details.
         :param str provided_imr: RDF data provided by the client in
         :param str provided_imr: RDF data provided by the client in
             operations such as `PUT` or `POST`, serialized as a string. This
             operations such as `PUT` or `POST`, serialized as a string. This
-            sets the `provided_imr` property.
+            sets the :py:data:`~Ldpr.provided_imr` property.
         """
         """
         self.uid = (
         self.uid = (
             rdfly.uri_to_uid(uid) if isinstance(uid, URIRef) else uid)
             rdfly.uri_to_uid(uid) if isinstance(uid, URIRef) else uid)