[OTDev] NTUA WebServices

Nina Jeliazkova jeliazkova.nina at gmail.com
Fri Aug 20 23:07:22 CEST 2010


Christoph,


>> >
>> > Thanks, looks like I will need the superservice. How does it work? By
>> > posting a dataset_uri and a algorithm_uri like:
>> >
>> > curl -X POST -d dataset_uri=$dataset_uri -d algorithm_uri=$algorithm_uri http://apps.ideaconsult.net:8080/ambit2/algorithm/superservice
>> >
>>
>>
>> Yes,  or directly a model for prediction (multiple algorithms and
>> models allowed)
>>
>> curl -X POST -d dataset_uri=$dataset_uri -d model_uri=$model_uri
>> http://apps.ideaconsult.net:8080/ambit2/algorithm/superservice
>>
>> Returns task URL.
>
> Thanks! I have tried with
>
> curl -X POST -d dataset_uri=http://ot-dev.in-silico.ch/dataset/356 -d model_uri=http://apps.ideaconsult.net:8080/ambit2/algorithm/J48 http://apps.ideaconsult.net:8080/ambit2/algorithm/superservice

OK,  this notation assumes that model_uri points to an existing model,
and J48 is an algorithm - so it will not work in any case.

Actually, the superservice will not build a model, it will only apply
an existing one, or an algorithm which does some processing.

(IMHO the two types of algorithms- processing datasets or generating
models are quite confusing, we might start a discussion if it make
sense to be changed)


>
> which returns the RDF (not task URI):

Accept:text/uri-list for URI , the default is Accept:application/rdf+xml

(same for TUM and NTUA services)

>
> <rdf:RDF
>    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>    xmlns:ot="http://www.opentox.org/api/1.1#"
>    xmlns:bx="http://purl.org/net/nknouf/ns/bibtex#"
>    xmlns:owl="http://www.w3.org/2002/07/owl#"
>    xmlns:otee="http://www.opentox.org/echaEndpoints.owl#"
>    xmlns:dc="http://purl.org/dc/elements/1.1/"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
>    xmlns:ota="http://www.opentox.org/algorithmTypes.owl#"
>    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#Task"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#percentageCompleted"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#hasStatus"/>
>  <ot:Task
> rdf:about="http://apps.ideaconsult.net:8080/ambit2/task/7828f743-05f6-46c0-94fe-91e1ed75ab25">
>    <ot:percentageCompleted
> rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
>    >0.0</ot:percentageCompleted>
>    <ot:hasStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>    >Running</ot:hasStatus>
>    <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>    >1282294264167</dc:date>
>    <dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>    >Apply Calls a remote service  </dc:title>
>  </ot:Task>
>  <owl:AnnotationProperty
> rdf:about="http://purl.org/dc/elements/1.1/date"/>
>  <owl:AnnotationProperty
> rdf:about="http://purl.org/dc/elements/1.1/title"/>
> </rdf:RDF>
>
> The task URI returns:
> ch at zx81:~$ curl http://apps.ideaconsult.net:8080/ambit2/task/7828f743-05f6-46c0-94fe-91e1ed75ab25
> <rdf:RDF
>    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>    xmlns:ot="http://www.opentox.org/api/1.1#"
>    xmlns:bx="http://purl.org/net/nknouf/ns/bibtex#"
>    xmlns:owl="http://www.w3.org/2002/07/owl#"
>    xmlns:otee="http://www.opentox.org/echaEndpoints.owl#"
>    xmlns:dc="http://purl.org/dc/elements/1.1/"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
>    xmlns:ota="http://www.opentox.org/algorithmTypes.owl#"
>    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#Task"/>
>  <owl:Class rdf:about="http://www.opentox.org/api/1.1#ErrorReport"/>
>  <owl:ObjectProperty rdf:about="http://www.opentox.org/api/1.1#error"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#message"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#errorCause"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#errorDetails"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#resultURI"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#errorCode"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#percentageCompleted"/>
>  <owl:DatatypeProperty
> rdf:about="http://www.opentox.org/api/1.1#hasStatus"/>
>  <ot:Task
> rdf:about="http://apps.ideaconsult.net:8080/ambit2/task/7828f743-05f6-46c0-94fe-91e1ed75ab25">
>    <ot:resultURI rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI"
>    >http://apps.ideaconsult.net:8080/ambit2/task/7828f743-05f6-46c0-94fe-91e1ed75ab25</ot:resultURI>
>    <ot:error>
>      <ot:ErrorReport>
>        <ot:errorCause>java.lang.NullPointerException</ot:errorCause>
>        <ot:errorDetails
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>        >The server encountered an unexpected condition which prevented
>        >it from fulfilling the request</ot:errorDetails>
>        <ot:message
> rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>        >The server encountered an unexpected condition which prevented
>        >it from fulfilling the request</ot:message>
>        <ot:errorCode
> rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>        >500</ot:errorCode>
>      </ot:ErrorReport>
>    </ot:error>
>    <ot:percentageCompleted
> rdf:datatype="http://www.w3.org/2001/XMLSchema#float"
>    >0.0</ot:percentageCompleted>
>    <ot:hasStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>    >Error</ot:hasStatus>
>    <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
>    >1282294264167</dc:date>
>    <dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>    >Apply Calls a remote service  </dc:title>
>  </ot:Task>
>  <owl:AnnotationProperty
> rdf:about="http://purl.https://mail.google.com/mail/?hl=en&shva=1#inbox/12a1de8b7912cadaorg/dc/elements/1.1/date"/>
>  <owl:AnnotationProperty
> rdf:about="http://purl.org/dc/elements/1.1/title"/>
> </rdf:RDF>
>
> I guess, I would have to specify also the target feature URI
> (http://ot-dev.in-silico.ch/toxcreate/feature#hamster_carc in this
> case), how would I do that?
>

My fault for not being clear - the superservice will not build a
model,  it could only apply a model.  To build a model, just POST the
dataset and prediction feature to the algorithm uri directly.


Best regards,
Nina




> Best regards,
> Christoph
> _______________________________________________
> Development mailing list
> Development at opentox.org
> http://www.opentox.org/mailman/listinfo/development
>



More information about the Development mailing list