[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Jul 28 22:59:34 UTC 2004


mwilkinson
Wed Jul 28 18:59:34 EDT 2004
Update of /home/repository/moby/moby-live/Perl/MOBY/RDF
In directory pub.open-bio.org:/tmp/cvs-serv16178/RDF

Modified Files:
	InOutArticlesRDF.pm ServiceInstanceRDF.pm 
Log Message:
clean up and add one more test

moby-live/Perl/MOBY/RDF InOutArticlesRDF.pm,1.1,1.2 ServiceInstanceRDF.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/InOutArticlesRDF.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/InOutArticlesRDF.pm	2004/07/28 22:56:59	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/InOutArticlesRDF.pm	2004/07/28 22:59:34	1.2
@@ -47,6 +47,7 @@
     return 0 unless $args{'type'} && ( ($args{'type'} =~ /consumes/i) || ($args{'type'} =~ /produces/i) );
     return 0 unless $args{'subject'} && (ref($args{'subject'}) =~ /rdf::core/i);
     return 0 unless $args{'araticles'} && (ref($args{'articles'}) =~ /array/i);
+    return 1 unless ${$args{'articles'}}[0];  # if there ARE no articles, this is a valid result!
     
     my $caller_is_obj = ref($caller);
     my $class = $caller_is_obj || $caller;
@@ -134,13 +135,7 @@
     
     my $namespaces = $ART->namespaces();
     foreach (@{$namespaces}){
-        # prime with base Object type "Class"
-        my $namespace = _addClassResource($model, NS, "$_", '');
-        #my $type = $subject->new(RDF_NS,'type');
-        #my $class = new RDF::Core::Resource(RDFS_NS,'Class');
-        #my $statement = new RDF::Core::Statement($namespace, $type, $class);
-        #$model->addStmt($statement);
-        
+        my $namespace = _addClassResource($model, NS, "$_", '');        
         my $inNamespace = $article->new(MP, 'namespace_type');
         my $statement = new RDF::Core::Statement($article, $inNamespace, $namespace);
         $model->addStmt($statement);

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm	2004/07/28 22:56:59	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm	2004/07/28 22:59:34	1.2
@@ -69,16 +69,9 @@
     _addResource($model, MP, 'performs_task', $subject, SRV, $service->type); # dublin core title
 
     my $inputs = $service->input;
-    #my @inputs = @{$inputs};
     
     my $outputs = $service->output;
-    #my @outputs = @{$outputs};
 
-
-#  THERE SHOULD BE A LOOP HERE TO TEST IF ANY INPUTS AT ALL
-    
-
-    #foreach my $IN(@inputs){
     my $InputArticles = MOBY::RDF::InOutArticlesRDF->new(
                                                          model => $model,
                                                          type => 'consumes',
@@ -86,9 +79,6 @@
                                                          articles => $inputs,
                                                         );
 
-    #}
-#####################################################
-
     my $OutputArticles = MOBY::RDF::InOutArticlesRDF->new(
                                                          model => $model,
                                                          type => 'produces',




More information about the MOBY-guts mailing list