Graph created in Studio not visible in Explorer

Hi, I must be missing something really basic. In Studio, I have created a new DB and inserted a few sample triples via the INSERT DATA SPARQL statement. I can run a SELECT in Studio, showing the results. But when i switch to Explorer, i get a ‘No Results’ output.

Any idea?

Antonio,

Well done on inserting data in your database and running Sparql queries.

Explorer is a visualization tool that relies on a data model. Without a data model, your data won’t be visible in Explorer.

Do you already have a data model?

  • If yes, I can show you how to make Explorer recognise and use it.

  • If not, I can help you create a Data Model for your data.

Thanks Joe for the quick reply. Got it. Any hello world example on how to create and load the data model in Studio, so that Explorer can visualize the data?

bugsy.rq (1.2 KB)

Antonio, the attached should get you up and running.
In a Studio worksheet, top right, plus sign, choose File Upload.

Load the attached .rq.

Place cursor in each query in turn and click run (do not highlight or select the query, just place cursor in it before clicking run).

Then Explorer will give you something like this.

1 Like

Amazing.. thanks for the help

and just to confirm… populating the section

stardog:context:schema

is only needed to have Explorer picking up the data model, right? It’s not stricly needed if i’ll load the data in studio and use SPARQL to query the data.

Is my understanding correct?

Thanks again

Yes — you only need to write the model into stardog:context:schema (or some named graph) if you want Stardog to use it. The prefixed IRI stardog:context:schema has full IRI tag:stardog:api:context:schema and it’s the default named graph Stardog will look for data model triples in.

Other than that there’s nothing special about that named graph.

The Data Model is also where you may place OWL reasoning axioms or Stardog rules, so that reasoning can be applied over your data. For example you could make the :likes predicate Symmetric by running the insert data query below

insert data 
{
    graph stardog:context:schema
    {
        :likes a owl:SymmetricProperty
    }
}

select *
{
    graph <urn:myData>
    {
        ?who :likes ?whom
    }
}

When you run the select with reasoning on (the button next to Run) you’ll find that

:Bugs_Bunny :likes :Daffy_Duck and

:Daffy_Duck :likes :Bugs_Bunny

This 2nd triple pops into existence at query time. It doesn’t exist in the data.

So RDF itself is a schema less data model, so your SPARQL queries will work perfectly well even without a data model. The data model (sometimes called an ontology especially if it contains reasoning axioms) is optional and is used by visualiser, reasoning engines, validation mechanism (like Shacl) and for shared meaning.

1 Like