Ejemplo n.º 1
0
        <?php 
if (count($subject_ids) != 0 && count($object_ids) != 0) {
    $subject_id = $subject_ids[0];
    //$subject_type = get_type($dbc, $db_name . ':o' . $subject_id);
    $object_id = $object_ids[0];
    //$object_type = get_type($dbc, $db_name . ':o' . $object_id);
    //$class_links = get_class_links($dbc, $subject_type, $object_type) ;
    $class_links = get_candidate_properties($dbc, $db_name . ':o' . $subject_id, $db_name . ':o' . $object_id);
    echo '<tr><td><strong>主体:</strong></td>
                <td>' . render_word($dbc, $db_name, $subject, true) . '</td></tr>';
    echo '<tr><td><strong>谓词:</strong></td><td>' . implode(',', $predicates) . '</td></tr>';
    if (count($class_links) != 0) {
        echo '<tr><td><strong>语义关系:</strong></td><td>' . implode(',', $class_links) . '</td></tr>';
    }
    echo '<tr><td><strong>客体:</strong></td><td colspan=4>' . render_word($dbc, $db_name, $row['OBJECT'], true) . '</td></tr>';
    //echo '<tr><td><strong>参考参数:</strong></td><td>赋值:' . $value . ';距离:' . $distance . ';频数:' . $frequency . '</td>';
    //echo '<td>距离</td><td>' . $distance . '</td>';
    //echo '<td>频数</td><td>' . $frequency . '</td></tr>';
    //return render_value($dbc, $db_name, $db_name . ':o' . $id, $with_def);
}
?>

    </table>



</div>


Ejemplo n.º 2
0
    echo '<tr>';
    echo '<td width = "3%">' . $row_num++ . '</td>';
    //$subject_id = $subject_ids[0];
    //$subject_type = get_type($dbc, $db_name . ':o' . $subject_id);
    //$object_id = $object_ids[0];
    //$object_type = get_type($dbc, $db_name . ':o' . $object_id);
    //$class_links = get_class_links($dbc, $subject_type, $object_type) ;
    //$class_links = get_candidate_properties($dbc, $db_name . ':o' . $subject_id, $db_name . ':o' . $object_id);
    echo '<td width = "35%">' . render_word($dbc, $db_name, $row['SUBJECT'], true) . '</td>';
    /*
                          if (count($class_links) != 0){
                          echo '<td width = "15%">' . implode(',', $class_links) . '</td>';
                          }else{
                          echo '<td width = "15%">' . $row['PREDICATE'] . '</td>';
                          } */
    echo '<td width = "35%">' . render_word($dbc, $db_name, $row['OBJECT'], true) . '</td>';
    //echo '<td width = "5%">' . $row['VALUE'] . '</td>';
    //echo '<td width = "5%">' . $row['DISTANCE'] . '</td>';
    //echo '<td width = "5%">' . $row['FREQUENCY'] . '</td>';
    echo '<td width = "12%">';
    echo '<a class="btn btn-primary btn-xs" href="relation.php?db_name=' . $db_name . '&id=' . $row['id'] . '"><span class="glyphicon glyphicon-search"></span>&nbsp;查看</a>';
    echo '&nbsp;';
    $link_for_delete = $_SERVER['PHP_SELF'] . '?deleted_file=' . $row['id'];
    echo '<a class="btn btn-danger btn-xs" href="' . $link_for_delete . '"><span class="glyphicon glyphicon-trash"></span>&nbsp;删除</a></td></tr>';
    //return render_value($dbc, $db_name, $db_name . ':o' . $id, $with_def);
    //}
}
?>
            </tbody>
        </table>
        <?php