Skip to content

Instantly share code, notes, and snippets.

@kendall
Created July 30, 2011 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kendall/1115894 to your computer and use it in GitHub Desktop.
Save kendall/1115894 to your computer and use it in GitHub Desktop.
Spring Select fragment
String sparql = "SELECT ?a ?b WHERE { ?a <urn:test:b> ?b } LIMIT 5";
List<Map<String,String>> results = snarlTemplate.query(sparql, new RowMapper<Map<String,String>>() {
@Override
public Map<String,String> mapRow(BindingSet bindingSet) {
Map<String,String> map = new HashMap<String,String>();
map.put("a", bindingSet.getValue("a").stringValue());
map.put("b", bindingSet.getValue("b").stringValue());
return map;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment