sh:class in Active Data Shapes

39 views
Skip to first unread message

Matt Goldberg

unread,
Mar 26, 2021, 2:38:52 PM3/26/21
to TopBraid Suite Users
Hello-

I just downloaded TBC 7.0 and I've started experimenting with active data shapes, and so far it seems that it will be very useful for us.

I was experimenting with a property shape as the focusNode and as expected there were attributes for all the SHACL and DASH constraint component properties that I could think of at the time, except for sh:class. I see attributes for the DASH properties hasValueWithClass, rootClass, and uniqueValueForClass, but nothing in the autocomplete dropdown looks like it corresponds to sh:class. For the sake of it I tried focusNode.class in the Script Editor and got void unexpectedly.

Am I missing it or is it missing? 

Thanks.

Holger Knublauch

unread,
Mar 27, 2021, 3:47:17 AM3/27/21
to topbrai...@googlegroups.com

Hi Matt,

On 27/03/2021 4:38 am, Matt Goldberg wrote:
Hello-

I just downloaded TBC 7.0 and I've started experimenting with active data shapes, and so far it seems that it will be very useful for us.
Thanks, your feedback is appreciated.


I was experimenting with a property shape as the focusNode and as expected there were attributes for all the SHACL and DASH constraint component properties that I could think of at the time, except for sh:class. I see attributes for the DASH properties hasValueWithClass, rootClass, and uniqueValueForClass, but nothing in the autocomplete dropdown looks like it corresponds to sh:class. For the sake of it I tried focusNode.class in the Script Editor and got void unexpectedly.

This looks like a simple omission. It will show up once you add a triple

sh:PropertyShape
  sh:property sh:ClassConstraintComponent-class ;

and the values will be correctly typed as rdfs_Class instances.

I have not yet checked whether this would have any unintended side effects, but have recorded a ticket to get this in for a future version. You could either add this locally, or use propertyShape.value(sh.class) or, as always, graph.triples(propertyShape, sh.class, null)

Holger



Am I missing it or is it missing? 

Thanks.
--
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/602a674e-9f68-4b7a-aa52-d3d26343be62n%40googlegroups.com.

Matt Goldberg

unread,
Mar 29, 2021, 10:14:54 AM3/29/21
to TopBraid Suite Users
Thanks, that works!

Matt Goldberg

unread,
Mar 29, 2021, 12:49:22 PM3/29/21
to TopBraid Suite Users
Actually, I just noticed amother issue. If I have a property shape that has a ZeroOrMorePath in it, such as skos:broader*/skos:topConceptOf, this is the JavaScript that gets generated is as follows:

    /**

     * (No sh:description found)

     * The RDF path is (<http://www.w3.org/2004/02/skos/core#broader>)*/<http://www.w3.org/2004/02/skos/core#topConceptOf>

     * @returns {NamedNode}

     */

    get unnamedPathProperty() {

        return this.value('(<http://www.w3.org/2004/02/skos/core#broader>)*/<http://www.w3.org/2004/02/skos/core#topConceptOf>', NamedNode);

    }

    

    set unnamedPathProperty(value) {

        throw 'Property unnamedPathProperty is read-only because it is backed by a SHACL path expression.';

    }

 


This has a syntax error in the comment due to the property path which causes any Active Data Shapes request using that API file to return an error.

Holger Knublauch

unread,
Mar 29, 2021, 6:50:16 PM3/29/21
to topbrai...@googlegroups.com

Wow, that's quite a case. Fixed for 7.0.1.

Meanwhile, I guess sh:deactivated true should bypass such properties.

Thanks for the report
Holger

Reply all
Reply to author
Forward
0 new messages