XML_FOAF
[ class tree: XML_FOAF ] [ index: XML_FOAF ] [ all elements ]

Class: XML_FOAF_Parser

Source Location: XML/FOAF/Parser.php

Class Overview

XML_FOAF_Common
   |
   --XML_FOAF_Parser

FOAF Parser


Author(s):

Version:

  • 0.1

Copyright:

  • Copyright 2003 Davey Shafik and Synaptic Media. All Rights Reserved.

Variables

Methods


Inherited Variables

Inherited Methods

Class: XML_FOAF_Common

XML_FOAF_Common::isAllowedForAgent()
Check if a property is allows for the current foaf:Agent

Class Details

[line 53]
FOAF Parser

Individual element parsers that start with _fetch will return multiple elements into the result Array, those that start with _get will return only a single element




Tags:

todo:  Implement PEAR_Error handling
example:  Basic Usage of XML_FOAF_Parser
copyright:  Copyright 2003 Davey Shafik and Synaptic Media. All Rights Reserved.
version:  0.1
author:  Davey <mailto:davey@php.net>


[ Top ]


Class Variables

$agent_nodes = array()

[line 83]



Tags:

var:  Nodes assumed to be primary foaf:Agents

Type:   array


[ Top ]

$foaf =

[line 71]



Tags:

var:  of FOAF

Type:   object MemModel


[ Top ]

$foaf_data =

[line 65]



Tags:

var:  FOAF data as Array

Type:   array


[ Top ]

$foaf_xml =  ''

[line 59]



Tags:

var:  Original FOAF file

Type:   string


[ Top ]

$known_nodes = array()

[line 89]



Tags:

var:  Nodes found in <foaf:knows>

Type:   array


[ Top ]

$rdf_parser =

[line 77]



Tags:

var:  of the RAP RDF_Parser

Type:   object Instance


[ Top ]



Class Methods


constructor XML_FOAF_Parser [line 104]

XML_FOAF_Parser XML_FOAF_Parser( )

XML_FOAF_Parser PHP4 Compatible Constructor



[ Top ]

method parseFromFile [line 131]

void parseFromFile( $file $file, [$use_include_path $use_include_path = false])

Parse a FOAF in the specified File



Tags:

access:  public


Parameters:

$file   $file   string File Path for a FOAF file
$use_include_path   $use_include_path   Whether to look for the file in the php include_path

[ Top ]

method parseFromMem [line 145]

void parseFromMem( $mem $mem)

Parse a FOAF contained in the specified variable



Tags:

access:  public


Parameters:

$mem   $mem   string Variable holding a FOAF file's XML

[ Top ]

method parseFromURI [line 117]

void parseFromURI( $uri $uri)

Parse a FOAF at the specified URI



Tags:

access:  public


Parameters:

$uri   $uri   string URI for a FOAF file

[ Top ]

method toArray [line 922]

array toArray( )

Return parsed FOAF data as an Array



Tags:

access:  public


[ Top ]

method toHTML [line 935]

string toHTML( mixed &$foaf_data)

Return parsed FOAF data pretty HTML



Tags:

access:  public
todo:  Write code to return an HTML table


[ Top ]

method toObject [line 906]

object toObject( )

Return parsed FOAF data as an Object



Tags:

access:  public
todo:  Make it work!


[ Top ]

method _fetchAgent [line 219]

void _fetchAgent( )

Parses our the foaf:Agents

Looks for all foaf:Agents (foaf:Person,foaf:Group,foaf:Organzation and foaf:Agent) and decides which are the primary agents (who/what the FOAF is about) and which are only known by the primary agents




Tags:

access:  private


[ Top ]

method _fetchAimChatID [line 436]

void _fetchAimChatID( )

Finds all foaf:aimChatID's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchCurrentProject [line 708]

void _fetchCurrentProject( )

Finds all foaf:currentProject's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchDcDescription [line 807]

void _fetchDcDescription( )

Finds all dc:description's and inserts them into the result Array

These are inserted at $result['dc']['description'][$uri] where $uri is the URI they are for. You will need to check this for titles and descriptions upon output for any element you want them for.




Tags:

access:  private


[ Top ]

method _fetchDcTitle [line 789]

void _fetchDcTitle( )

Finds all dc:title's and inserts them into the result Array

These are inserted at $result['dc']['title'][$uri] where $uri is the URI they are for. You will need to check this for titles and descriptions upon output for any element you want them for.




Tags:

access:  private


[ Top ]

method _fetchDepiction [line 288]

void _fetchDepiction( )

Finds all foaf:depiction's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchFundedBy [line 297]

void _fetchFundedBy( )

Finds all foaf:fundedBy's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchHoldsAccount [line 472]

void _fetchHoldsAccount( )

Finds all foaf:onlineAccount's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchHomepage [line 565]

void _fetchHomepage( )

Finds all foaf:homepage's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchIcqChatID [line 445]

void _fetchIcqChatID( )

Finds all foaf:icqChatID's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchImg [line 654]

void _fetchImg( )

Finds all foaf:img's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchInterest [line 737]

void _fetchInterest( )

Finds all foaf:interest's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchJabberID [line 427]

void _fetchJabberID( )

Finds all foaf:jabberID's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchLogo [line 306]

void _fetchLogo( )

Finds all foaf:logo's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchMade [line 583]

void _fetchMade( )

Finds all foaf:made's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchMbox [line 397]

