cvs: pear /XML_FOAF/FOAF Parser.php
| From: | Lukas Smith | Date: | Thu, 04 Nov 2004 13:31:52 +0000 |
| Subject: | cvs: pear /XML_FOAF/FOAF Parser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25669@lists.php.net to get a copy of this message | ||
lsmith Thu Nov 4 08:31:52 2004 EDT
Modified files:
/pear/XML_FOAF/FOAF Parser.php
Log:
- updated to PEAR::RDF api
http://cvs.php.net/diff.php/pear/XML_FOAF/FOAF/Parser.php?r1=1.11&r2=1.12&ty=u
Index: pear/XML_FOAF/FOAF/Parser.php
diff -u pear/XML_FOAF/FOAF/Parser.php:1.11 pear/XML_FOAF/FOAF/Parser.php:1.12
--- pear/XML_FOAF/FOAF/Parser.php:1.11 Wed Sep 22 08:03:45 2004
+++ pear/XML_FOAF/FOAF/Parser.php Thu Nov 4 08:31:52 2004
@@ -16,7 +16,7 @@
// | Authors: Davey Shafik <davey@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Parser.php,v 1.11 2004/09/22 12:03:45 lsmith Exp $
+// $Id: Parser.php,v 1.12 2004/11/04 13:31:52 lsmith Exp $
/**
* FOAF Parser
@@ -93,6 +93,7 @@
function __construct() {
require_once 'RDF.php';
+ require_once 'RDF/Model/Memory.php';
$this->rdf_parser =& new RDF_Parser;
}
@@ -217,18 +218,18 @@
function _fetchAgent()
{
- $person_resource = new Resource(XML_FOAF_NS . 'Person');
+ $person_resource =& RDF_Resource::factory(XML_FOAF_NS . 'Person');
$persons = $this->foaf->find(null,null,$person_resource);
- $group_resource = new Resource(XML_FOAF_NS . 'Group');
+ $group_resource =& RDF_Resource::factory(XML_FOAF_NS . 'Group');
$groups = $this->foaf->find(null,null,$group_resource);
- $organization_resource = new Resource(XML_FOAF_NS . 'Organization');
+ $organization_resource =& RDF_Resource::factory(XML_FOAF_NS .
'Organization');
$organizations = $this->foaf->find(null,null,$organization_resource);
- $agent_resource = new Resource(XML_FOAF_NS . 'Agent');
+ $agent_resource =& RDF_Resource::factory(XML_FOAF_NS . 'Agent');
$agents = $this->foaf->find(null,null,$agent_resource);
$agents->addModel($persons);
$agents->addModel($groups);
$agents->addModel($organizations);
- $knows_resource = new Resource(XML_FOAF_NS . 'knows');
+ $knows_resource =& RDF_Resource::factory(XML_FOAF_NS . 'knows');
$knows = $this->foaf->find(null,$knows_resource,null);
$i = 0;
$agent_nodes = array();
@@ -343,7 +344,7 @@
function _fetchNick()
{
- $nick_resource = new Resource(XML_FOAF_NS . 'nick');
+ $nick_resource =& RDF_Resource::factory(XML_FOAF_NS . 'nick');
$nicks = $this->foaf->find(null,$nick_resource,null);
foreach ($nicks->triples as $nick) {
if (in_array($nick->subj->uri,$this->agent_nodes)) {
@@ -470,13 +471,13 @@
function _fetchHoldsAccount()
{
- $holds_account_resource = new Resource(XML_FOAF_NS . 'holdsAccount');
+ $holds_account_resource =& RDF_Resource::factory(XML_FOAF_NS .
'holdsAccount');
$holds_accounts = $this->foaf->find(null,$holds_account_resource,null);
- $account_name_resource = new Resource(XML_FOAF_NS . 'accountName');
+ $account_name_resource =& RDF_Resource::factory(XML_FOAF_NS . 'accountName');
$account_names = $this->foaf->find(null,$account_name_resource,null);
- $account_service_homepage_resource = new Resource(XML_FOAF_NS .
'accountServiceHomepage');
+ $account_service_homepage_resource =& RDF_Resource::factory(XML_FOAF_NS .
'accountServiceHomepage');
$account_service_homepages =
$this->foaf->find(null,$account_service_homepage_resource,null);
- $rdf_type_resource = new Resource(XML_FOAF_RDF_NS . 'type');
+ $rdf_type_resource =& RDF_Resource::factory(XML_FOAF_RDF_NS . 'type');
$rdf_types = $this->foaf->find(null,$rdf_type_resource,null);
foreach ($holds_accounts->triples as $holds_account) {
foreach ($account_names->triples as $account_name) {
@@ -497,13 +498,13 @@
}
}
- $online_account_resource = new Resource(XML_FOAF_NS . 'OnlineAccount');
+ $online_account_resource =& RDF_Resource::factory(XML_FOAF_NS .
'OnlineAccount');
$online_accounts = $this->foaf->find(null,null,$online_account_resource);
- $online_chat_account_resource = new Resource(XML_FOAF_NS .'OnlineChatAccount');
+ $online_chat_account_resource =& RDF_Resource::factory(XML_FOAF_NS
.'OnlineChatAccount');
$online_chat_accounts = $this->foaf->find(null,null,$online_chat_account_resource);
- $online_gaming_account_resource = new Resource(XML_FOAF_NS .
'OnlineGamingAccount');
+ $online_gaming_account_resource =& RDF_Resource::factory(XML_FOAF_NS .
'OnlineGamingAccount');
$online_gaming_accounts =
$this->foaf->find(null,null,$online_gaming_account_resource);
- $online_ecommerce_account_resource = new Resource(XML_FOAF_NS .
'OnlineEcommerceAccount');
+ $online_ecommerce_account_resource =& RDF_Resource::factory(XML_FOAF_NS .
'OnlineEcommerceAccount');
$online_ecommerce_accounts =
$this->foaf->find(null,null,$online_ecommerce_account_resource);
foreach ($online_accounts->triples as $account_type) {
@@ -787,7 +788,7 @@
function _fetchDcTitle()
{
- $dc_title_resource = new Resource(XML_FOAF_DC_NS . 'title');
+ $dc_title_resource =& RDF_Resource::factory(XML_FOAF_DC_NS . 'title');
$dc_titles = $this->foaf->find(null,$dc_title_resource,null);
foreach ($dc_titles->triples as $title) {
$this->foaf_data['dc']['title'][$title->subj->uri] =
$title->obj->label;
@@ -805,7 +806,7 @@
function _fetchDcDescription()
{
- $dc_description_resource = new Resource(XML_FOAF_DC_NS . 'description');
+ $dc_description_resource =& RDF_Resource::factory(XML_FOAF_DC_NS .
'description');
$dc_descriptions = $this->foaf->find(null,$dc_description_resource,null);
foreach ($dc_descriptions->triples as $description) {
$this->foaf_data['dc']['description'][$description->subj->uri] =
$description->obj->label;
@@ -827,7 +828,7 @@
function _fetchProperty($xmlns,$property,$obj_value)
{
$obj_value = strtolower($obj_value);
- $property_resource = new Resource($xmlns . $property);
+ $property_resource =& RDF_Resource::factory($xmlns . $property);
$properties = $this->foaf->find(null,$property_resource,null);
foreach ($properties->triples as $triple) {
if (in_array($triple->subj->uri,$this->agent_nodes)) {
@@ -867,7 +868,7 @@
function _getProperty($xmlns,$property,$obj_value)
{
$obj_value = strtolower($obj_value);
- $property_resource = new Resource($xmlns . $property);
+ $property_resource =& RDF_Resource::factory($xmlns . $property);
$properties = $this->foaf->find(null,$property_resource,null);
foreach ($properties->triples as $triple) {
if (in_array($triple->subj->uri,$this->agent_nodes)) {