RDF::Service::Interface
The interfaces has the role of implementing the methods for the resources. They are the connection to the backend; the databases, data files, other systems. They also implement all the special logic. There could be an interface each for:
- Import/Export RDF/XML files
- Implement versioning logic
- Search engines connection
- Interfaces to other program systems
A session can connect to several interfaces. The data will be updated in real time. You can connect to an LDAP database. Search the information. Updates of the information will immediately update the backend database.
The two existing interfaces are:
RDF::Service::Interface::Base::V01
RDF::Service::Interface::DBI::V01
Depending on wheter you can read and/or write data from the interface, they should implement methods for it.
Returns the node if it can be found in $self. Otherwise, return undef.
All methods are called with the context object and interface object as the first and second parameter, followed by the specific parameters.
Every interface has a register()
function that should return a
datastructure for which method is availible for which resource. The
availability id dependent on 1) the namespace and 2) the type.
Example:
return { '' => { NS_LS.'#Service' => { 'connect' => [\&connect], 'find_node' => [\&find_node], }, }, &NS_RDF => { NS_RDFS.'Resource' => { 'init_types' => [\&init_types], 'init_rev_subjs' => [\&init_rev_subjs], 'level' => [\&base_level], }, }, };
The above example says that all resoruces of type NS_LS.'#Service' has a connect() and a find_node() method, which is connected to the subroutine referenced in the referenced list. Resources in the RDF namespace of type RDFS:Resource (ie, all resources) has the methods init_types(), init_rev_subjs() and level().
Initialize TYPE and all other implicit data, except REV_TYPE, REV_SUBJ, REV_OBJ (and REV_PRED). Return (1,3).
Initialize REV_TYPE. Return (1,3).
Remove the node tom the interface. Return (1,3).
Store the type statements for $self. Do not store those that are already SOLID. Make the saved types SOLID. Return (1,1).
Remove the type statements from $self in the interface. $types is a reference to a list of type contexts. Return (1,3).
Store the REV_SUBJ arcs in the interface. Make the saved arcs SOLID. Return (1,1).
Store the implicit arcs contained in the node. It can be a literal or arc node. The node can also have a label or other things. Make the node SOLID and return (1,1).
Jonas Liljegren <jonas@paranormal.se>
http://jonas.liljegren.org/myself/en/
Copyright (C) 2000-2001 Jonas Liljegren. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Comments and bug reports should go to rdf@uxn.nu.
Stefan Andersson <stefan@uxn.nu>