From: Jens P. <jen...@gm...> - 2011-05-10 09:18:02
|
Hi I am doing the folowing: http://pastebin.com/rfTC0fZu /* * Getting an error from ParseFromString, saying: * The Namespace URI for the given Prefix 'foaf' is not known by the in-scope NamespaceMapper * * My question how can i add a Namespace before the parsing? * I don't like the idea of manualy concatenating a lot of prefix strings to build my queries. * */ ISparqlQueryProcessor processor = new RemoteQueryProcessor(new SparqlRemoteEndpoint(new Uri("http://localhost:11025/sparql/query"))); SparqlQueryParser sparqlparser = new SparqlQueryParser(); SparqlQuery query = sparqlparser.ParseFromString("SELECT ?image WHERE {?image rdf:type foaf:Image}"); query.NamespaceMap.AddNamespace("foaf", new Uri("http://xmlns.com/foaf/0.1/")); Object results = processor.ProcessQuery(query); So is there a way to add a namespace to the parser? Thanks JPanneel |