Ejemplo n.º 1
0
 /**
  * Return an RDF object based an a $row
  */
 public function rdf($row, $prefix = '')
 {
     $row->type = isset($row->type) ? $row->type : 'version';
     if (isset($row->url)) {
         if (!is_array($row->url)) {
             $row->url = array($row->url);
         }
         foreach ($row->url as $key => $value) {
             if (!isURL($value)) {
                 $row->url[$key] = abs_url($value, $prefix);
             }
         }
     }
     $rdf = parent::rdf($row, $prefix);
     // Blend with RDF from the semantic store
     if (!empty($row->rdf)) {
         foreach ($row->rdf as $p => $values) {
             if (array_key_exists($p, $rdf)) {
                 // TODO: Not sure we should allow a collision between the semantic and relational tables? For now, don't.
             } else {
                 $rdf[$p] = $values;
             }
         }
     }
     return $rdf;
 }
Ejemplo n.º 2
0
 public function rdf($row, $base_uri = '')
 {
     if (!isset($row->type) || empty($row->type)) {
         $row->type = 'book';
     }
     return parent::rdf($row, $base_uri);
 }
Ejemplo n.º 3
0
 public function rdf($row, $base_uri = '')
 {
     if (!isset($row->type) || empty($row->type)) {
         $row->type = 'book';
     }
     if (isset($row->subtitle) && !empty($row->subtitle)) {
         $row->title = $row->title . '<span class="subtitle">: ' . $row->subtitle . '</span>';
     }
     return parent::rdf($row, $base_uri);
 }
Ejemplo n.º 4
0
 public function rdf($row, $prefix = '')
 {
     $row->type = 'http://www.openannotation.org/ns/Annotation';
     return parent::rdf($row);
 }