Hi Angelo,
using TBC-FE (Free Edition), SHACL-JS does work. I have tested your previous file, fixing the www. in the label of one instance and get this:

I agree debugging JS can be difficult from a Java-based tool that goes into the JS Nashorn engine. One way to debug things is to run the JS queries separately. The JavaScript Query view in TBC-FE could be used potentially:

Basically you could write your JS code there and put them into the .js file when you are confident they work.
Other than this, feel free to send a minimal and complete example of where you are stuck, here or on the shacl w3c mailing list.
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/33b1fe62-6984-4725-8183-1fc7efe2906d%40googlegroups.com.

propertyName = TermFactory.namedNode("http://www.example.org/ns#coordinates");
propertyObject = $data.find($this, propertyName, null) ;
for (t = propertyObject.next(); t; t = propertyObject.next()) {
coordTriple = propertyObject.next();
if (!coordTriple) {
return null;
}
coordinate = coordTriple.object;
if (coordinates.length < $minSize ) {
results.push({
value : coordinates
});
}
}
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/6d7682b3-1b84-3a5a-0af3-b962fa84c1a9%40topquadrant.com.
The syntax supported in the JS Query view is based on this library
https://github.com/TopQuadrant/shacl-js/blob/master/shared/rdfquery.js
which provides syntactic sugar to more efficiently walk through RDF results.
So instead of doing a "for" loop you can use match as in
var result = $data.query().
match("owl:Class", "rdfs:label", "?label").
match("?otherClass", "rdfs:label", "?label").
filter(function(sol) { return
!T("owl:Class").equals(sol.otherClass) }).
getNode("?otherClass");
This library is also used for the implementation of most built-in constraints in TopBraid's SHACL-JS implementation, see
https://github.com/TopQuadrant/shacl-js/blob/master/shared/dash.js
Not sure if this helps or distracts in your SHACL-JS exercises,
so I just wanted to point it out.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CANAF59JJm4ijuNVJrdOacE4XAj5ODZR%2B%2BkFH7VpYEgpbQC8xcw%40mail.gmail.com.