@Test public void testOne() { Pdb2Rdf2Uniprot p = new Pdb2Rdf2Uniprot("3O1W"); List<String> l = p.getGoMappings(); Iterator<String> itr = l.iterator(); while (itr.hasNext()) { System.out.println(itr.next()); } }
private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http: ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(); Resource r = sol.getResource("z"); String lPattern = "http:\\/\\/purl.uniprot.org\\/go\\/(\\w+)"; Pattern p = Pattern.compile(lPattern); Matcher m = p.matcher(r.getURI()); if (m.matches()) { returnMe.add(m.group(1).trim()); } } return returnMe; }
Pdb2Rdf2Uniprot { private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http: ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(); Resource r = sol.getResource("z"); String lPattern = "http:\\/\\/purl.uniprot.org\\/go\\/(\\w+)"; Pattern p = Pattern.compile(lPattern); Matcher m = p.matcher(r.getURI()); if (m.matches()) { returnMe.add(m.group(1).trim()); } } return returnMe; } }
Pdb2Rdf2Uniprot { private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http: ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(); Resource r = sol.getResource("z"); String lPattern = "http:\\/\\/purl.uniprot.org\\/go\\/(\\w+)"; Pattern p = Pattern.compile(lPattern); Matcher m = p.matcher(r.getURI()); if (m.matches()) { returnMe.add(m.group(1).trim()); } } return returnMe; } Pdb2Rdf2Uniprot(String aPdbId); }
Pdb2Rdf2Uniprot { private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http: ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(); Resource r = sol.getResource("z"); String lPattern = "http:\\/\\/purl.uniprot.org\\/go\\/(\\w+)"; Pattern p = Pattern.compile(lPattern); Matcher m = p.matcher(r.getURI()); if (m.matches()) { returnMe.add(m.group(1).trim()); } } return returnMe; } Pdb2Rdf2Uniprot(String aPdbId); Model getUniprotModel(); String getPdbId(); void setPdbId(String pdbId); List<String> getGoMappings(); void setGoMappings(List<String> goMappings); List<String> getUniprotMappings(); void setUniprotMappings(List<String> uniprotMappings); void setUniprotModel(Model uniprotModel); }
Pdb2Rdf2Uniprot { private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http: ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(); Resource r = sol.getResource("z"); String lPattern = "http:\\/\\/purl.uniprot.org\\/go\\/(\\w+)"; Pattern p = Pattern.compile(lPattern); Matcher m = p.matcher(r.getURI()); if (m.matches()) { returnMe.add(m.group(1).trim()); } } return returnMe; } Pdb2Rdf2Uniprot(String aPdbId); Model getUniprotModel(); String getPdbId(); void setPdbId(String pdbId); List<String> getGoMappings(); void setGoMappings(List<String> goMappings); List<String> getUniprotMappings(); void setUniprotMappings(List<String> uniprotMappings); void setUniprotModel(Model uniprotModel);  }