function printRDFjsonEquivalent($obj_equiv, $a_label, $relation = 'and', $last_re = 'and', $first_re = true) { global $o; $strOut = ''; $bracket = false; if (isset($obj_equiv['r'])) { if ($first_re) { $relation = $obj_equiv['r']; $last_re = $relation; } else { $last_re = $relation; $relation = $obj_equiv['r']; } $first_re = false; if ($relation != $last_re) { $bracket = true; } } if (isset($obj_equiv['v'])) { $v = $obj_equiv['v']; if ($bracket) { $strOut .= '('; } if ($relation == 'not') { $strOut .= "{$relation} "; } if (!is_array($v[0])) { if ($v[0] != 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil') { $strOut .= '<a oncontextmenu="return false;" href="/browser/rdf.php?o=' . $o . '&iri=' . myUrlEncode($v[0]) . '">' . UTF_to_Unicode($a_label[$v[0]]) . '</a>'; } } else { $strOut .= printRDFjsonEquivalent($v[0], $a_label, $relation, $last_re, $first_re); } if (isset($v[1])) { if (!is_array($v[1])) { if ($v[1] != 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil') { $strOut .= " {$relation} " . '<a oncontextmenu="return false;" href="/browser/rdf.php?o=' . $o . '&iri=' . myUrlEncode($v[1]) . '">' . UTF_to_Unicode($a_label[$v[1]]) . '</a>'; } } else { $strOut .= " {$relation} " . printRDFjsonEquivalent($v[1], $a_label, $relation, $last_re, $first_re); } } if ($bracket) { $strOut .= ')'; } } return $strOut; }
?> </span> </div> <?php } if (isset($result_main[$settings['ns_owl'] . 'inverseOf'])) { ?> <div style="font-weight:bold">Inverse Properties</div> <div style="background-color:#EAF1F2; border:#99CCFF 1px solid; margin-top:4px; margin-bottom:12px; padding:4px"> <span> <?php $a_inverseOf = array(); foreach ($result_main[$settings['ns_owl'] . 'inverseOf'] as $inverseOf) { if ($inverseOf['type'] == 'bnode') { $obj_equiv = getRDFjsonEquivalent($term_cbd, $inverseOf['value'], $a_label, $link = true); $a_inverseOf[] = printRDFjsonEquivalent($obj_equiv, $a_label); } else { $a_inverseOf[] = "<a oncontextmenu=\"return false;\" href=\"/browser/rdf.php?o={$o}&iri=" . myUrlEncode($inverseOf['value']) . "\">" . $a_label[$inverseOf['value']] . "</a>"; } } print join(', ', $a_inverseOf); ?> </span> </div> <?php } if (!empty($a_term_type)) { ?> <div style="font-weight:bold">Characteristics</div> <div style="background-color:#EAF1F2; border:#99CCFF 1px solid; margin-top:4px; margin-bottom:12px; padding:4px"> <span>
$obj_equiv = getRDFjsonEquivalent($usage_cbd_results, str_replace('nodeID://', '_:v', $nodeid), $a_label, $link = true); ?> <li><a oncontextmenu="return false;" href="/browser/rdf.php?o=<?php print $o; ?> &iri=<?php print myUrlEncode($usage_result['ref']); ?> "><?php print $label; ?> </a> <?php echo getShortTerm($usage_result['refp']); ?> : <?php print printRDFjsonEquivalent($obj_equiv, $a_label); ?> </li> <?php } ?> </ul> </div> <?php } } if (!empty($a_term_type)) { ?> <div style="font-weight:bold">Instance of: </div> <div style="background-color:#EAF1F2; border:#99CCFF 1px solid; margin-top:4px; margin-bottom:12px; padding:4px"> <span>
} ?> </ul> </div> <?php } if (isset($result_main[$settings['ns_owl'] . 'disjointWith'])) { ?> <div style="font-weight:bold">Disjoints</div> <div style="background-color:#EAF1F2; border:#99CCFF 1px solid; margin-top:4px; margin-bottom:12px; padding:4px"> <span> <?php $a_disjoint = array(); foreach ($result_main[$settings['ns_owl'] . 'disjointWith'] as $disjointWith) { if ($disjointWith['type'] == 'bnode') { $obj_equiv = getRDFjsonEquivalent($term_cbd, $disjointWith['value'], $a_label, $link = true); $a_disjoint[] = printRDFjsonEquivalent($obj_equiv, $a_label); } else { $a_disjoint[] = "<a oncontextmenu=\"return false;\" href=\"/browser/rdf.php?o={$o}&iri=" . myUrlEncode($disjointWith['value']) . "\">" . $a_label[$disjointWith['value']] . "</a>"; } } print join(', ', $a_disjoint); ?> </span> </div> <?php } } ?>