[OTDev] NTUA WebServices
chung chvng at mail.ntua.grThu Jul 29 13:13:20 CEST 2010
- Previous message: [OTDev] Bug Reporting Services Online
- Next message: [OTDev] NTUA WebServices
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Dear All, I summarize here some curl examples one can use to consume our web services: 1. Get a list of all available algorithms on the server in various MIME types curl -H Accept:text/uri-list http://opentox.ntua.gr:3000/algorithm curl -H Accept:application/rdf+xml http://opentox.ntua.gr:3000/algorithm curl -H Accept:application/x-turtle http://opentox.ntua.gr:3000/algorithm 2. Get the representation of a specific algorithm: curl -H Accept:application/rdf+xml http://opentox.ntua.gr:3000/algorithm/mlr 3. Train an MLR model using a dataset resource with respect to some target attribute: curl -X POST -d dataset_uri=http://apps.ideaconsult.net:8080/ambit2/dataset/54 -d prediction_feature=http://apps.ideaconsult.net:8080/ambit2/feature/22200 'http://opentox.ntua.gr:3000/algorithm/mlr?username=<YOUR_USERNAME>&password=<YOUR_PASS>' -H Accept:text/uri-list The above curl command will return a (running) task which upon completion points to the created model. 4. Create a Domain of Applicability Model using the leverages algorithm. curl -X POST -d dataset_uri=http://apps.ideaconsult.net:8080/ambit2/dataset/54 -d prediction_feature=http://apps.ideaconsult.net:8080/ambit2/feature/22200 'http://opentox.ntua.gr:3000/algorithm/mlr?username=<YOUR_USERNAME>&password=<YOUR_PASS>' -H Accept:text/uri-list 5. Get a list of all available models on the server: curl -H Accept:text/uri-list http://opentox.ntua.gr:3000/model?username=<USRNM>&password=<PASS> 6. POST a dataset to a model to get predictions. For example post the dataset "http://apps.ideaconsult.net:8080/ambit2/dataset/54" to the model "http://opentox.ntua.gr:3000/model/d50e4d97-d903-45a7-aad3-b12568d95b2f" (which is a leverages model). curl -X POST -d dataset_uri=http://apps.ideaconsult.net:8080/ambit2/dataset/54 http://opentox.ntua.gr:3000/model/d50e4d97-d903-45a7-aad3-b12568d95b2f This will return a task (in AMBIT) 7. Perform a filtering: curl -X POST -d filter[]=AttributeCleanup -d filter[]=MVH -d attribute_type[]=string -d attribute_type[]=nominal -d dataset_uri=http://apps.ideaconsult.net:8080/ambit2/dataset/54 'http://opentox.ntua.gr:3000/algorithm/filter' This will first remove all nominal and string attributes from the dataset and then will replace all missing values using the 'means and modes' method. 8. Status/Monitoring Service: curl http://opentox.ntua.gr:3000/status -H Accept:text/plain 9. BiBTeX service is available at: http://opentox.ntua.gr:3000/bibtex Get a list of all avaliable BibTeX entries: curl http://opentox.ntua.gr:3000/bibtex?username=<UN>&password=<PW> Create a BIbTeX entry posting RDF: curl -X POST --data-binary @/path/to/bibtex.rdf http://opentox.ntua.gr:3000/bibtex?username=...&password=... Create a bibtex entry using parameters: curl -X POST -d bibtype={Article|Book|Conference|Phdthesis|Entry} -d author=... ... http://opentox.ntua.gr:3000/bibtex?username=...&password=... Supported parameters: abstract, address, annotation, booktitle, chapter, copyright, crossref, editor, edition, journal, isbn, issn, key, series, title, url, keywords, year, volume, number, pages Bibtex entries are available in RDF and text/plain formats. Almost all of the resources above are also available in text/html format (for access through a browser) in the latest version which is not deployed yet. Best regards, Pantelis
- Previous message: [OTDev] Bug Reporting Services Online
- Next message: [OTDev] NTUA WebServices
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Development mailing list