3 homepage: http://arc.semsol.org/
4 license: http://arc.semsol.org/license
6 class: ARC2 foaf:openid Extractor
7 author: Benjamin Nowack
11 ARC2::inc('RDFExtractor');
13 class ARC2_OpenidExtractor extends ARC2_RDFExtractor {
15 function __construct($a = '', &$caller) {
16 parent::__construct($a, $caller);
19 function ARC2_OpenidExtractor($a = '', &$caller) {
20 $this->__construct($a, $caller);
25 $this->a['ns']['foaf'] = 'http://xmlns.com/foaf/0.1/';
30 function extractRDF() {
33 foreach ($this->nodes as $n) {
34 if (isset($n['tag']) && $n['tag'] == 'link') {
35 $m = 'extract' . ucfirst($n['tag']);
36 list ($t_vals, $t) = $this->$m($n, $t_vals, $t);
40 $doc = $this->getFilledTemplate($t, $t_vals, $n['doc_base']);
41 $this->addTs(ARC2::getTriplesFromIndex($doc));
47 function extractLink($n, $t_vals, $t) {
48 if ($this->hasRel($n, 'openid.server')) {
49 if ($href = $this->v('href uri', '', $n['a'])) {
50 $t_vals['doc_owner'] = $this->getDocOwnerID($n);
51 $t_vals['doc_id'] = $this->getDocID($n);
52 $t .= '?doc_owner foaf:homepage ?doc_id ; foaf:openid ?doc_id . ';
55 if ($this->hasRel($n, 'openid.delegate')) {
56 if ($href = $this->v('href uri', '', $n['a'])) {
57 $t_vals['doc_owner'] = $this->getDocOwnerID($n);
58 $t .= '?doc_owner foaf:homepage <' . $href . '> ; foaf:openid <' . $href . '> . ';
61 return array($t_vals, $t);