[MOBY-dev] bug in MOBY::CommunSubs:getCrossReferences
Sophie Durand
sophie.durand at infobiogen.fr
Tue Feb 8 10:41:34 UTC 2005
Hello,
I have a problem while parsing the following moby output:
<?xml version='1.0' encoding='UTF-8'?><moby:MOBY
xmlns:moby='http://www.biomoby.org/moby'><moby:mobyContent
moby:authority='genoplante-info.infobiogen.fr'><moby:serviceNotes>GENOPLANTE
PHYTOPROT. IDDN.FR.001.250004.000.S.P.2003.000.10300. This database, its
constitutive components and its documentation, are the intellectual
property of GENOPLANTE-VALOR.</moby:serviceNotes><moby:mobyData
moby:queryID='1'><moby:Collection
moby:articleName=''><moby:Simple><moby:Object
moby:namespace='AGI_LocusCode' moby:id='AT3G23130'
><CrossReference><moby:Object moby:namespace='PHYTOPROT_CLUSTER_Id'
moby:id='148'
/></CrossReference></moby:Object></moby:Simple></moby:Collection></moby:mobyData></moby:mobyContent></moby:MOBY>
I'm using the Perl API with a genericServiceInputParser call and then a
getCrossReferences call to obtain the cross reference. But in this case,
I don't get any cross reference. If I delete the "moby:" namespaces like
this :
<CrossReference><moby:Object namespace='PHYTOPROT_CLUSTER_Id' id='148'
/></CrossReference>
it works well.
So I looked in the code, and I modified the following function in
MOBY::CommunSubs.pm, and then it works:
sub _makeObjectType {
my ($xref) = @_;
my $ns = $xref->getAttributeNode('namespace');
$ns = $xref->getAttributeNode('moby:namespace') unless $ns;
return undef unless $ns;
my $id = $xref->getAttributeNode('id');
$id = $xref->getAttributeNode('moby:id') unless $id; # INSTEAD OF $ns
return undef unless $id;
my $XREF = MOBY::CrossReference->new(
type => "object",
namespace => $ns->getValue,
id => $id->getValue,
);
}
--
Sophie Durand
Ingénieure en Bioinformatique
INRA / URGI chez Infobiogen
523, place des Terrasses de l'Agora
91000 Evry - FRANCE
More information about the MOBY-dev
mailing list