[SHACL API]

29 views
Skip to first unread message

Nensi Skenderi

unread,
Feb 19, 2023, 3:16:55 PM2/19/23
to TopBraid Suite Users
Hello, 

First I want to thank you about the amazing work on implementing this library.

I am currently working with Quadrant Shacl.
What I want to achieve is to be able to extract from the validation report the following:

1- the node
2- the triple
3- the constraint

in JSON format 

I was checking the code but I could not find a formatter. Do you know any solution about this?

Thanks a lot,
Nensi

Holger Knublauch

unread,
Feb 20, 2023, 3:56:17 AM2/20/23
to topbrai...@googlegroups.com
Hi Nensi,

the SHACL validation produces an RDF graph which we represent programmatically as a Jena Graph object (or Model). When you use the command line tool that graph would be serialised as Turtle. One way to turn such output into JSON would be re-save the Graph into JSON-LD format using the Jena API. However, the output may not be in the exact format that you’d like. An alternative is to run a SPARQL SELECT query over the result and use the SPARQL result format as output. Basically write a query that fetches the sh:focusNode, the sh:value and sh:sourceConstraintComponent of each validation result.

Not sure if this helps as I am not sure what experience you have, e.g. whether you rely on the command line of can write Java programs.

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/4f6c454a-8eaa-41e5-a644-f187a1858f8dn%40googlegroups.com.

Nensi Skenderi

unread,
Feb 20, 2023, 4:03:30 AM2/20/23
to TopBraid Suite Users
Hi Holger,


Thanks for the fast reply and for the suggestion.
I am still learning and I will definitely try your idea.

Thanks again,
Regards,
Nensi
Reply all
Reply to author
Forward
0 new messages