On Thu, 2011-05-26 at 23:01 -0700, Shiyan Ou wrote: 
> Dear Jena Developers, 
>  
> I am newbie to Jena and SDB. I meet some problems while executing SPARQL 
> queries on the RDF data with the SDB. 
>  
> I use SDB store to store the pure RDF data. It is successful. I check the 
> database and the RDF data is there. 
>  
> When I use the following codes to query the RDF data on the model. It is 
> fine, and I get the correct result. 
>  Model data_model = SDBFactory.connectDefaultModel(store);
>  OntModel ontmodel = 
> ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
>  ontmodel.add(data_model);
>  QueryExecution qe = QueryExecutionFactory.create(query, ontmodel);
> 
> However, when I use SDB dataset to query the same SDB store with the same 
> query, I cannot get any result. Actually these codes are exactly the same 
> with the example. 
>   Dataset ds = DatasetStore.create(store);
>   QueryExecution qe= QueryExecutionFactory.create(queryString, ds);
>  
> PS, the following code also cannot work. 
>  Model data_model = SDBFactory.connectDefaultModel(store);
> OntModel ontmodel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, 
> data_model);
> QueryExecution qe = QueryExecutionFactory.create(query, ontmodel);
>  
> Could you kindly tell me what is the problem? 

What's the query and corresponding data? Or rather what's a minimal
example of a failing query and the corresponding data.

In your first case you have copied all the data into the memory model
and are querying that. There are some differences between memory models
and SDB models when it comes to datatype equivalence (especially
treating plain literals and literals of type xsd:string as semantically
equivalent).

Dave


Reply via email to