model.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Lakesuperior Content Model Rationale
  2. ====================================
  3. Internal and Public URIs; Identifiers
  4. -------------------------------------
  5. Resource URIs are stored internally in Lakesuperior as domain-agnostic
  6. URIs with the scheme ``info:fcres<resource UID>``. This allows resources
  7. to be portable across systems. E.g. a resource with an internal URI of
  8. ``info:fcres/a/b/c``, when accessed via the
  9. ``http://localhost:8000/ldp`` endpoint, will be found at
  10. ``http://localhost:8000/ldp/a/b/c``.
  11. The resource UID making up the looks like a UNIX filesystem path,
  12. i.e. it always starts with a forward slash and can be made up of
  13. multiple segments separated by slashes. E.g. ``/`` is the root node UID,
  14. ``/a`` is a resource UID just below root. their internal URIs are
  15. ``info:fcres/`` and ``info:fcres/a`` respectively.
  16. In the Python API, the UID and internal URI of an LDP resource can be
  17. accessed via the ``uid`` and ``uri`` properties respectively:
  18. ::
  19. >>> import lakesuperior.env_setup
  20. >>> from lakesuperior.api import resource
  21. >>> rsrc = resource.get('/a/b/c')
  22. >>> rsrc.uid
  23. /a/b/c
  24. >>> rsrc.uri
  25. rdflib.terms.URIRef('info:fcres/a/b/c')
  26. Store Layout
  27. ------------
  28. One of the key concepts in Lakesuperior is the store layout. This is a
  29. module built with a specific purpose in mind, i.e. allowing fine-grained
  30. recording of provenance metadata while providing reasonable performance.
  31. Store layout modules could be replaceable (work needs to be done to
  32. develop an interface to allow that). The default (and only at the
  33. moment) layout shipped with Lakesuperior is the :mod:`resource-centric
  34. layout <lakesuperior.store.ldp_rs.rsrc_centric_layout>`. This
  35. layout implements a so-called `graph-per-aspect
  36. pattern <http://patterns.dataincubator.org/book/graph-per-aspect.html>`__
  37. which stores different sets of statements about a resource in separate
  38. named graphs.
  39. The named graphs used for each resource are:
  40. - An admin graph (``info:fcsystem/graph/admin<resource UID>``) which
  41. stores administrative metadata, mostly server-managed triples such as
  42. LDP types, system create/update timestamps and agents, etc.
  43. - A structure graph (``info:fcsystem/graph/structure<resource UID>``)
  44. reserved for containment triples. The reason for this separation is
  45. purely convenience, since it makes it easy to retrieve all the
  46. properties of a large container without its child references.
  47. - One (and, possibly, in the future, more user\-defined) named graph for
  48. user-provided data (``info:fcsystem/graph/userdata/_main<resource UID>``).
  49. Each of these graphs can be annotated with provenance metadata. The
  50. layout decides which triples go in which graph based on the predicate or
  51. RDF type contained in the triple. Adding logic to support arbitrary
  52. named graphs based e.g. on user agent, or to add more provenance
  53. information, should be relatively simple.