On 06/07/11 14:27, Karl Guggisberg wrote:
Hi

I have an SDB model called "SampleModel" in an SDB store (PostgreSQL),
created with

     factory = ModelFactory.createModelRDBMaker(conn);
     model = factory.createModel("SampleModel");

Firstly, That's not how to make SDB backed models. It's the old RDB database. Use one of the SDBFactory methods.

Secondly, ModelMakers predate RDF datasets and SPARQL works with RDF datasets. Names of models in the dataset

Using the SDB Java API I can open the model and execute a simple SPARQL
SELECT query like

    SELECT ?s
    WHERE { ?s ?p ?o .}

If I execute the same query using the command line tool 'sdbquery' I always
get an empty Dataset, eventhough the model has been loaded with tripples.

Possibly because it's not an SDB database, possible because there is both an RDB and an SDB based stores in the same PostgreSQL database
and the data is in the RDB database from your code above.

Is there a way to submit a query with  'sdbquery' against a specific model?

Yes -

SELECT ?s
{ GRAPH <http://example/foo> { ?s ?p ?o } }

The model must be named by absolute URI (the SPARQL parser will expand relative names -- "SampleModel" will not work).

        Andy


Karl

Reply via email to