Microservice to construct and validate a submission harvested from a published document
3.9K
Microservice to construct and validate a submission harvested from a published document or sent manually.
Add the following snippet to your docker-compose.yml:
validate-submission:
image: lblod/validate-submission-service
volumes:
- ./config/semantic-forms:/share/semantic-forms
- ./data/files/submissions:/share/submissions
The volume mounted in /share/semantic-forms must contain all the Turtle files containing current and deprecated form definitions. We recommend adding a timestamp to the Turtle file names to differentiate them over time.
The volume mounted in /share/submissions must contain the Turtle files containing the data harvested from the published documents. The resulting Turtle files to fill in the forms will also be written to this folder.
Configure the delta-notification service to send notifications on the /delta endpoint when an automatic submission task is read for validation. Add the following snippet in the delta rules configuration of your project:
export default [
{
match: {
predicate: {
type: 'uri',
value: 'http://www.w3.org/ns/adms#status'
},
object: {
type: 'uri',
value: 'http://lblod.data.gift/automatische-melding-statuses/ready-for-validation'
}
},
callback: {
url: 'http://validate-submission/delta',
method: 'POST'
},
options: {
resourceFormat: 'v0.0.1',
gracePeriod: 1000,
ignoreFromSelf: true
}
}
]
POST /delta
Triggers the construction and validation of a submission for a harvested publication.
The service is triggered by updates of resources of type melding:AutomaticSubmissionTask of which the status is updated to http://lblod.data.gift/automatische-melding-statuses/ready-for-validation .
The delta handling consists of 2 steps:
PUT /submission-documents/:uuid
expected payload: {
additions: '',
removals: ''
}
Update a submission document based on the submitted document uuid. The additions and removals are written to TTL files. The current state of the filled in form is also written to a separate TTL file.
POST /submission-document/:uuid/submit
Submits a submission document if it's valid.
A resource describing the status and progress of the processing of an automatic submission.
melding:AutomaticSubmissionTask
The model is specified in the README of the automatic submission service.
Once the validation process starts, the status of the automatic submission task is updated to http://lblod.data.gift/automatische-melding-statuses/validating.
On successful completion, the status of the automatic submission task is updated to http://lblod.data.gift/automatische-melding-statuses/successful-concept or http://lblod.data.gift/automatische-melding-statuses/successful-sent, depending whether the submission landed in 'concept' or in 'sent' status.
On failure, the status is updated to http://lblod.data.gift/automatische-melding-statuses/failure.
Submission to be validated and submitted.
meb:Submission
For a full list of properties of a submission, we refer to the automatic submission documentation. The relevant properties for the validate-submission service are listed below.
| Name | Predicate | Range | Definition |
|---|---|---|---|
| status | adms:status | skos:Concept | Status of the submission |
| submittedResource | dct:subject | foaf:Document | Document that is the subject of the submission |
The status of a submission will be updated if the form is valid and submission is requested.
Possible statuses of a submission are:
foaf:Document (and ext:SubmissionDocument)
| Name | Predicate | Range | Definition |
|---|---|---|---|
| source | dct:source | nfo:FileDataObject | TTL files containing data about the submitted document. The TTL files have different types |
TTL file containing triples used to fill in a form.
nfo:FileDataObject
| Name | Predicate | Range | Definition |
|---|---|---|---|
| type | dct:type | nfo:FileDataObject | Type of the TTL file (additions, removals, meta, form, current filled in form data) |
Additional properties are specified in the model of the file service.
Possible values of the file type are:
The following services are also involved in the automatic processing of a submission:
Content type
Image
Digest
sha256:2aea55f18…
Size
503.6 MB
Last updated
3 months ago
docker pull lblod/validate-submission-service