public static function createFromRDF(EasyRdf_Resource $annoResource) { $textAnno = new TextAnnotation($annoResource->getUri(), $annoResource->getLiteral("stanbol:start")->getValue(), $annoResource->getLiteral("stanbol:end")->getValue(), $annoResource->getLiteral("stanbol:confidence")->getValue()); $textAnno->setSelectedText($annoResource->getLiteral("stanbol:selected-text")->getValue()); return $textAnno; }
/** * Create text annotations * @param array $resources A collection of TextAnnotation RDF triples * @return array */ private function _createTextAnnotations(array $resources) { $textAnnotations = array(); foreach ($resources as $res) { array_push($textAnnotations, TextAnnotation::createFromRDF($res)); } return $textAnnotations; }