[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Tue Nov 25 18:05:44 UTC 2008


kawas
Tue Nov 25 13:05:44 EST 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers
In directory dev.open-bio.org:/tmp/cvs-serv15553/Perl/MOBY-Server/lib/MOBY/RDF/Parsers

Modified Files:
	NamespaceParser.pm ServiceParser.pm DatatypeParser.pm 
	ServiceTypeParser.pm 
Log Message:
array and hash refs werent generated/returned properly.
moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers NamespaceParser.pm,1.3,1.4 ServiceParser.pm,1.2,1.3 DatatypeParser.pm,1.2,1.3 ServiceTypeParser.pm,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/NamespaceParser.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/NamespaceParser.pm	2008/09/02 13:12:58	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/NamespaceParser.pm	2008/11/25 18:05:44	1.4
@@ -110,8 +110,8 @@
 sub getNamespaces {
 
 my ($self, $url) = @_;
- 
-return \{} unless $url;
+my %hash;
+return \%hash unless $url;
 
 # download string from url
 my $rdf = undef;
@@ -120,7 +120,7 @@
 eval {
 	$rdf = MOBY::RDF::Utils->new()->getHttpRequestByURL($url);
 };
-return \{} unless $rdf;
+return \%hash unless $rdf;
 
 # create RDF model and populate
 my $storage = new RDF::Core::Storage::Memory;
@@ -135,7 +135,6 @@
 
 # get information from the model
 my $enumerator = $model->getStmts(undef, new RDF::Core::Resource( MOBY::RDF::Predicates::DC_PROTEGE->publisher ), undef);
-my %hash = ();
 my $statement = $enumerator->getFirst;
 while (defined $statement) {
   my $namespace = $statement->getSubject->getLocalValue;

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceParser.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceParser.pm	2008/11/20 19:35:46	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceParser.pm	2008/11/25 18:05:44	1.3
@@ -118,15 +118,15 @@
 sub getServices {
 
 	my ( $self, $url ) = @_;
-
-	return \[] unless $url;
+	my @services;
+	return \@services unless $url;
 
 	# download string from url
 	my $rdf = undef;
 
 	# 'try/catch'
 	eval { $rdf = MOBY::RDF::Utils->new()->getHttpRequestByURL($url); };
-	return \[] unless $rdf;
+	return \@services unless $rdf;
 
 	# create RDF model and populate
 	my $storage = new RDF::Core::Storage::Memory;
@@ -149,7 +149,6 @@
 													   )
 									   )
 	);
-	my $services  = [];
 	my $statement = $enumerator->getFirst;
 	while ( defined $statement ) {
 		my $instance = MOBY::Client::ServiceInstance->new;
@@ -842,15 +841,15 @@
 		}
 
 		# this service is done ...
-		push @{$services}, $instance;
+		push @services, $instance;
 
 		# next if any
 		$statement = $enumerator->getNext;
 	}
 	$enumerator->close;
 
-	# return hash
-	return \$services;
+	# return array ref
+	return \@services;
 
 }
 

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/DatatypeParser.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/DatatypeParser.pm	2008/09/02 13:12:58	1.2
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/DatatypeParser.pm	2008/11/25 18:05:44	1.3
@@ -135,8 +135,8 @@
 sub getDatatypes {
 
 my ($self, $url) = @_;
- 
-return \{} unless $url;
+my %hash = ();
+return \%hash unless $url;
 
 # download string from url
 my $rdf = undef;
@@ -145,7 +145,7 @@
 eval {
 	$rdf = MOBY::RDF::Utils->new()->getHttpRequestByURL($url);
 };
-return \{} unless $rdf;
+return \%hash unless $rdf;
 
 # create RDF model and populate
 my $storage = new RDF::Core::Storage::Memory;
@@ -160,7 +160,6 @@
 
 # get information from the model
 my $enumerator = $model->getStmts(undef, new RDF::Core::Resource( MOBY::RDF::Predicates::DC_PROTEGE->publisher ), undef);
-my %hash = ();
 my $statement = $enumerator->getFirst;
 while (defined $statement) {
   my $datatype = $statement->getSubject->getLocalValue;

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceTypeParser.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceTypeParser.pm	2008/09/02 13:12:58	1.3
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/lib/MOBY/RDF/Parsers/ServiceTypeParser.pm	2008/11/25 18:05:44	1.4
@@ -110,8 +110,8 @@
 sub getServiceTypes {
 
 my ($self, $url) = @_;
- 
-return \{} unless $url;
+my %hash; 
+return \%hash unless $url;
 
 # download string from url
 my $rdf = undef;
@@ -120,7 +120,7 @@
 eval {
 	$rdf = MOBY::RDF::Utils->new()->getHttpRequestByURL($url);
 };
-return \{} unless $rdf;
+return \%hash unless $rdf;
 
 
 # create RDF model and populate
@@ -136,7 +136,6 @@
 
 # get information from the model
 my $enumerator = $model->getStmts(undef, new RDF::Core::Resource( MOBY::RDF::Predicates::DC_PROTEGE->publisher ), undef);
-my %hash = ();
 my $statement = $enumerator->getFirst;
 while (defined $statement) {
   my $servicetype = $statement->getSubject->getLocalValue;




More information about the MOBY-guts mailing list