Ejemplo n.º 1
0
<?php

/**
 * This translator will OUTPUT a div containing all the code needed to show the Concept selected
 * by the user for the mapping, together with its linked concepts to allow navigability
 */
require_once '../config.php';
//Getting parameters
$conceptIDToShow = $_GET['concept'];
$tag = $_GET['tag'];
//to avoid setting tag to map if the caller function is navigationConcept
$isOnlyNavigation = $_GET['noTag'];
//Creating classes
$res = new ReasoningManager($TAGONTOLIB_MAPPING_ENDPOINT);
$Ontology = new Ontology($ONTOLOGYID);
//Retrieving the mapped concept by ID
$mappedConcept = $Ontology->getConceptById($conceptIDToShow);
//Adding support for reinforcement mapping
$logman = new LoginManager();
//if the user is logged
if ($logman->isLoggedin()) {
    $user = $logman->getLoggedUserDetails();
    if (!$isOnlyNavigation) {
        $res->mapTagOnConcept(new Tag($tag), $mappedConcept, $user['id'], $user['significance'], $ONTOLOGYID);
    }
}
//Error handling
if ($mappedConcept == null) {
    die('Mapped concept is null!');
}
?>
Ejemplo n.º 2
0
<?php

/**
 * This translator will OUTPUT a div containing all the code needed to let the user
 * discriminate between different mappings
 */
require_once '../config.php';
$tagtomap = $_GET['tag'];
$tag = new Tag($tagtomap);
$res = new ReasoningManager($TAGONTOLIB_MAPPING_ENDPOINT);
$log = new LoginManager();
if ($log->isLoggedin()) {
    $usinfo = $log->getLoggedUserDetails();
    $usid = $usinfo['id'];
} else {
    $usid = 1;
}
$mappingresults = $res->getConceptsByTag($ONTOLOGYID, $tag, $usid);
?>
<div id="disambiContainer">
<?php 
if ($mappingresults) {
    ?>
	<p>Choose the concept where to map the searched tag:</p>
<ul>
<?php 
    foreach ($mappingresults as $Concept) {
        ?>
		<li class="disambiConcept">
	    <a onclick="choosedConcept('<?php 
        echo $Concept->getId();