NAME
MOBY::RDF::Ontologies::Cache::ServiceTypeCache - Module for creating a cache of service types for use when generating RDF
SYNOPSIS
use MOBY::RDF::Ontologies::Cache::ServiceTypeCache;
# required
my $cachedir = "/tmp/";
# optional - gets default values from MOBY::Client::Central
my $url = "http://moby.ucalgary.ca/moby/MOBY-Central.pl";
my $uri = "http://moby.ucalgary.ca/MOBY/Central";
my $x = MOBY::RDF::Ontologies::Cache::ServiceTypeCache->new(
endpoint => $url,
namespace => $uri,
cache => $cachedir,
);
# create the service type cache
$x->create_service_type_cache();
# update the cache
$x->update_service_type_cache();
# obtain the RDF in a thread safe manner
my $rdf = $x->get_rdf
DESCRIPTION
This module aids in the creation and maintainence of a service type cache for use in generating datatype RDF
AUTHORS
Edward Kawas (edward.kawas [at] gmail [dot] com)
SUBROUTINES
new
Instantiate a ServiceTypeCache object.
Parameters: * A Hash with keys: -> endpoint => the BioMOBY registry endpoint to use <optional> -> namespace => the BioMOBY registry namespace to use <optional> -> cache => the directory to store the cache <REQUIRED>
This subroutine attempts to create the cache directories right away and if any problems occur then an Exception is thrown.
create_service_type_cache
Create the service type cache. This will over write any pre-existing cache that it finds.
This method is not thread safe.
Throw an exception if any of the following occurs: * A SOAP error as a result of calling the registry * Problems writing to the cache directory
update_service_type_cache
Update the service type cache. This will update any items that are 'old', by relying on the LSID for the service type. This method is not thread safe.
This method returns the number of changed resources.
To update the cache with a thread safe method, call get_rdf
.
Throw an exception if any of the following occur: * There is a SOAP error calling the registry * There were read/write errors on the cache directory or its contents
get_rdf
Gets the cached copy of the RDF for all service types. This subroutine is thread safe as it performs a flock on a Lock file in the directory while performing operations.
Throw an exception if any of the following occur: * There was a SOAP problem communicating with a registr * There was a file read/write while performing cache related activities * There was a problem parsing XML