SADI services as NanoPublishers

6 views
Skip to first unread message

Mark Wilkinson

unread,
Sep 20, 2013, 4:36:39 AM9/20/13
to sadi...@googlegroups.com, barend mons, nanopu...@trac.nbic.nl, nanopu...@trac.nbic.nl

Dear all,

I've just released an update to the SADI Perl libraries, with the primary
added functionality that you can now request NanoPublications from a SADI
Service, in lieu of the normal RDF service output (effectively, the normal
output can be requested to be wrapped in a set of NanoPub named graphs).
This is accomplished by changing your Accept header from rdf+xml to
n-quads. That's all that happens on the client side! :-)


http://search.cpan.org/~sadi/SADI-Simple-0.011/ is where the new code
lives


To install, at the CPAN command line:

cpan[6]> install SADI/SADI-Simple-0.011.tar.gz



I have set-up a synchronous and asynchronous service on my server so that
you can see the output and behaviour.

Here is some sample input data:

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<rdf:Description
rdf:about="http://biordf.org:8080/sequences/mgram_brief.fasta">
<rdf:type
rdf:resource="http://purl.bioontology.org/ontology/MSH/D020543"/>
<rdf:type
rdf:resource="http://biordf.org:8080/sadi_service_ontologies/SignalP_EUK_simple.owl/retrieveProteomeProtiens_input"/>
</rdf:Description>
</rdf:RDF>


=========
To invoke the service in the "traditional" way, synchronously:

curl --header "Accept: application/rdf+xml" --data @sampledata.rdf
http://biordf.org:8080/cgi-bin/services/retrieveProteomeProtiens_sync.pl
=========

=========
To invoke the service in the "traditional" way, asynchronously:

curl --header "Accept: application/rdf+xml" --data @sampledata.rdf
http://biordf.org:8080/cgi-bin/services/retrieveProteomeProtiens_async.pl

followed by a curl or wget on the returned polling URI
=========

=========
To invoke the service as a nanopublisher, synchronously:

curl --header "Accept: application/n-quads" --data @sampledata.rdf
http://biordf.org:8080/cgi-bin/services/retrieveProteomeProtiens_sync.pl
=========

=========
To invoke the service as a nanopublisher, asynchronously:

curl --header "Accept: application/n-quads" --data @sampledata.rdf
http://biordf.org:8080/cgi-bin/services/retrieveProteomeProtiens_async.pl

followed by a request on the polling URI ***THAT ALSO HAS
application/n-quads AS THE Accept HEADER!***
curl --header "Accept: application/n-quads"
http://biordf.org:8080/cgi-bin/services/retrieveProteomeProtiens_async.pl?poll=sadi_XXXXX
==========


To become a NanoPublsher, there are three small things that need change in
the service code, unfortunately! :-(

1) a new configuration parameter: NanoPublisher => 1

2) A new parameter sent to the add_statement argument on the output model:
$output_model->add_statement($stm1, $input);
This is because NanoPubs assertions require a distinct context

3) An additional statement at the end of the input processing loop:
$output_model->nanopublish_result_for($input);

As far as I can tell, the new codebase works with existing services
without any conflicts, so no current services should be affected by this
change (I know that mine still work, but if you notice otherwise please
tell me ASAP!!)

I'm c.c.ing the NanoPub mailing lists with this announcement because I
would like someone from that community to double-check the NanoPublication
schema and make sure it is correct and follows the latest version of the
spec. (The NanoPub validator seems to be offline at the moment so I wasn't
able to test it myself).

In future iterations of the code, I am going to make it possible to pull
additional metadata into the NanoPublication (likely from a local file),
but I wanted to get this out to the community as quickly as possible to
get feedback on it.

We're currently working on making the Java libraries do the same thing -
stay tuned!

Best wishes all!

Mark



--
Dr. Mark D. Wilkinson
Isaac Peral Senior Researcher, Biological Informatics
Centro de Biotecnología y Genómica de Plantas UPM-INIA (CBGP)
Campus Montegancedo,
Autopista M-40 (Km 38)
28223-Pozuelo de Alarcón (Madrid)
Reply all
Reply to author
Forward
0 new messages