Adding an instance when using dash:ValueTableViewer

17 views
Skip to first unread message

Tim Smith

unread,
Aug 12, 2022, 1:20:24 PMAug 12
to TopBraid Suite Users
Hi,

I often use dash:ValueTableViewer to provide a richer experience for the user by bringing relevant details of the the objects to a single page vs the user having to click into each instance as would be required using the default list-like display.

However, when using a shape like this example:

pgont:Amalgamationable-composedOf_Table_view
  a sh:PropertyShape ;
  sh:path pgont:composedOf ;
  dash:composite true ;
  dash:viewer dash:ValueTableViewer ;
  sh:deactivated false ;
  sh:description "Things this instance is composed of or owns."@en ;
  sh:group pgont:StructurePropertyGroup ;
  sh:name "composed Of"@en ;
  sh:node pgont:ComposedOfTableView ;
  sh:nodeKind sh:IRI ;
  sh:order "10"^^xsd:decimal ;
.

It becomes impossible for the user to add a new triple using the composedOf property.  The ComposedOfTableView node shape does a great job of displaying the components of the parent instance and specified details.  However, the user cannot add a new object as the child of the parent.  

While making a dash:ValueTableEditor would be extremely useful, I appreciate the complexity such an endeavor would entail given the range of possible node shapes.  However, in my case, I only need the user to add a single instance using the composedOf property, not fill-out a row in the ValueTableViewer.

Is there away to enable this interaction?

If I didn't want to use dash:ValueTableEditor, I would use a simple shape like:

pgont:Amalgamationable-composedOf
  a sh:PropertyShape ;
  sh:path pgont:composedOf ;
  sh:class pgont:Amalgamationable ;
  sh:deactivated true ;
  sh:description "Things that this object is composed of.  e.g. Logical Systems, Attributes, Constraints, Physical Systems, etc..." ;
  sh:name "composed Of" ;
.

However, the two shapes cannot co-exist on the same class or EDG will get confused (you'll note that this one is deactivated).

At the moment, I cannot find a way to show my users the details they need while at the same time, enabling them to add more instances to the parent using the pgont:composedOf property.  (Well, short of creating another node shape for the same class and having the user flip between the the views)

Thank you for your thoughts,

Tim

Holger Knublauch

unread,
Aug 14, 2022, 12:37:05 PMAug 14
to topbrai...@googlegroups.com
Hi Tim

I believe I see what you mean. The dash:ValueTableViewer does NOT allow you to add new instances because

1) It doesn't even show up unless there already is a value
2) It doesn't have a New button, not even in Edit mode.

If I understand these issues correctly, I can file a dev ticket for myself to try to fix this for 7.4.
One potential fix would be to always make it visible in edit mode, and add a Plus button.
Another potential fix would be to just use the AutoComplete widget in edit mode.

Thanks,
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/73c708d1-078a-4e21-ac7c-b4cdb247d64bn%40googlegroups.com.

Matt Goldberg

unread,
Aug 14, 2022, 12:52:31 PMAug 14
to topbrai...@googlegroups.com
Another thing about the ValueTableViewer that I have found that could be useful in some occasions where the resources in the table are first class citizens, i.e. not just blank nodes created for the sake of being in a table: it would be nice if there existed a second version of that viewer that behaved the same way with an addition of a column prepended to the table that shows the link to the resource with the label like the default viewer (dash:LabelViewer I think), which not only would show the label for resources in the table but also would make it much easier to navigate to the page for the resources in the table.

Tim Smith

unread,
Aug 14, 2022, 1:10:32 PMAug 14
to topbrai...@googlegroups.com
Hi Holger, 

Either solution would be great!  

Thanks,

Tim


On Sun, Aug 14, 2022, 12:37 PM Holger Knublauch <hol...@topquadrant.com> wrote:

Holger Knublauch

unread,
Aug 15, 2022, 8:52:46 AMAug 15
to topbrai...@googlegroups.com
To add a link column, add a property shape such as

ex:MyTableColumns-link
  a sh:PropertyShape ;
  sh:path ex:link ;
  sh:name "link" ;
  sh:nodeKind sh:IRI ;
  sh:order "0"^^xsd:decimal ;
  sh:values sh:this .

to the node shape that declares the columns. The trick is to add an inferred value pointing at the focus node itself.

In the absence of this, the table viewer could indeed just have a button to automatically have such a column visible, as I guess it's a common requirement. Or, as you say, we could introduce a variation of that viewer that does it automatically.

Meanwhile, I guess the work-around above is probably good enough. Note that you could reuse the same property shape in all your table viewer node shapes, so overhead can be minimal.

Holger


Reply all
Reply to author
Forward
0 new messages