Skip to content

Commit cb21891

Browse files
refix for drugbank nested elements
1 parent c9a6fb5 commit cb21891

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drugbank/drugbank.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,11 @@ function AddCategory(&$x, $id, $list_name, $item_name, $predicate, $list_item_na
721721
if(isset($item->$item_name) && ($item->$item_name != '')) {
722722
$l = $item->$item_name;
723723
$att = ($l->attributes());
724-
foreach($l AS $item_value) {
724+
foreach($l AS $key => $item_value) {
725725
$kid = parent::getvoc().md5($item_value);
726726
$this->addRDF(
727-
$this->describeIndividual($kid,$item_value,parent::getVoc().ucfirst($item_name)).
728-
$this->describeClass(parent::getVoc().ucfirst($item_name),ucfirst($item_name)).
727+
$this->describeIndividual($kid,"".$item_value,parent::getVoc().ucfirst($item_name)).
728+
$this->describeClass(parent::getVoc().ucfirst($item_name),ucfirst("".$item_name)).
729729
$this->triplify($id,$predicate,$kid)
730730
);
731731
foreach($att AS $ka => $va) {
@@ -734,6 +734,11 @@ function AddCategory(&$x, $id, $list_name, $item_name, $predicate, $list_item_na
734734
);
735735
}
736736
}
737+
foreach($l->children() AS $k2 => $v2) {
738+
$this->addRDF(
739+
$this->triplifyString($kid, parent::getVoc().$k2, $v2)
740+
);
741+
}
737742
}
738743
}
739744
}

0 commit comments

Comments
 (0)