Exemple #1
0
 function Authors($autori, $del_Len, $autStartTmp, $Exp, $item, $autStart, $audID, $uri)
 {
     foreach ($autori as $node) {
         if (is_array($node) && count($node) > 1) {
             $autStartTmp = Authors($node, 1, $autStartTmp, $Exp, $item, $autStart, $audID, $uri) + 5;
             continue;
         }
         if (is_array($node)) {
             $autStartTmp = Authors($node, 5, $autStartTmp, $Exp, $item, $autStart, $audID, $uri) + 5;
             continue;
         }
         $end = 0;
         $autStartTmp = $autStartTmp + (strlen($node) - strlen(ltrim($node)));
         $end = strlen($node) - strlen(rtrim($node));
         $node = trim($node);
         $node = Normalize($node);
         //print $node." ".$autStart.$autStartTmp."<br>";
         CreateAuthors($Exp, $item, $node, $autStart + $autStartTmp, $autStart + $autStartTmp + strlen($node), $audID, $uri);
         $autStartTmp = $autStartTmp + strlen($node) + $end + $del_Len;
     }
     return $autStartTmp - $del_Len;
 }
Exemple #2
0
function CreateNewAnnotation($obj)
{
    global $mainExp, $item, $mURL;
    $Exp = $mainExp;
    try {
        $mE = $obj->subject->value;
        if ($mE == "cited") {
            $Exp . "_cited" . GetCiteIndex($obj->subject->value);
        } else {
            if (strpos(substr($mE, -8), "cited") !== false) {
                $cit = substr($mE, strrpos($mE, "_"));
                $Exp .= "_" . $cit;
            }
        }
    } catch (Exception $ex) {
    }
    switch ($obj->predicate->value) {
        case "http://purl.org/dc/terms/title":
            CreateTitle($Exp, $item, Normalize(html_entity_decode($obj->object->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://purl.org/dc/terms/creator":
            print CreateAuthors($Exp, $item, Normalize(html_entity_decode($obj->key->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://prismstandard.org/namespaces/basic/2.0/doi":
            CreateDoi($Exp, $item, Normalize(html_entity_decode($obj->object->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://purl.org/spar/fabio/hasPublicationYear":
            CreatePublicationYear($Exp, $item, Normalize(html_entity_decode($obj->object->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://purl.org/spar/fabio/hasURL":
            CreateUrl($Exp, $item, Normalize(html_entity_decode($obj->object->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://purl.org/spar/cito/cites":
            $citExpression = $Exp . "_cited" . GetCiteIndex($obj->subject->value);
            CreateCities("", $citExpression, $Exp, $item, Normalize(html_entity_decode($obj->key->value)), $obj->id->value, $obj->start->value, $obj->end->value, $mURL, Normalize(html_entity_decode($obj->bLabel->value)));
            break;
        case "http://schema.org/comment":
            CreateComment($Exp, $item, Normalize(html_entity_decode($obj->object->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL);
            break;
        case "http://www.ontologydesignpatterns.org/cp/owl/semiotics.owl#denotes":
            CreateRethoric($Exp, $item, DecodeRethoric($obj->object->value), Normalize(html_entity_decode($obj->bLabel->value)), $obj->start->value, $obj->end->value, $obj->id->value, $mURL);
            break;
    }
}