SADI::Utils - what does not fit elsewhere
# load the Utils module use SADI::Utils; # find a file located somewhere in @INC my $file = SADI::Utils->find_file ('resource.file'); # get file from url $file = SADI::Utils->getHttpRequestByURL('http://sadiframework.org'); # remove leading/trailing whitespace from a string print SADI::Utils->trim(' http://sadiframework.org ');
General purpose utilities.
Edward Kawas (edward.kawas [at] gmail [dot] com) Martin Senger (martin.senger [at] gmail [dot] com)
Create a SADI::Utils reference; useless since the methods in this module can be called statically.
Try to locate a file whose name is created from the $default_start and all elements of @names. If it does not exist, try to replace the $default_start by elements of @INC (one by one). If neither of them points to an existing file, go back and return the $default_start and all elements of @names (even - as we know now - such file does not exist).
$default_start
@names
There are two or more arguments: $default_start and @names.
returns a scalar of text obtained from the url or dies if there was no success
returns a string of RDF that represents a syntactically correct RDF file
trims whitespace from the begining and end of a string
Augments LSRN records with ('has attribute' some Class and ('has value' some String))
Input: $class: the LSRN record (an OWL::Data::OWL::Class object), $id: a literal representation of the identifier
Output: $class with the following added to it:
<$class, SIO_000008, Y> <Y, rdf:type, $identifier> <Y, SIO_000300, $id>
This subroutine assumes that it can load the appropriate LSRN record as a Perl module (i.e. you have generated OWL2Perl classes for the LSRN record)
Extracts the LSRN records literal value from the RDF model
Input: $input: the LSRN record RDF::Core::Resource, $core: a SADI::RDF::Core object
Output: a scalar representing the LSRN records literal value or undef if it did not exist.
To install SADI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SADI
CPAN shell
perl -MCPAN -e shell install SADI
For more information on module installation, please visit the detailed CPAN module installation guide.