Create Custom Data Entry Form based on EDG

31 views
Skip to first unread message

Fan Li

unread,
Nov 5, 2020, 9:36:09 AM11/5/20
to TopBraid Suite Users
Hello Irene & Holger, I need to create a web page of a data entry form (with SHACL validation) based on EDG for end users. I am confused if such custom development should be done via SWP or GraphQL. My understanding is that SWP will generate the UI directly whereas GraphQL needs a separate front-end app (such as built in React). Would you please provide some clarification & recommendation?

Holger Knublauch

unread,
Nov 5, 2020, 6:25:54 PM11/5/20
to topbrai...@googlegroups.com

Hi Fan Li,

this is a very complex topic. I guess you need to decide which technology to use to create the client code, and another to handle the edits on the server. There are so many choices. SWP can in principle be used both to generate HTML but also to implement services that take input values and turn them into RDF triples. But GraphQL mutations already do the latter too. So if you have relatively simple forms where each input field matches a GraphQL field then you could use any 3rd party technology such as React to implement the client. Having said this you could even do everything in React or vanilla JavaScript and have the client create SPARQL UPDATE requests.

Really hard to answer without a longer discussion about your requirements. A related question is if you even consider using SWP then could your requirements be handled by a plugin to EDG, and if yes then what is missing about using EDG directly.

Holger


On 11/6/2020 12:36 AM, Fan Li wrote:
Hello Irene & Holger, I need to create a web page of a data entry form (with SHACL validation) based on EDG for end users. I am confused if such custom development should be done via SWP or GraphQL. My understanding is that SWP will generate the UI directly whereas GraphQL needs a separate front-end app (such as built in React). Would you please provide some clarification & recommendation? --
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 topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/7165f71d-36b0-48c3-8349-8887ced487e9n%40googlegroups.com.

Fan Li

unread,
Nov 5, 2020, 7:12:08 PM11/5/20
to topbrai...@googlegroups.com
Hi Holger, thanks for your reply. I have a very simple form (3 or 4 fields) and the main purpose is to be able to perform SHACL validation on submitted results. Would it be better to do everything in SWP, or use combination of React and EDG APIs? The latter seems to be an overkill.

Holger Knublauch

unread,
Nov 5, 2020, 7:46:28 PM11/5/20
to topbrai...@googlegroups.com

For such a simple form, you could even do an almost static HTML page, which calls the GraphQL mutation service. You can check the network traffic when you save changes on an EDG form, and your form could call something similar. The GraphQL mutation will first perform a "dry run" of the change to see if it would cause violations. If none are reported, it will commit the change. Here is an example snippet that will perform validation and only commit if there are no violations.

mutation saveFormChanges { ... do your actual changes here, try it out on the GraphiQL editor's auto-complete results { message severity focusNode { label uri } path pathLabel value { label uri } constraintComponentName sourceShape { label uri } } commit(message: "Form edits for XY", strict: true) }

This topic of custom code development goes beyond what we can typically support on this mailing list. TSM tickets or premium support are preferred.

Regards,
Holger

Fan Li

unread,
Nov 5, 2020, 8:35:02 PM11/5/20
to topbrai...@googlegroups.com
Thanks for the example! I wake up every day realizing there are more to learn about EDG.

Reply all
Reply to author
Forward
0 new messages