[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Fri Aug 28 14:19:38 UTC 2009


kawas
Fri Aug 28 10:19:38 EDT 2009
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY
In directory dev.open-bio.org:/tmp/cvs-serv17742/MOBY-Server/lib/MOBY

Modified Files:
	Central.pm 
Log Message:
updated the regex expressions that checks the term names when registering new nodes in the ontology.
moby-live/Perl/MOBY-Server/lib/MOBY Central.pm,1.10,1.11
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm	2009/08/19 15:36:19	1.10
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/Central.pm	2009/08/28 14:19:38	1.11
@@ -318,7 +318,7 @@
 	return &_error("Object name may not contain spaces or other characters invalid in a URN",
 		""
 	  )
-	  if $term =~ /[\/\'\\\s\"\&\<\>\[\]\^\`\{\|\}\~\%\+]/;
+	  if $term =~ /[\/\'\\\s\"\&\<\>\[\]\^\`\{\|\}\~\%\!\@\#\$\%\*\+\=]/;
 	if ( $term =~ m"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?" )
 	{    # matches a URI
 		return &_error( "Object name may not be an URN or URI", "" ) if $1;
@@ -739,6 +739,10 @@
 		""
 	  )
 	  unless $email =~ /\S\@\S+\.\S+/;
+	 return &_error("serviceType name may not contain spaces or other characters invalid in a URN",
+		""
+	  )
+	  if $term =~ /[\/\'\\\s\"\&\<\>\[\]\^\`\{\|\}\~\%\!\@\#\$\%\*\+\=]/;
 
 	# validate that the final ontology will be valid
 	my ( $exists, $exists_message, $existingURI ) =
@@ -999,6 +1003,10 @@
 		);
 	}
 
+	return &_error("Namespace name may not contain spaces or other characters invalid in a URN",
+		""
+	)
+	  if $term =~ /[\/\'\\\s\"\&\<\>\[\]\^\`\{\|\}\~\%\!\@\#\$\%\*\+\=]/;
 	return &_error( "Malformed authURI - must not have an http:// prefix", "" )
 	  if $auth =~ '[/:]';
 	return &_error( "Malformed authURI - must take the form NNN.NNN.NNN", "" )
@@ -1396,6 +1404,7 @@
 	$error .= "missing serviceType \n" unless defined $serviceType;
 	$error .= "invalid character string for serviceName.  Must start with a letter followed by [A-Za-z0-9_]\n" if ($serviceName =~ /^[^A-Za-z]/);
 	$error .= "invalid character string for serviceName.  Must start with a letter followed by [A-Za-z0-9_]\n" if ($serviceName =~ /^.+?[^A-Za-z0-9_]/);
+	$error .= "service name may not contain spaces or other characters invalid in a URN" if $serviceName =~ /[\/\'\\\s\"\&\<\>\[\]\^\`\{\|\}\~\%\!\@\#\$\%\*\+\=]/;
 
 	#	$error .="missing signatureURL \n" unless defined $signatureURL;
 	$error .= "missing authURI \n"      unless defined $AuthURI;
@@ -2946,6 +2955,7 @@
 	if ( $def{description} =~ /<!\[CDATA\[((?>[^\]]+))\]\]>/ ) {
 		$def{description} = $1;
 	}
+
 	my $response;
 	$response = "<retrieveObjectDefinition>
 	<objectType lsid='$def{objectLSID}'>$def{objectType}</objectType>




More information about the MOBY-guts mailing list