private function _getAnnotations(&$m, $lang) { $ann = array(); $it = $m->findAsIterator(NULL, RDF::TYPE(), LOOMP::ANNOTATION()); while ($it->hasNext()) { $s = $it->next()->getSubject(); $uri = $this->_getPropValue($m, $s, LOOMP::REFERS_TO()); $label = $this->_getLiteralInLang($m->find($s, RDFS::LABEL(), NULL), $lang); $description = $this->_getLiteralInLang($m->find($s, RDFS::COMMENT(), NULL), $lang); $type = $this->_getPropValue($m, $s, LOOMP::ANNOTATION_TYPE()); $annDomain = $this->_getPropValue($m, $s, LOOMP::ANNOTATION_DOMAIN()); if ($annDomain == '') { $annDomain = RDF::RESOURCE()->getURI(); } $annRange = $this->_getPropValue($m, $s, LOOMP::ANNOTATION_RANGE()); $ann[] = new Annotation($uri, $label, $description, $type, $annDomain, $annRange); } return $ann; }
function getKnowsPerson() { $knows = $this->getKnows(); $knowsPersons = array(); if (count($knows->triples) > 1) { foreach ($knows->triples as $triple) { $persons = $this->foaf->find($triple->obj, null, null); $res = array(); foreach ($persons->triples as $prop) { if ($prop->pred->equals(FOAF::NICK())) { $res['nick'] = $prop->getLabelObject(); } elseif ($prop->pred->equals(RDFS::SEEALSO())) { $res['seeAlso'] = $prop->getLabelObject(); } elseif ($prop->pred->equals(FOAF::WEBLOG())) { $res['weblog'] = $prop->getLabelObject(); } } $knowsPersons[] = $res; } } return $knowsPersons; }