NAME

Webservice::InterMine::Path - functions for finding problems with paths

SYNOPSIS

use Webservice::InterMine::Path qw(:validate);

my @errors;
push @errors, validate_path($model, $path_string);
push @errors, end_is_class($model, $path_string);
push @errors, b_is_subclass_of_a($model, $path_stringA, $path_stringB);
confess @errors if @errors;

AUTHOR

FlyMine <support@flymine.org>

BUGS

Please report any bugs or feature requests to support@flymine.org.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Webservice::InterMine::Path

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2009,2010 FlyMine, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

FUNCTIONS

validate_path

Usage   : validate_path($model, 'Department.name');
Function: Return errors for this path, nothing if the path is valid
Args    : $model - the InterMine::Model to use for validating
          $path_string - the path in string format

last_bit

Usage   : last_bit($model, 'Department.name');
Function: Returns the metaclass for the last part of the path-string
Args    : $model - the InterMine::Model to use for validating
          $path_string - the path in string format

type_of

Usage    : type_of($model, 'Department.name');
Function : returns a string with the type that this string evaluates to
           ie: Department.name => String
               Department.employees => Employee

end_is_class

Usage   : end_is_class($model, 'Department.name');
Function: Returns an error if the last bit does not evaluate to a class (ie. is an attribute)
Args    : $model - the InterMine::Model to use for validating
          $path_string - the path in string format

a_is_subclass_of_b($model, $classA, $classB)

Returns undef if $classA represents a subclass of $classB, or if they do not represent valid paths, otherwise returns a message.

b_is_subclass_of_a($model, $classA, $classB)

Returns undef if $classA represents a subclass of $classB, or if they do not represent valid paths, otherwise returns a message.

class_of

Usage   : class_of($instance);
Function: Returns the meta-class that an object refers to.
Args    : an Webservice::InterMine::Field or ClassDescriptor instance