lakesuperior.endpoints package¶
Submodules¶
lakesuperior.endpoints.admin module¶
lakesuperior.endpoints.ldp module¶
-
lakesuperior.endpoints.ldp.
DEFAULT_RDF_MIMETYPE
= 'text/turtle'¶ Fallback serialization format used when no acceptable formats are specified.
-
lakesuperior.endpoints.ldp.
delete_resource
(uid)[source]¶ Delete a resource and optionally leave a tombstone.
This behaves differently from FCREPO. A tombstone indicated that the resource is no longer available at its current location, but its historic snapshots still are. Also, deleting a resource with a tombstone creates one more version snapshot of the resource prior to being deleted.
In order to completely wipe out all traces of a resource, the tombstone must be deleted as well, or the
Prefer:no-tombstone
header can be used. The latter will forget (completely delete) the resource immediately.
-
lakesuperior.endpoints.ldp.
get_resource
(uid, out_fmt=None)[source]¶ https://www.w3.org/TR/ldp/#ldpr-HTTP_GET
Retrieve RDF or binary content.
Parameters:
-
lakesuperior.endpoints.ldp.
get_version
(uid, ver_uid)[source]¶ Get an individual resource version.
Parameters:
-
lakesuperior.endpoints.ldp.
get_version_info
(uid)[source]¶ Get version info (fcr:versions).
Parameters: uid (str) – UID of resource to retrieve versions for.
-
lakesuperior.endpoints.ldp.
ldp
= <flask.blueprints.Blueprint object>¶ Blueprint for LDP REST API. This is what is usually found under
/rest/
in standard fcrepo4. Here, it is under/ldp
but initially/rest
will be kept for backward compatibility.
-
lakesuperior.endpoints.ldp.
parse_repr_options
(repr_options, out_headers)[source]¶ Set options to retrieve IMR.
Ideally, IMR retrieval is done once per request, so all the options 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
: TODOincl_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 forincl_srv_mgd
which is onlyFalse
if thereturn
representation isminimal
.:param dict repr_options:: Options parsed from Prefer header. :param dict out_headers:: Response headers.
-
lakesuperior.endpoints.ldp.
patch_resource
(uid, is_metadata=False)[source]¶ https://www.w3.org/TR/ldp/#ldpr-HTTP_PATCH
Update an existing resource with a SPARQL-UPDATE payload.
-
lakesuperior.endpoints.ldp.
patch_version
(uid, ver_uid)[source]¶ Revert to a previous version.
NOTE: This creates a new version snapshot.
Parameters:
-
lakesuperior.endpoints.ldp.
post_resource
(parent_uid)[source]¶ https://www.w3.org/TR/ldp/#ldpr-HTTP_POST
Add a new resource in a new URI.
-
lakesuperior.endpoints.ldp.
put_resource
(uid)[source]¶ https://www.w3.org/TR/ldp/#ldpr-HTTP_PUT
Add or replace a new resource at a specified URI.
-
lakesuperior.endpoints.ldp.
rdf_parsable_mimetypes
= {'application/ld+json', 'application/n-quads', 'application/n-triples', 'application/rdf+xml', 'application/svg+xml', 'application/trix', 'application/xhtml+xml', 'text/html', 'text/n3', 'text/turtle'}¶ MIMEtypes that can be parsed into RDF.
-
lakesuperior.endpoints.ldp.
rdf_serializable_mimetypes
= {'application/ld+json', 'application/n-triples', 'application/rdf+xml', 'text/n3', 'text/turtle'}¶ MIMEtypes that RDF can be serialized into.
These are not automatically derived from RDFLib because only triple (not quad) serializations are applicable.
-
lakesuperior.endpoints.ldp.
std_headers
= {'Accept-Patch': 'application/sparql-update', 'Accept-Post': 'application/ld+json,application/svg+xml,text/turtle,application/xhtml+xml,application/rdf+xml,text/n3,application/n-triples,application/trix,text/html,application/n-quads'}¶ Predicates excluded by view.
-
lakesuperior.endpoints.ldp.
tombstone
(uid)[source]¶ Handle all tombstone operations.
The only allowed methods are POST and DELETE; any other verb will return a 405.
-
lakesuperior.endpoints.ldp.
vw_blacklist
= {}¶ Prefer representations currently supported