Patch to update 6-digit Counter Semantic Turkey URIGenerator to ST 13

57 views
Skip to first unread message

Saku Seppälä

unread,
Nov 27, 2024, 7:36:39 AM11/27/24
to semanticturkey-developer
Hello all,

The adoption of Vocbench is progressing at NatlibFi and as part of that process I updated the "6-digit Counter Semantic Turkey URIGenerator" plugin by Manuel Fiorelli to be compatible with Semantic Turkey 13 (https://bitbucket.org/manuelfiorelli/sixdigit-counter-st-urigen). In the end, this update was surprisingly easy, considering the recent extensive changes in the Semantic Turkey backend, kudos to all involved for making this so straight forward.

Before we consider making any larger NatlibFi specific changes to this plugin, I wanted to share my changes to the code, so they could be imported back to the project. Based on light testing, everything seems to be working correctly (including the unit tests). There were some code issues in the compatibility layer code to pre ST 6.0 versions, which I just solved by removing all the compatibility code. Hopefully this is not relevant anymore.

The attached patch file contains my changes to make sixdigit-counter-st-urigen compatible with ST 13. Hopefully, it can also be an example for someone looking to create some other type of extension to Semantic Turkey > 13.

Kind regards, Saku Seppälä
sixdigit-counter-st-urigen-4-0.patch

Manuel Fiorelli

unread,
Dec 6, 2024, 3:05:16 AM12/6/24
to Saku Seppälä, semanticturk...@googlegroups.com
I am sending this message a second time because it does not seem to have found its way to the ML.

On Tue, Dec 3, 2024 at 10:48 PM Manuel Fiorelli <manuel....@gmail.com> wrote:
Hello Saku,

Thanks for another contribution to Semantic Turkey & friends.

I just merged your patch with minor changes, such as using a mock for an ApplicationEventPublisher instead of a full-blown application context, and raising the required Java level to 17 (matching the requirements of Semantic Turkey).

If you can, download the updated sources and check if they work in your scenario, so I can tag a new version.

Best regards,
Manuel

--
Hai ricevuto questo messaggio perché sei iscritto al gruppo "semanticturkey-developer" di Google Gruppi.
Per annullare l'iscrizione a questo gruppo e non ricevere più le sue email, invia un'email a semanticturkey-dev...@googlegroups.com.
Per visualizzare questa discussione, visita https://groups.google.com/d/msgid/semanticturkey-developer/af622ecc-afc6-4cdf-8c38-bce56c4ff771n%40googlegroups.com.


--
Manuel Fiorelli


--
Manuel Fiorelli

Saku Seppälä

unread,
Dec 9, 2024, 9:38:25 AM12/9/24
to semanticturkey-developer

Hi Manuel,

thank you for merging my changes, I compiled the plugin again from your sources, tested it, and everything worked fine.

I have one more change I would like to submit and it is about allowing full URIs in the templates. This way you could create URIs that are in different namespace than the project default. Another related change is that the first variable is not URL-encoded if it is valid URI. This allows user to derive URI from a related URI.

an example:

templates:
  concept: "http://www.yso.fi/onto/yso/p${seq(concept)}"
  xLabel: "${lexicalizedResource}#xl${lexicalizationProperty.LocalName}_${lexicalForm.language}_${seq(xLabel)}"

would create following URIs

http://www.yso.fi/onto/yso/p000575
http://www.yso.fi/onto/yso/p000575#xlprefLabel_en_000793

If you don't see anything wrong in this change and think it could be useful, I have attached a patch file containing the changes to this message.

Kind regards, Saku Seppälä
sixdigit-counter-st-urigen-4-0-fullURI.patch

Manuel Fiorelli

unread,
Dec 18, 2024, 11:10:23 AM12/18/24
to semanticturk...@googlegroups.com, Saku Seppälä
Dear Saku,

I apologize for the very late reply.

I'm glad the code worked for you.

The additional changes you suggested look interesting. So interesting, in fact, that I wonder if we should "promote" them to the URI generators shipped with VocBench. Since I want the 6-digit counter URI generator to be consistent with the built-in generators, I first need to verify that your suggestions do not interfere with the current behavior of the latter. For example, these URI generators (not sure about the one you are extending) use the syntax $${placeholder-name} to skip percent encoding: I should verify if we want a more implicit mechanism as you proposed. Also, I should check if we really want the implicit fallback to URI.

I will probably look into this after the Christmas holidays.

Regards,
Manuel




--
Manuel Fiorelli

Saku Seppälä

unread,
Jan 24, 2025, 6:03:43 AMJan 24
to semanticturkey-developer
Hi Manuel,

apologies for the very late reply also.

I am very glad if my little changes could have some benefit in the larger context of the ST-project. I could easily imagine that these general features could be useful also for other users.

Btw, there was no double $$ syntax for skipping the percentage coding in the six-digit-counter. To me this sounds better solution then the one I made, as it allows for more detailed control of the process. One reason for my implementation was that i just didn't want to make big changes to the original code. If I have the time in the future, I might try to implement this $$-syntax in the six-digit-counter.

Kind regards, Saku Seppälä

Manuel Fiorelli

unread,
Feb 12, 2025, 6:35:19 PMFeb 12
to semanticturk...@googlegroups.com
Dear Saku,

I am glad to hear that you like the $$ syntax. Unfortunately, we haven't still had time to discuss this in details, but my "dream" is to integrate the counting capability straight into the predefined implementation shipped with ST:

Regards
Manuel



--
Manuel Fiorelli

Saku Seppälä

unread,
Apr 9, 2025, 5:01:46 AMApr 9
to semanticturkey-developer
Hello Manuel,

I hope you are doing well. I just noticed that you have not had the time to do the verification and integrate my previous patch. You must have loads of more important work to attend, but could I ask you to tag the current sixdigit-counter-st-urigen Bitbucket code base as release 4.0? I have a couple of small customizations I would like to maintain as a separate patch and it would be convenient if there was a definite release point to which align the changes to. 

Btw, I just tested 6-digit Counter Semantic Turkey URIGenerator plugin that was compiled against ST 13 with the new ST 14 version and it worked without problems, nice.

Kind regards, Saku Seppälä

Manuel Fiorelli

unread,
Jul 5, 2025, 4:05:28 PMJul 5
to semanticturk...@googlegroups.com
Hello Saku,

I apologize for overlooking your email for so long. I've tagged the code.

Regards,
Manuel



--
Manuel Fiorelli
Reply all
Reply to author
Forward
0 new messages