It looks like you are calling select(), which is a convenience wrapper around the underlying __query() method, passing in sensible default parameters for that particular sparql query form. We do not currently have one of these methods for validate. The error stems from that select wrapper passing in sparql/json as the content type (ie return type) which is invalid for the validate query form.
The validate query form behaves like CONSTRUCT and returns an RDF payload, so you may try using the construct function as a workaround.
I've created issue 171 to add a new validate function to pystardog.
CONSTRUCT GRAPH is SPARQL which doesn't have a USING SHAPES clause unless there is some non-standard support in Stardog that I don't know about. Stardog supports SHACL through VALIDATE keywords and the SHACL query service. See this section of the docs Data Quality Constraints | Stardog Documentation Latest
with cf.connection() as conn:
# get the validation report as serialized RDF
validation_report = conn.graph("VALIDATE GRAPH <virtual://adv_db918144785464892329_vkg> USING SHAPES { SHACL Shapes }").decode("UTF-8")
# parse the validation report into a graph
g = Graph()
g.parse(data=validation_report)
That comes from rdflib, as we need a way to parse the RDF output from VALIDATE, as we would in CONSTRUCT.
from rdflib import Graph
If you'd like to use a SELECT in combination with your validation, that can done with interacting with this feature as a SPARQL service. The benefit is that you'll get results out in a normal tabular form, as opposed to an RDF graph and having to navigate results in code.
This is covered here:
From a use case perspective, I may opt to use the VALIDATE query to extract out the validation report as RDF, archive it, and then re-insert it back into another database/graph where I keep all of my data quality results. On the other hand, if you'd like to run validations, and look for specific things or build an application to render results, I would use SELECT with the validation service, as this will typically be easier to deal with for integrating into other environments (e.g. putting the results on a web page).