GraphQL and UUID URI

69 views
Skip to first unread message

Fan Li

unread,
Jul 28, 2020, 9:30:17 AM7/28/20
to TopBraid Suite Users
I am very excited to explore the GraphQL capability in EDG but it seems class with UUID URI has some readability issue  in GraphQL query.

A comparison: 

A GraphQL query for class ex:carModel:
{
ex_carModel (orderBy: label) {
label
}
}

 A GraphQL query for class ex:c87d21f6-2c4e-11b2-8091-0242ac120019:
{
ex_c__d__f___c_e___b___________ac______s (orderBy: label) {
label
}
}

Since I don't have the option to change the ontology, is there anything else I can do?


Holger Knublauch

unread,
Jul 28, 2020, 7:16:20 PM7/28/20
to topbrai...@googlegroups.com

Hi Fan Li,

you can attach a graphql:name to your class/node shape or to property shapes. In your case, try adding a triple

ex:c87d21f6-2c4e-11b2-8091-0242ac120019 graphql:name "carModel"

The values of graphql:name must be valid GraphQL identifiers, i.e. not contain spaces or special characters. It's just an annotation property that doesn't really change your ontology - other tools will just ignore this triple.

You may need to edit the source code to add the triple above.

Holger

--
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/b825d2d5-6e52-466e-b134-4ba71452f061n%40googlegroups.com.

Fan Li

unread,
Jul 28, 2020, 9:55:25 PM7/28/20
to TopBraid Suite Users
Thanks, Holger. This is exactly what I need.

Fan Li

unread,
Jul 28, 2022, 2:23:21 PM7/28/22
to TopBraid Suite Users
Hi Holger, I am following up on this previous question regarding UUID URI and GraphQL. While using the graphql:name triple makes GraphQL query more readable, in ADS script the auto-generated API still uses the UUIDs as class names which is difficult to use. Any suggestions?

2022-07-28 142122.png

Holger Knublauch

unread,
Jul 28, 2022, 2:39:58 PM7/28/22
to topbrai...@googlegroups.com
Hi Fan Li,

there is currently no way to control this further - the class name uses the local name only. You're right that it could potentially use graphql:name for that purpose and I have taken a note for that. But I haven't heard this need from other customers.

Holger


On 28 Jul 2022, at 2:23 pm, Fan Li <lifa...@gmail.com> wrote:

Hi Holger, I am following up on this previous question regarding UUID URI and GraphQL. While using the graphql:name triple makes GraphQL query more readable, in ADS script the auto-generated API still uses the UUIDs as class names which is difficult to use. Any suggestions?

Fan Li

unread,
Jul 28, 2022, 3:33:54 PM7/28/22
to TopBraid Suite Users
Thanks, Holger. Customization via something like graphql:name or dash:className would it more user friendly. But I can live with the UUID class names for now.

Holger Knublauch

unread,
Aug 12, 2022, 12:31:07 PM8/12/22
to topbrai...@googlegroups.com
FYI with 7.4 onwards it will be possible to customize the generated JS class name using graphql:name at the class/node shape.

Holger
Reply all
Reply to author
Forward
0 new messages