Auto/increment

39 views
Skip to first unread message

Maja Kiszka

unread,
Nov 26, 2020, 11:04:46 AM11/26/20
to topbrai...@googlegroups.com
Hi,
 
Perhaps someone could help regarding the auto-increment functionality.
My goal is to create URI for each new object that consists of two parts:
  1. The class name – CL
  2. And the autoincremented number
So the example of an URI would be CL10001. In Manage tab in the Data Graph I am selecting URI Class prefix – name to satisfy point 1, and  then I define the counter to satisfy point 2.
 
However, when I am adding new instance to the graph EDG adds a dash in between CL and a number, resulting in following URI CL-10001, which is not what I want.
How can I prevent EDG from adding this unnecessary dash, so that the URI’s of the objects I create have the following URI CL10001, and not CL-10001?
Attached, you will find print screen from the settings.
 
All the best
Maja

Pat Doyle

unread,
Nov 26, 2020, 11:09:53 AM11/26/20
to TopBraid Suite Users
Maja,

We don't currently allow you to set the 'Prefix separator' to an empty string via the UI, but it can be done behind the scenes via SPARQL, which will ultimately get you the URIs you're looking for.


First, enable sparql updates on the EDG Server Administration page:
EnableSparqlUpdates.png

Next, go to <serverName>/edg/tbl/sparql, and run this query:

 INSERT {
  GRAPH <urn:x-evn-master:b.tch> {
<urn:x-evn-master:b.tch> <http://topbraid.org/teamwork#uriPrefixSeparator> ""
}
}WHERE  {  

}
And execute it, making sure to change the urn to point the .tch graph you're working with.  You should see this:
Insert.png

You can confirm the insert went OK by exporting the .tch graph from the Base URI Management page:
ConfirmUpdate.png

If this works correctly, you should then be getting the result you're looking for when creating a new resource:
URIResult.png

I'll see about adding the ability to set the prefix separator to an empty string in a cleaner way in a future version. 

Hope it helps,
Pat

--
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/82BCDB9C-85C9-4CC1-9D21-8914D1B63FB4%40gmail.com.

majaCap

unread,
Mar 12, 2021, 8:40:08 PM3/12/21
to TopBraid Suite Users
Thank you so much :) That worked

Br,
Maja

Reply all
Reply to author
Forward
0 new messages