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 orgPUT
- creates a new organizationPOST
- modifies an existing organizationDELETE
- deletes an existing organization
/projects/{PROJECT_ID}
GET
- returns 1-degree triples for the given projectPUT
- creates a new projectPOST
- modifies an existing projectDELETE
- deletes an existing project
/projects/{PROJECT_ID}/branches/{BRANCH_ID}
GET
- returns 1-degree triples for the given branchPUT
- creates a new branchrequired triples:
<#> mms:commit ?commit .
POST
- modifies attributes of existing branchDELETE
- deletes an existing branch
/projects/{PROJECT_ID}/locks/{LOCK_ID}
GET
- returns 1-degree triples for the given lockPUT
- creates a new lockDELETE
- deletes an existing lock
Possible response codes:
200
- Success201
- Resource created (response toPUT
)400
- Bad request, including but not limited to: non-RDF content-type, unsupported content-type, malformed RDF syntax401
- Unauthorized403
- Forbidden404
- Not found405
- Method not allowed406
- InvalidAccept
headers412
- 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 .
Â