package GO::Object::Term;

=head1 NAME

GO::Object::Term       - represents a term object

=cut

use strict;
use lib '/Users/gwg/go/scratch/tools';
use Data::Dumper;
use Exporter;
use vars qw(@ISA);
use base qw(GO::Object::Base);
use GO::TestSet qw(dfv_test);
use Data::FormValidator;
use Data::FormValidator::Constraints qw(:closures);



sub _specification {
	my $self = shift;
	
	my %base_spec = ( $self->SUPER::_specification );

	return (
		# required
		"id", {
			test => qr/^GO:\d{7}$/,
			required => 1,
		},
		"is_anonymous", {
			test => dfv_test('is_true_p'),
		},
		"name", {
			test => dfv_test('is_a_string_p'),
			required => 1,
		},
		"namespace", {
			test => dfv_test('is_a_string_p'),
		},
		"alt_id", {
			test => qr/^GO:\d{7}$/,
			allow_multiple => 1,
		},
		"def", {
			test => dfv_test('is_a_string_p'),
		},
		"comment", $base_spec{comment},
		"subset", {
			test => dfv_test('is_a_string_p'),
			allow_multiple => 1,
		},
		"synonym", {
			test => dfv_test('is_a_string_p'),
			allow_multiple => 1,
		},
		"xref", {
			test => qr/^.+:.+$/,
			allow_multiple => 1,
		},
		"is_a", {
			test => qr/^GO:\d{7} \! .+/,
			allow_multiple => 1,
		},
		"intersection_of", {
		},
		"union_of", {
		},
		"disjoint_from", {
		},
		"relationship", {
			test => qr/ GO:\d{7} \! .+/,
			allow_multiple => 1,
		},
		'is_obsolete', $base_spec{is_obsolete},
		'replaced_by', $base_spec{replaced_by},
		'consider', $base_spec{consider},
	);
}

sub __id_format {
	return qr/GO:\d{7}/;
}


1;