sparql - Querying an Open RDF Repository -


i trying query open rdf repository loaded turtle file. when selecting query - "select ?s { ?s ?p ?o } "; working fine when using little complex query not working. attaching code query portion -

private static void queryingrdf(repository repo) {     try{         repositoryconnection con = repo.getconnection();         try{             string querystring = "select ?s  { ?s uml:lineofbusiness cp:lobequities .}" ;               tuplequery tuplequery = con.preparetuplequery(querylanguage.sparql, querystring);                tuplequeryresult result = tuplequery.evaluate();               try {                    while(result.hasnext()){                         bindingset bindingset = result.next();                         value valueofx = bindingset.getvalue("s");                         //value valueofy = bindingset.getvalue("p");                         //value valueofz = bindingset.getvalue("o");                         //system.out.println(valueofx + "   " + valueofy + "   " + valueofz);                         system.out.println(valueofx) ;                    }                }                {                   result.close();               }         }         finally{             con.close();         }     }     catch(openrdfexception e){         system.out.println("query error");     }  } 

this continuously getting exception section , throwing error - "query error". whats going wrong?

it looks don't define uml or cp prefixes. i'm looking statement in querystring:

prefix uml: <http://example.com/uml> 

or call repositoryconnection::setnamespace this:

con.setnamespace("uml", "http://example.com/uml"); 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -