How to get data schema from a stardog cloud database in python using pystardog library

If we have a database on stardog cloud and we are trying to get the database schema from the python library pystardog, then how to do it ? Database Schema includes the the nodes as classes and the relations between them as well but not the actual data.

Suppose the database looks like this in stardog explorer :

Then the schema would be something like this :

Is there a way to do it in python ?

Hi Vipul,

For the database in question, do you have the schema saved to its own named graph? If so, you could write a query like:

SELECT *
{
  GRAPH <URI of graph that contains your schema> {
    ?s ?p ?o
  }
}

And then run that query in pystardog.

Best,
Steve