Skip to content

Commit

Permalink
fixed multi entry parsing error #432
Browse files Browse the repository at this point in the history
  • Loading branch information
micheldumontier committed Mar 29, 2016
1 parent 38e86a5 commit 7dbd974
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions kegg/kegg.php
Expand Up @@ -691,14 +691,19 @@ function parseEntry($lfile)
parent::triplify($uri,parent::getVoc().strtolower($k),$id)
);
preg_match_all("/ \[([^\]]+)\]/",$v,$m);
if(isset($m[1])) {
foreach($m[1] AS $item) {
if(!strstr($item,"KO")) $item = "kegg:".str_replace(":","_",$item);
else $item = str_replace("KO:","kegg:",$item);
parent::addRDF(
parent::triplify($id,parent::getVoc()."link",$item)
);
if(isset($m[1]) and !empty($m[1])) {
foreach($m[1] AS $item) {
$a = explode(':',$item); // get the namespace
$b = explode(' ',$a[1]);
foreach($b AS $c) {
if(!strstr($item,"KO")) $i = "kegg:".$a[0].'_'.$c;
else $i = "kegg:".$c;
parent::addRDF(
parent::triplify($id,parent::getVoc()."link",$i)
);
}
}
$test = true;
}
continue;
}
Expand Down

0 comments on commit 7dbd974

Please sign in to comment.