Many thanks. Dave. I got it. Shiyan From: Dave Reynolds <[email protected]> To: Shiyan Ou <[email protected]> Sent: Monday, May 30, 2011 2:03 AM Subject: Re: Problems with Jena SDB
Hi Shiyan, Please keep the discussion on the mail list, that way others can help and can benefit from any answers. On Sun, 2011-05-29 at 09:48 -0700, Shiyan Ou wrote: > Dear Dave, > > Thank you very much for your reply. > > My RDF data is like the following: > > <?xml version="1.0" encoding="ISO-8859-1"?> > <rdf:RDF > xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' > xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#' > xmlns:skos='http://www.w3.org/2004/02/skos/core#'> > <skos:Concept rdf:about='loc:5'> Not the cause of your current problem but 'loc:5' is not a legal URI. > <skos:prefLabel>Countries</skos:prefLabel> So that's a plain literal, no datatype. > The SPARQL query that I used in the memory model and SDB model is the > same one: > queryString = > "PREFIX skos:<http://www.w3.org/2004/02/skos/core#>" + > "PREFIX rdf: > <http://www.w3.org/1999/02/22-rdf-syntax-ns#>" + > "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>" > + > "SELECT DISTINCT ?scopeNote " + > "WHERE {" + > "?Concept skos:scopeNote ?scopeNote. " + > "?Concept rdf:type skos:Concept." + > "?Concept skos:prefLabel \"Countries > \"^^<http://www.w3.org/2001/XMLSchema#string>." + Right so the memory model can do the entailments to say that a plain literal is equivalent to an xsd:string but SDB can't. Instead simply use: ?Concept skos:prefLabsl "Countries" no "^^" bit. Dave
