SHACL validation for virtual graphs

Hi Team,

We are validating the capabilities of stardog by making PoC's.

I could see the release notes - the stardog supports shacl validation for Virtual graphs.

But there's no clear documentation about the process of implementing shacl validation for virtual graphs, like it is there for the stardog database (ICV validation).

Could you please explain how can i add the shacl.ttl file which has shacl validations, to a virtual graph and validate the data before getting inserted, as we do it for stardog database ?

If the above is not possible, is there a way that we can validate it at least after the data insertion into a virtual graph ? If so how, it's possible ?

Also requesting any document/samples/repo link to achieve this if there's any !!!

Any help from anybody, would be really grateful .


Hi Muthu,

First of all, inserting data into a Virtual Graph (VG) does not typically go through Stardog. It only queries VGs, but doesn't update them. So if you want to validate the data before it goes into a VG, you need to do it in the system which stores the data at that point.

Second, if the data is already stored in an upstream system which is registered as a VG in Stardog (say, under virtual://data IRI), you can run SHACL report on it without moving to Stardog. You don't need to add shacl.ttl to that VG. Just add it to your local Stardog database from which virtual://data is accessible and then run "stardog icv report --named-graph="virtual://data" {database}"

If there's a lot of data in the VG, or your SHACL constraints are complex, you should consider setting up a cache node for that VG. Then Stardog will automatically redirect SHACL validation to that node for better performance.


Hi @pavel , Thanks for your input .
Have tried it , but getting some error.

Inserted the shacl constraints into a stardog db "shaclvalid"

/opt/stardog/bin/stardog icv report --named-graph="virtual://graph1" shaclvalid

No driver was found which supports the connection string: '--named-graph=virtual://spokeBproduct', please double-check the URL and verify the protocol is correct and try again.

requesting your help on this ?


Perhaps I made a typo, try

/opt/stardog/bin/stardog icv report --named-graph virtual://graph1 shaclvalid

Sorry about that,

1 Like