[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Thu Jul 29 21:53:54 UTC 2004
mwilkinson
Thu Jul 29 17:53:54 EDT 2004
Update of /home/repository/moby/moby-live/Perl/MOBY/RDF
In directory pub.open-bio.org:/tmp/cvs-serv20244/MOBY/RDF
Modified Files:
ServiceInstanceRDF.pm
Log Message:
currently untested. This should now return RDF of the service signature to a client who registers a service. IF this works, and is parsable by Nina's agent, we will switch off service deregistration shortly and send an RDF message to everyone with a registered service
moby-live/Perl/MOBY/RDF ServiceInstanceRDF.pm,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm 2004/07/29 00:22:21 1.5
+++ /home/repository/moby/moby-live/Perl/MOBY/RDF/ServiceInstanceRDF.pm 2004/07/29 21:53:54 1.6
@@ -15,6 +15,33 @@
use constant SI => 'http://biomoby.org/RESOURCES/MOBY-S/ServiceInstances#';
use constant DC => 'http://purl.org/dc/elements/1.1/';
+sub xmlNamespaces {
+ return {
+ RDF_NS() => 'rdf',
+ RDFS_NS() => 'rdfs',
+ OBJ() => 'mobyObject',
+ NS() => 'mobyNamespace',
+ SRV() => 'mobyService',
+ MP() => 'mobyPred',
+ SI() => 'serviceInstances',
+ DC() => 'dc',
+ }
+}
+
+
+sub serialize {
+ my ($model) = @_;
+ my $xml = '';
+
+ my $serializer = new RDF::Core::Model::Serializer(
+ Model=>$model,
+ Output=>\$xml,
+ getNamespaces => \&xmlNamespaces, # this only works with a patch!!!!!!!!!!!!!!!!
+ );
+ $serializer->serialize;
+ return $xml;
+}
+
sub model {
my ($self, @args) = @_;
$args[0] && ($self->{model} = $args[0]);
More information about the MOBY-guts
mailing list