This is a rehaul of the previously added 'InstancesUploadEditor', which introduces
the TTL-template based creation of quads upon upload success using 'GitAnnexUploader'.
The previous component was specific to the 'TRR379Distribution' class, i.e. schema
specific, which made it useless in a general setting. The templating approach allows
it to be generalized to any class, provided that the deployment has an associated
TTL template for that class, along with additional config. This provisioning is
done via the standard config file, for example:
{
'component_config': {
'InstancesUploadEditor': {
'trr379ra:TRR379Document': {
'pid_template': 'trr379doc:{_randomUUID}',
'ttl_template': 'content:DocumentUploadTemplate'
}
}
}
}
The 'pid_template' field is necessary to specify how the pid for the root node in
the TTL template should be created. In the example, this would be for the node of
type 'trr379ra:TRR379Document'. A new helper utility function 'fillStringTemplate'
is used to process this template.
Template parameters are included into templates using curly braces syntax, e.g.
'{my_parameter}'.
The 'ttl_template' field either provides a serialization of the template TTL, or
points to a file containing the TTL template, using 'content:' syntax. An example
template file has been included in the docs public directory and can be referenced
in future documentation (TODO).
Some notable functionality:
- the pid template and TTL template for the given class are fetched in 'onMounted',
assuming that these have been appropriately configured upfront
- the 'InstancesUploadEditor' component 'provide's the 'triggerListGenAndItemSelect'
ref to its child 'InstancesSelectEditor', and triggers this every time a file is
successfully uploaded and needs to be set as the selected item.
- the 'InstancesUploadEditor' reacts to a form-close using the 'cancelButtonPressed'
ref. This is necessary because a file might have been uploaded already when a user
decides to cancel the editing process. At that time, the already created quads
need to be removed from the store. This is made possible by the 'ReactiveRdfDataset'
not allowing the return of an array of quads from the 'parseTTLandDedup' function.
- the 'InstancesUploadEditor' will match if a property shape has a 'nodeKind' that
is either 'BlankNodeOrIRI' or 'IRI', AND the property shape has an annotation from
the new 'shaclvue' namespace ('https://concepts.datalad.org/ns/shaclvue/'):
'SHACLVUE.gitAnnexUpload: true'. This matching might not occur as desired in a
'shacl-vue' deployment, because 'shacl-vue' does not yet support matching scores,
which would allow the 'InstancesUploadEditor' to be matched with priority over the
'InstancesSelectEditor', given their similar matching criteria. However, the
'InstancesUploadEditor' can be matched by using the existing config option
'editor_selection', for example:
editor_selection: {
'shaclvue:gitAnnexUpload': {
'true': 'InstancesUploadEditor'
}
}
28 lines
No EOL
1.4 KiB
Turtle
28 lines
No EOL
1.4 KiB
Turtle
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
@prefix trr379ra: <https://concepts.trr379.de/s/research-assets/unreleased/> .
|
|
@prefix trr379: <https://trr379.de/ns/> .
|
|
@prefix trr379doc: <https://trr379.de/ns/document/> .
|
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
@prefix dlthings: <https://concepts.datalad.org/s/things/v1/> .
|
|
@prefix dcat: <http://www.w3.org/ns/dcat#> .
|
|
@prefix dlflatfiles: <https://concepts.datalad.org/s/flat-files/unreleased/> .
|
|
@prefix dlidentifiers: <https://concepts.datalad.org/s/identifiers/unreleased/> .
|
|
@prefix dldi: <https://pid.datalad.org/distributions/> .
|
|
@prefix spdx: <http://spdx.org/rdf/terms#> .
|
|
@prefix dlfilesmx: <https://concepts.datalad.org/s/files-mixin/unreleased/> .
|
|
@prefix dlcommonmx: <https://concepts.datalad.org/s/common-mixin/unreleased/> .
|
|
|
|
{pid} a trr379ra:TRR379Document;
|
|
dlcommonmx:title "{name}".
|
|
dldi:{annexKey} a trr379ra:TRR379Distribution;
|
|
dlfilesmx:distribution_of {pid};
|
|
dlfilesmx:byte_size "{size}"^^xsd:nonNegativeInteger;
|
|
dlthings:characterized_by _:n0-1.
|
|
_:n0-1 a dlthings:Statement;
|
|
rdf:object <{downloadUrl}>;
|
|
rdf:predicate dcat:downloadUrl.
|
|
dldi:{annexKey} dlflatfiles:checksums _:n0-2.
|
|
_:n0-2 a dlidentifiers:Checksum;
|
|
dlidentifiers:notation "{hash}";
|
|
dlidentifiers:creator "http://spdx.org/rdf/terms#checksumAlgorithm_sha256"^^xsd:anyURI. |