void _fetchMbox( )

Finds all foaf:mbox's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchMboxSha1Sum [line 406]

void _fetchMboxSha1Sum( )

Finds all foaf:mbox_sha1sum's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchMember [line 750]

void _fetchMember( )

Finds all foaf:member's and inserts them into the result Array



Tags:

todo:  Need to figure out how to point to an agent in the foaf_data :)
access:  private


[ Top ]

method _fetchMsnChatID [line 463]

void _fetchMsnChatID( )

Finds all foaf:msnChatID's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchMyersBriggs [line 663]

void _fetchMyersBriggs( )

Finds all foaf:myersBriggs's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchNick [line 345]

void _fetchNick( )

Finds all foaf:nick's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchPage [line 315]

void _fetchPage( )

Finds all foaf:page's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchPastProject [line 717]

void _fetchPastProject( )

Finds all foaf:pastProject's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchPhone [line 388]

void _fetchPhone( )

Finds all foaf:phone's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchProperty [line 828]

void _fetchProperty( $xmlns $xmlns, $property $property, $obj_value $obj_value)

Fetch a FOAF Property with multiple values



Tags:

access:  private


Parameters:

$xmlns   $xmlns   string XML Namespace URI
$property   $property   string XML Element name
$obj_value   $obj_value   string Triple's "Object" value (label or uri typically)

[ Top ]

method _fetchPublication [line 699]

void _fetchPublication( )

Finds all foaf:publication's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchSchoolHomepage [line 690]

void _fetchSchoolHomepage( )

Finds all foaf:schoolHomepage's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchSeeAlso [line 776]

void _fetchSeeAlso( )

Finds all rdf:seeAlso's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchTheme [line 324]

void _fetchTheme( )

Finds all foaf:theme's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchWeblog [line 574]

void _fetchWeblog( )

Finds all foaf:weblog's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchWorkInfoHomepage [line 681]

void _fetchWorkInfoHomepage( )

Finds all foaf:workInfoHomepage's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchWorkplaceHomepage [line 672]

void _fetchWorkplaceHomepage( )

Finds all foaf:workplaceHompage's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _fetchYahooChatID [line 454]

void _fetchYahooChatID( )

Finds all foaf:yahooChatID's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _getBasedNear [line 726]

void _getBasedNear( )

Finds all foaf:basedNear's and inserts them into the result Array



Tags:

access:  private


[ Top ]

method _getFamilyName [line 633]

void _getFamilyName( )

Finds all foaf:familyName's and inserts them into the result Array

If more than one foaf:familyName is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

access:  private


[ Top ]

method _getFirstName [line 609]

void _getFirstName( )

Finds all foaf:firstName's and inserts them into the result Array

If more than one foaf:firstName is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

access:  private


[ Top ]

method _getGeekcode [line 597]

void _getGeekcode( )

Finds all foaf:geekcode's and inserts them into the result Array

If more than one foaf:geekcode is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

access:  private


[ Top ]

method _getGender [line 418]

void _getGender( )

Finds all foaf:gender's and inserts them into the result Array

If more than one foaf:gender is found for a single foaf:Agent, the last found is inserted into the result Array.




Tags:

access:  private


[ Top ]

method _getGivenName [line 379]

void _getGivenName( )

Finds all foaf:givenName's and inserts them into the result Array

If more than one foaf:givenName is found for a single foaf:Agent, the last one found is inserted into the result array




Tags:

access:  private


[ Top ]

method _getMembershipClass [line 765]

void _getMembershipClass( )

Finds all foaf:membershipClass's and inserts them into the result Array

If more than one foaf:plan is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

todo:  figure out how to point to an agent in the foaf_data
todo:  Use http://xmlns.com/foaf/0.1/#term_Group for reference (second example)
access:  private


[ Top ]

method _getName [line 279]

void _getName( )

Finds the foaf:name's and inserts them into the result array

If more than one foaf:name is found for a single foaf:Agent, the last found will be the one shown in the result




Tags:

access:  private


[ Top ]

method _getPlan [line 645]

void _getPlan( )

Finds all foaf:plan's and inserts them into the result Array

If more than one foaf:plan is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

access:  private


[ Top ]

method _getProperty [line 868]

void _getProperty( $xmlns $xmlns, $property $property, $obj_value $obj_value)

Fetch a FOAF Property with a single value



Tags:

access:  private


Parameters:

$xmlns   $xmlns   string XML Namespace URI
$property   $property   string XML Element name
$obj_value   $obj_value   string Triple's "Object" value (label or uri typically)

[ Top ]

method _getSurname [line 621]

void _getSurname( )

Finds all foaf:surname's and inserts them into the result Array

If more than one foaf:surname is found for a single foaf:Agent, the last found will be inserted into the result Array




Tags:

access:  private


[ Top ]

method _getTitle [line 336]

void _getTitle( )

Finds all the foaf:title and inserts them into the result Array

If more than one foaf:title is found for one foaf:Agent the last one found is insert into the result




Tags:

access:  private


[ Top ]

method _parse [line 160]

void _parse( )

Calls all the seperate property parsers



Tags:

access:  private


[ Top ]

method __construct [line 95]

void __construct( )

XML_FOAF_Parser Constructor



Tags:

access:  private


[ Top ]


Documentation generated on Thu, 15 Jan 2004 19:03:16 +0000 by phpDocumentor 1.2.3