Exemple #1
0
 function getLabelsAsString()
 {
     $labels = array();
     foreach (parent::getLabels() as $literal) {
         array_push($labels, $literal->getValue());
     }
     return implode(",", $labels);
 }
Exemple #2
0
 /**
  * Processes the enhancements and loads them into an array.
  *
  * @param EasyRDF_Graph $graph RDF graph that holds the enhancements
  *
  * @return void
  */
 private function _loadEnhancements($graph)
 {
     EasyRdf_Namespace::set("stanbol", "http://fise.iks-project.eu/ontology/");
     Entity::mapType("foaf:Person", "Person");
     $entityAnnotations = $graph->allOfType("http://fise.iks-project.eu/ontology/EntityAnnotation");
     foreach ($entityAnnotations as $anno) {
         $entityAnnotation = new EntityAnnotation(Entity::create($anno));
         $entityAnnotation->setId($anno->getUri());
         $entityAnnotation->setTextAnnotations($this->_createTextAnnotations($anno->allResources("dc:relation")));
         $entityAnnotation->setConfidence($anno->getLiteral("stanbol:confidence")->getValue());
         $entityAnnotation->setEntityLabel($anno->getLiteral("stanbol:entity-label")->getValue());
         $entityAnnotation->setEntityTypes($anno->allResources("stanbol:entity-type"));
         array_push($this->_enhancements, $entityAnnotation);
     }
 }