Layer 1 Linked Data Platform Interface

Layer 1 operates as a Server in the Linked Data Platform protocol. It exposes a set of Linked Data Platform RDF Sources (LDP-RS) and Linked Data Platform Containers (LDPC) that provide clients with an interface for performing CRUD operations on Flexo MMS primitive objects. These objects include: orgs, projects, branches, locks, users, groups, roles, permissions and policies.

 

LDP Containers

  • /orgs

    • GET - enumerates orgs

  • /projects

    • GET - enumerates all projects user has access to

  • /projects/{PROJECT_ID}/branches

    • GET - enumerates all branches within a project that a user has access to

  • /projects/{PROJECT_ID}/branches/{BRANCH_ID}/commits

    • GET - enumerates all ancestor commits given the project and branch id

  • /projects/{PROJECT_ID}/locks

    • GET - enumerates all branches within a project that a user has access to

LDP Resources:

  • /orgs/{ORG_ID}

    • GET - returns 1-degree triples for the given org

    • PUT - creates a new organization

    • POST - modifies an existing organization

    • DELETE - deletes an existing organization

  • /projects/{PROJECT_ID}

    • GET - returns 1-degree triples for the given project

    • PUT - creates a new project

    • POST - modifies an existing project

    • DELETE - deletes an existing project

  • /projects/{PROJECT_ID}/branches/{BRANCH_ID}

    • GET - returns 1-degree triples for the given branch

    • PUT - creates a new branch

      • required triples: <#> mms:commit ?commit .

    • POST - modifies attributes of existing branch

    • DELETE - deletes an existing branch

  • /projects/{PROJECT_ID}/locks/{LOCK_ID}

    • GET - returns 1-degree triples for the given lock

    • PUT - creates a new lock

    • DELETE - deletes an existing lock

Possible response codes:

  • 200 - Success

  • 201 - Resource created (response to PUT)

  • 400 - Bad request, including but not limited to: non-RDF content-type, unsupported content-type, malformed RDF syntax

  • 401 - Unauthorized

  • 403 - Forbidden

  • 404 - Not found

  • 405 - Method not allowed

  • 406 - Invalid Accept headers

  • 412 - Precondition failed (reserved for conditional headers)

  • 422 - RDF body of the request missing required triple(s)

  • 5xx - Network errors communicating with the underlying triplestore, and wrapped non-2xx HTTP responses from the triplestore

 

Example: Creating a new branch

HTTP request sent from ‘client’ to Layer 1:

PUT /projects/TMT/branches/develop Content-Type: text/turtle prefix mms: <https://openmbee.org/rdf/mms/ontology/> base <../../> prefix mp-commit: <./commit/> <#> a mms:Branch ; mms:commit mp-commit:e4a1c .

SPARQL query sent from Layer 1 to the triplestore:

prefix mms: <https://openmbee.org/rdf/mms5/ontology/> prefix mms-datatype: <https://openmbee.org/rdf/mms5/datatype/> base <https://example.org/mms5/> prefix m-user: <./user> base <./projects/TMT/> prefix mp: <./> prefix mp-branch: <./branches/> prefix mp-commit: <./commits/> prefix mp-graph: <./graphs/> insert { graph mp-graph:Metadata { mp-branch:develop a mms:Branch ; mms:name "develop" ; mms:commit mp-commit:e4a1c ; mms:creator m-user:jdoe ; mms:created "2021-01-01T02:03:04.0506Z"^^xsd:dateTime ; mms:modified "2021-01-01T02:03:04.0506Z"^^xsd:dateTime ; . mp-snapshot:develop.e4a1c a mms:Snapshot ; mms:materializes mp-branch:develop ; mms:graph mp-graph:Model.develop.e4a1c ; . } } where { graph mp-graph:Metadata { filter not exists { { mp-branch:develop a mms:Branch . } union { ?branch a mms:Branch ; mms:name "develop" . } } } }; move mp-graph:Staging_0.master.e4a1c to mp-graph:Model.develop.e4a1c ;

HTTP response returned from Layer 1 back to ‘client’:

201 Created Content-Type: text/turtle @prefix mms: <https://openmbee.org/rdf/mms/ontology/> . @prefix mp: <https://example.org/mms/projects/TMT/> . @prefix mp-branch: <https://example.org/mms/projects/TMT/branches/> . @prefix mp-commit: <https://example.org/mms/projects/TMT/commits/> . mp-branch:develop a mms:Branch ; mms:name "develop" ; mms:commit mp-commit:e4a1c ; mms:creator m-user:jdoe ; mms:created "2021-01-01T02:03:04.0506Z"^^xsd:dateTime ; mms:modified "2021-01-01T02:03:04.0506Z"^^xsd:dateTime .