all('bio:event') as $event) { if (in_array('bio:Birth', $event->types())) { return $event; } } return null; } function age() { $birth = $this->birthEvent(); if ($birth) { $year = substr($birth->get('bio:date'), 0, 4); if ($year) { return date('Y') - $year; } } return 'unknown'; } } ## Add namespaces EasyRdf_Namespace::set('mo', 'http://purl.org/ontology/mo/'); EasyRdf_Namespace::set('bio', 'http://purl.org/vocab/bio/0.1/'); EasyRdf_TypeMapper::set('mo:MusicArtist', 'Model_MusicArtist');?>
Artist InfoArtist Info
= form_tag() ?>= text_field_tag('uri', 'http://www.bbc.co.uk/music/artists/70248960-cb53-4ea4-943a-edb18f7d336f.rdf', array('size'=>50)) ?>= submit_tag() ?>= form_end_tag() ?>primaryTopic(); } if (isset($artist)) {?> - Artist Name:
- = $artist->get('foaf:name') ?>
- Type:
- = $artist->join('rdf:type',', ') ?>
- Homepage:
- = link_to($artist->get('foaf:homepage')) ?>
- Wikipedia page:
- = link_to($artist->get('mo:wikipedia')) ?>
types())) { echo " - Age:
"; echo " - ".$artist->age()."
\n"; } ?>
dump(); }?>