XML::RDDL::Resource - RDDL Resource Interface
use XML::RDDL::Resource; # create a new Resource my $res = XML::RDDL::Resource->new( id => $id, base_uri => $xbase, href => $href, nature => $role, purpose => $arcrole, title => $title, lang => $lang, ); # manipulate it in various ways $foo = $res->get_id; $foo = $res->get_base_uri; $foo = $res->get_href; $foo = $res->get_nature; $foo = $res->get_purpose; $foo = $res->get_title; $foo = $res->get_lang; $res->set_id('foo'); $res->set_base_uri('foo'); $res->set_href('foo'); $res->set_nature('foo'); $res->set_purpose('foo'); $res->set_title('foo'); $res->set_lang('foo');
XML::RDDL::Resource is an interface to a single RDDL Resouce description, as found inside an RDDL document.
Creates a new Resource instance. None of the following options are mandatory, but it is recommended that all be set, and of course a Resource that doesn't have a nature, purpose, and href is moderately useful.
- id the ID of the Resource (ought to be unique) - base_uri the current base URI of the Resource, based on which the href is resolved. This doesn't have to be set by an xml:base attribute of the rddl:resource element but can also be the base URI of the document, or set by the last xml:base in scope. - href the xlink:href of the Resource which points to the actual resource entity. - nature the nature of the Resource (xlink:role) - purpose the purpose of the Resource (xlink:arcrole) - title the title of the Resource (xlink:title) - lang the lang of the Resource. This doesn't have to be set by an xml:lang attribute of the rddl:resource element but can also be set by the last xml:lang in scope.
All the above options have corresponding get_* and set_* accessors. The get_* only return the value, and the set_* modify it without returning anything.
- it may be that more accessors are needed depending on how RDDL evolves - URI resolution helpers may be wanted
Robin Berjon, robin@knowscape.com
Copyright (c) 2001-2002 Robin Berjon. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.rddl.org/, XML::RDDL
To install XML::RDDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::RDDL
CPAN shell
perl -MCPAN -e shell install XML::RDDL
For more information on module installation, please visit the detailed CPAN module installation guide.