Skip to content

Commit

Permalink
contains() is faster than matches()
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jul 3, 2016
1 parent 680083a commit 35a8d8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public static void parseDataNodeWp(PathwayElement elem, Model model, DataHandler
if(url != null && !url.equals("")) {
Resource datanodeRes = data.getDataNodes().get(elem.getXref());
if(datanodeRes == null) {
if (url.matches("(.*)chebi/CHEBI:(.*)")){
if (url.contains("chebi/CHEBI:")){
datanodeRes = model.createResource(url.trim().replaceAll(" ", "_"));
datanodeRes.addProperty(DC.identifier, model.createResource(url.trim().replaceAll(" ", "_")));
}
else if (url.matches("(.*)chebi(.*)")){
else if (url.contains("chebi")){
datanodeRes = model.createResource(url.trim().replaceAll(" ", "_").replace("chebi/","chebi/CHEBI:"));
datanodeRes.addProperty(DC.identifier, model.createResource(url.trim().replaceAll(" ", "_").replace("chebi/","chebi/CHEBI:")));
}
Expand Down

0 comments on commit 35a8d8b

Please sign in to comment.