On 2021-06-24 4:06 pm, Simon Opper wrote:
Hi folks
I wish to be able to add additional user field value entries when a
user creates new resources in edg. Or otherwise enforce that these
values are added at creation. It is not quite sufficient to use just
the usual shacl constraints for min count of values on forms, after
the resource has already been created.
I suspect this is controlled mostly declaratively by the javascript
for the resource creation dialogue pop up, which I've inspected for
example when a new skos concept is created.
My use case is for example if I've defined a class with a set of
attributes and I would like to present selected attributes to the user
that must be completed when a new instance of that class is created.
According to the source code, the dialog will show all fields that have
minCount > 0 or have dash:propertyRole dash:IDRole. See
http://datashapes.org/propertyroles.html#IDRole
I guess none of those mechanisms would fit for your properties? If they
must be entered, then why not use sh:minCount 1?
In general, I have to say I am not a fan of offering too much redundancy
here; too many ways of achieving the same things. Once a resource is
created, it will be shown on the form and in edit mode. Can you help me
understand why that wouldn't be enough?
Ideally I would also like to trigger a swp script or other triple rule
to run some other entailed graph work when the resource is created. At
present we are relying on the transform tab to run rules manually or
sparql queries but this is sub optimal.
Is there any quick wins to customize this without having to get into
UX javascript changes ?
Open teamwork.ui.ttlx and look at teamwork:IncrementCounterEditRule for
an example of an EditRule. These SWP scripts can check ui:addedGraph to
see which new rdf:type triples (i.e. which new instances) have been
created. You could then perform post-processing actions depending on the
type.
Holger
Many thanks in advance
Simon
--
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/819134e9-4e5b-4d3c-9a31-a9137aad41e1n%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/819134e9-4e5b-4d3c-9a31-a9137aad41e1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups "TopBraid
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/0f782ab7-a6df-c4ce-5162-80b83ea8cfca%40topquadrant.com.