@license W3C Software License and GPL class: ARC2 POSH RDF Serializer author: Benjamin Nowack version: 2010-11-16 */ ARC2::inc('RDFSerializer'); class ARC2_POSHRDFSerializer extends ARC2_RDFSerializer { function __construct($a, &$caller) { parent::__construct($a, $caller); } function __init() { parent::__init(); $this->content_header = 'text/html'; } /* */ function getLabel($res, $ps = '') { if (!$ps) $ps = array(); foreach ($ps as $p => $os) { if (preg_match('/[\/\#](name|label|summary|title|fn)$/i', $p)) { return $os[0]['value']; } } if (preg_match('/^\_\:/', $res)) return "An unnamed resource"; return preg_replace("/^(.*[\/\#])([^\/\#]+)$/", '\\2', str_replace('_', ' ', $res)); } function getSerializedIndex($index, $res = '') { $r = ''; $n = "\n"; if ($res) $index = array($res => $index[$res]); //return Trice::dump($index); foreach ($index as $s => $ps) { /* node */ $r .= '