Make a dropdown with calculated values

16 views
Skip to first unread message

Ad Reuijl

unread,
Mar 4, 2024, 9:48:21 AMMar 4
to TopBraid Suite Users
Hi Holger, 

Capture.PNG


I  have a class, that has some instances. i'm showing them in the frontend via a sh:values rule. 


werkwijzeFrontend:Resource-keuzenlijst
  a sh:PropertyShape ;
  sh:path werkwijzeFrontend:keuzenlijst ;
  sh:group tosh:LabelsPropertyGroup ;
  sh:description "keuzelijst" ;
  sh:name "keuzen" ;
  sh:values [  
  sh:select """
 
SELECT DISTINCT ?listOfValues
  WHERE {
$this owl:equivalentClass ?class.
?class owl:oneOf ?list.
?list rdf:rest*/rdf:first ?listOfValues

}
  """ ;
       
    ] ;
  sh:order "11"^^xsd:decimal ;
.
(yes this is a bit of a weird query, but there are reasons ;) )
Now i want the user to have a dropdown to select one of these values. Until now i managed with the use of sh:class and sh:node. for example

  werkwijzeFrontend:PropertyShape-kenmerkenToevoegen
  a sh:PropertyShape ;
  sh:path ddschange:toeTeVoegenKenmerkProperty;
  #sh:class dds:Kenmerk ;
  sh:class owl:Class;
  sh:node werkwijzeFrontend:NodeShape-Kenmerk;
  sh:description "Maak een toevoegingsverzoek aan voor een kenmerk" ;
  sh:group werkwijzeFrontend:ToevoegingenPropertyGroup ;
  sh:name "voeg kenmerk(en) toe" ;
  sh:order "6"^^xsd:decimal ;
.
werkwijzeFrontend:NodeShape-Kenmerk a sh:NodeShape;
    sh:property [
      sh:path rdfs:subClassOf;
      sh:hasValue dds:SpecifiekKenmerk;
    ]
  ;
.
 but in this case i need to refer to $this. Is this possible? Could you please help me, i have been searching and searching but cant find anything. 

Regards,
Ad Reuijl

Holger Knublauch

unread,
Mar 4, 2024, 10:24:36 AMMar 4
to topbrai...@googlegroups.com
Hi Ad,

not sure if I understand the scenario correctly. Do you mean:

1) One property is dynamically computed using sh:values
2) Another property shall be edited as a drop-down list populated with those values?

Holger



On 4 Mar 2024, at 2:48 pm, Ad Reuijl <adre...@gmail.com> wrote:

Hi Holger, 
--
The topics of this mailing list include TopBraid EDG and related technologies such as SHACL.
To post to this group, send email to topbrai...@googlegroups.com
---
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/3acacde6-a807-475d-97c8-ff003113c67bn%40googlegroups.com.
<Capture.PNG>

Ad

unread,
Mar 4, 2024, 11:22:39 AMMar 4
to topbrai...@googlegroups.com
Yes indeed, exactly that. 
Regards,

Op ma 4 mrt 2024 16:24 schreef Holger Knublauch <hol...@topquadrant.com>:

Holger Knublauch

unread,
Mar 4, 2024, 11:39:58 AMMar 4
to 'Richard Nagelmaeker' via TopBraid Suite Users
Ok, that's what I thought. We do not have such a widget yet. I guess it could become a new kind of constraint where the allowed values are dynamically computed. This would be similar to sh:in but with a sh:values rule underneath.

So, you have been searching thoroughly and did not find it because it really doesn't exist. But it's a good requirement that I have ran into before.

Holger


Ad

unread,
Mar 5, 2024, 2:41:47 AMMar 5
to topbrai...@googlegroups.com
Thanks Holger,
Saves a lot of time searching :) 

Regards, Ad

Op ma 4 mrt 2024 17:39 schreef Holger Knublauch <hol...@topquadrant.com>:
Reply all
Reply to author
Forward
0 new messages