Displaying complex inferred values in EDG

132 views
Skip to first unread message

Rebecca Jackson

unread,
Feb 7, 2024, 4:55:04 PM2/7/24
to TopBraid Suite Users
I am curious if it is possible to display inferred values in a "Details Viewer": https://datashapes.org/forms.html#DetailsEditor

Specifically, we want a constructed blank node that shows two property/value pairs in the box and is automatically generated from a SPARQL query, and is therefore not editable. It should also be updated if the inference changes. I would usually just use `sh:values` but I'm not sure it is possible to construct a new blank node in this way.

If this is possible, what is the implementation?

Holger Knublauch

unread,
Feb 7, 2024, 5:01:39 PM2/7/24
to 'Branson, GaBriella C' via TopBraid Suite Users
No, this is not possible because inferred values can only be immediate, but what you describe sounds like the inferred blank node itself would need yet more inferred triples.

If you are familiar with JavaScript/ADS you could have a sh:values rule that infers an rdf:HTML literal instead, and that HTML literal could render whatever HTML you want, including something that looks like a nested form/details viewer.

Ask back if you need more guidance.

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/b83101e8-2937-488b-a66b-5ef365c4bd6en%40googlegroups.com.

Rebecca Jackson

unread,
Feb 8, 2024, 8:57:33 AM2/8/24
to TopBraid Suite Users
the inferred blank node itself would need yet more inferred triples
Yes, this is exactly what we need. My next step was to use ADS, but I wanted to see if it was possible using SHACL/SPARQL first. I will look into the HTML literal, thank you!

Rebecca Jackson

unread,
Feb 8, 2024, 4:08:48 PM2/8/24
to TopBraid Suite Users
Hi again Holger,

I've got the form generating now, but I would like to utilize the URIViewer on these labels, like the DescriptionViewer box. Is there an easy way to get the link configured with ADS? Otherwise I guess I can manually build the <a href>. Right now, this is just displaying plain text... I'm guessing there is something configured in the javascript for the page...?

Screen Shot 2024-02-08 at 1.07.07 PM.png

graph.html(`
<div class="DetailsViewer" style="display: inline-block;">
<table class="LabeledComponentTable">
<tbody>
<tr>
<td class="LabeledComponentLabelColumn LabeledComponentLabelColumnViewing">
<div class="LabeledComponentLabel">
<label>allowance:</label>
</div>
</td>
<td class="LabeledComponentMiddleColumn"></td>
<td class="LabeledComponentBody">
<table class="ViewerRow" style="width: 100%;">
<tr>
<td class="FormFieldRowValue">
<div class="URIViewer">
<a href="javascript:void(0)">${c}</a>
</div>
</td>
</tr>
</table>
<div style="height: 0.6em;"></div>
</td>
</tr>
</tbody>
</table>
<table class="LabeledComponentTable">
<tbody>
<tr>
<td class="LabeledComponentLabelColumn LabeledComponentLabelColumnViewing">
<div class="LabeledComponentLabel">
<label>source:</label>
</div>
</td>
<td class="LabeledComponentMiddleColumn"></td>
<td class="LabeledComponentBody">
<table class="ViewerRow" style="width: 100%;">
<tr>
<td class="FormFieldRowValue">
<div class="URIViewer">
<a href="javascript:void(0)">${a}</a>
</div>
</td>
</tr>
</table>
<div style="height: 0.6em;"></div>
</td>
</tr>
</tbody>
</table>
</div>`);

Holger Knublauch

unread,
Feb 9, 2024, 6:51:55 AM2/9/24
to 'Branson, GaBriella C' via TopBraid Suite Users
Hi Rebecca,

we unfortunately don't have something that would make the below much simpler. Ideally, we would have web components that you could use here, e.g. for the details viewer, but we don't. So reusing similar markup and CSS classes is the best bet right now.

For hyperlinks to resources, I just tested that you can just use the URI of the resource as value of href and the system would redirect them to internal links within TopBraid. For example:

graph.html('<a href="http://topquadrant.com/ns/examples/geography#Africa">Africa</a>')

should create the right thing, assuming the href links to an asset in the RDF graphs. So for any NamedNode, use

graph.html(`<a href="${node.uri}">{node}</a>`)

Have you tried that?

Holger


On 8 Feb 2024, at 10:08 pm, Rebecca Jackson <rjac...@imohealth.com> wrote:

Hi again Holger,

I've got the form generating now, but I would like to utilize the URIViewer on these labels, like the DescriptionViewer box. Is there an easy way to get the link configured with ADS? Otherwise I guess I can manually build the <a href>. Right now, this is just displaying plain text... I'm guessing there is something configured in the javascript for the page...?

Reply all
Reply to author
Forward
0 new messages