Data loaded but sparql query returns zero rows

I've tried to laod the trig file via studio - no luck. I used the command line and it shows 90 triples loaded besides the db icon.

$ ./stardog data add MyDB pp_project_mydb.trig

The following sparql returns zero rows:

SELECT ?s ?p ?o
WHERE
{ ?s ?p ?o
} LIMIT 50 OFFSET 0
  • Am I doing something wrong?

Thanks,
Radu

Hey Radu,

Is your data in the trig file in the default graph? The query is over the default graph.

i doubt it is in default graph ... it is some sort of skos scheme - but i have added the "skos" archtype to db and restarted it.

You have several options here:

  • Include a graph variable in your query from { graph ?g { ?s ?p ?o } }
  • Query over all graphs from <tag:stardog:api:context:all> { ?s ?p ?o }
    These queries will include matches from not only the default graph, but also named graphs.

Thank you that worked

Jess - I had the query working but with latest studio ugrade - command history is gone :frowning: - and my select is no longer working against all (virtual) graphs

SELECT * {
    GRAPH <tag:stardog:api:context:all>  {  ?s ?p ?o } 
}

Is the above close enough?

Thanks,
Radu

You should include the special graph IRI in the dataset specification:

select * from <tag:stardog:api:context:all> {
?s ?p ?o
}

ok that worked - thank you - but bringing too much info now ...

How do I query for a single virtual graph that was created like:

PREFIX : <http://sample/docs/>
MAPPING <urn:docs>
FROM GraphQL {
    documents{
...

You can query the virtual graph using a graph clause:

GRAPH <virtual://documents> {
...
}

I am getting zero rows back for this query:

SELECT * {
    GRAPH <virtual://documents>  {  ?s ?p ?o } 
}

pymongo find brings back 10 documents

What command did you run to add the virtual graph?

I have first used this:

 ./stardog-admin virtual add --overwrite --format SMS2 mongodb.properties documents.sms

Then modified the VG via studio. I have also tried to revert it - successfully - but still zero rows back

From docs:

Name of the configuration file without the extension will be the name of the virtual graph.

So virtual graph name with be mongodb.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.