
function.event.shacl.rq Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of corese-gui Show documentation
Show all versions of corese-gui Show documentation
Corese is a Semantic Web Factory (triple store and SPARQL endpoint)
implementing RDF, RDFS, SPARQL 1.1 Query and Update, Shacl. STTL. LDScript.
The newest version!
#
# Event Driven Function for SHACL
# Trace shacl evaluation
#
@public
@beforeShacl
function us:beforeshacl(focus) {
xt:print("@beforeShacl");
#sh:shexSemantics(true);
#sh:setdsp(true);
# additional messages for sh:node elements
#sh:setup(sh:nodeDetail, true);
#sh:setup(sh:booleanDetail, true);
us:prettyfocus(focus)
}
@public
@afterShacl
function us:aftershacl(g) {
xt:print("@afterShacl");
xt:print("report:", xt:size(g))
}
#@public
@pathShacl
function us:shaclpath(sh, nodeList, path, lst1, lst2, lst3, lst4) {
xt:print("path:", sh, path);
xt:print("node:", if (coalesce(xt:size(nodeList) <= 5, true), nodeList, xt:size(nodeList)));
map(us:prettycst, xt:list(lst1, lst2, lst3, lst4));
xt:print()
}
#@public
@nodeShacl
function us:shaclnode(sh, nodeList, lst1, lst2, lst3, lst4) {
xt:print("shape:", sh);
xt:print("node:", nodeList);
map(us:prettycst, xt:list(lst1, lst2, lst3, lst4));
xt:print()
}
@public
function us:prettycst(lst) {
if (xt:size(lst) > 0, xt:print("cst:", lst), true)
}
@public
function us:prettyfocus(focus) {
xt:print("focus:");
if (datatype(focus) = dt:mappings) {
for ((sh list) in focus) {
xt:print("shape:", sh);
xt:print("nodes:", list);
xt:print()
}
}
else {
xt:print(focus)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy