Custom form : current user ? concat ?

24 views
Skip to first unread message

Thomas Francart

unread,
Oct 22, 2025, 3:19:32 AM (4 days ago) Oct 22
to vocbench-user
Hello

My use-case involves trying to setup a custom form to track comments from users. Each comment would be associated to the user who placed the comment and the dateTime the comment was made. Ideally, the form would prompt only for the comment value and would insert automatically the user who placed the comment and the dateTime.

For the dateTime, by using the DatetimeConverter I can get the current dateTime automatically.

1. Would it be possible to retrieve the current *user* automatically through some converter ? Ideally also, some properties of this user, like its name
2. What I would like to do is to *concatenate* the dateTime and current user at the beginning or end of the comment value. Is it possible ? I could not find this feature in the PEARL documentation [1].

I would like to concatenate them in a single literal because, if left in separate predicates on a reified comment, a custom table view would not be able to display the comment until it is validated (my understanding being that the query for custom views works only on the content of the current project, and is not able to see neither the imported projects, neither the added or deleted triples pending validation - I tested that - but that is another topic)

Thanks !

[1] PEARL documentation : https://art.uniroma2.it/coda/documentation/pearl.jsf
--

Thomas Francart - SPARNA
linked data | domain ontologies | knowledge graphs
blog :
blog.sparna.fr, site : sparna.fr, linkedin : fr.linkedin.com/in/thomasfrancart
tel : 
 +33 (0)6.71.11.25.97

stel...@uniroma2.it

unread,
Oct 22, 2025, 4:04:10 AM (4 days ago) Oct 22
to Thomas Francart, vocbench-user

Dear Thomas,

 

A preliminary answer to give you something quickly; we can come back on this later to expand.

 

Good thing is you have the user’s URI with session/user. See:

https://vocbench.uniroma2.it/doc/user/cforms/index.jsf#the_nodes_section

 

for other special elements (e.g. the subject in the case of custom ranges, or all the values from the standard parts of the form) you can retrieve.

 

I’m afraid we cannot cover the “ideally” part of the request (other props of the user), as we thought the URI would be enough. Indeed, this could be part of a future extension, either with subfeatures such as session/user/furtherproperty and/or maybe a general exporter that can produce RDF fragments with information about users, that could be merged with data in several contexts.

 

For point 2 you could perform a chain. I’m sorry this part is not documented extensively as it was dropped and later reinstated in the PEARL grammar. I think now you can nest invocations, or (this I’m sure is possible) in any case, you can create nodes and pass nodes (so not just strings) to other converters. An example is given in:

 

https://art.uniroma2.it/coda/documentation/pearl.jsf#available_converters

 

see in particular the examples under these converters

coda:propPathIDResolver

coda:lexiconIDResolver

for an example of chains but, for the converters for you to use, I suggest:

  • coda:regexp to extract part of a resource’s string representation
  • coda:formatter to realize concatenations of strings (it’s similar to C/Java’s printf)

 

About reading other graphs, I think you are right but I’ve to check with my colleagues as I have a dejavu about dealing with graphs (but yes, it could be just a dejavu, or something we discussed but not implemented yet). I confess, my memory gets blurred on some of these aspects we might have added in the past if these are not refreshed by constant use, so thanks for bringing this up, it could be the occasion to document something missing or take a note for future evolutions :-)

 

Kind Regards,

 

Armando

 

 

--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vocbench-user/CAPugn7VTjzySRnZ9vFqM%2B4RHujCCPrEgk9ubx5x7KJUcWUUJwQ%40mail.gmail.com.

Thomas Francart

unread,
Oct 22, 2025, 4:56:37 AM (4 days ago) Oct 22
to stel...@uniroma2.it, vocbench-user
Thank you Armando ! I was able to extract the user email using the following line in a custom form:

```
user literal(coda:regexp("http://semanticturkey.uniroma2.it/users/(.*)", "$1")) session/user .
```

Thomas

stel...@uniroma2.it

unread,
Oct 23, 2025, 7:51:49 AM (3 days ago) Oct 23
to Thomas Francart, vocbench-user

Ahhhh, incidentally, your case was covered by the fact that default URIs for users (if they do not specify their own ones) have the email as their local names :-)

 

However, pls consider that this won’t work always then, if your users have instead defined a specific user URI.

 

Kind Regards,

 

Armando

 

Reply all
Reply to author
Forward
0 new messages