Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] batch endpoint

Jennifer Leigh Vendetti vendetti at stanford.edu
Tue Oct 4 12:08:40 PDT 2016


Hello Ben,

The curl application sends POST requests with a default content type of 'application/x-www-form-urlencoded'.  If you want to send a JSON request, the content type needs to be specified in the curl call.  In order to execute the example from our documentation, you could use something like this:

➜  ~ curl -vX POST http://data.bioontology.org/batch -d @batch.json --header 'Content-Type: application/json' --header 'Authorization: apikey token=<your api key here>’

… which yields a successful result:

*   Trying 171.64.13.9...
* Connected to data.bioontology.org<http://data.bioontology.org> (171.64.13.9) port 80 (#0)
> POST /batch HTTP/1.1
> Host: data.bioontology.org<http://data.bioontology.org>
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Authorization: apikey token=
> Content-Length: 769
>
* upload completely sent off: 769 out of 769 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.10.1
< Date: Tue, 04 Oct 2016 18:56:24 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 8198
< Connection: keep-alive
< X-Rack-Cache: invalidate, pass
< Vary: Origin
< X-Content-Type-Options: nosniff
<
{"http://www.w3.org/2002/07/owl#Class":[{"prefLabel":"Ontology Development and Management","synonym":[],"@id":"http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Ontology_Development_and_Management","@type":"http://www.w3.org/2002/07/owl#Class","links":{"self":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management","ontology":"http://data.bioontology.org/ontologies/BRO","children":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/children","parents":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/parents","descendants":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/descendants","ancestors":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/ancestors","instances":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/instances","tree":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/tree","notes":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/notes","mappings":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management/mappings","ui":"http://bioportal.bioontology.org/ontologies/BRO?p=classes&conceptid=http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Ontology_Development_and_Management","@context":{"self":"http://www.w3.org/2002/07/owl#Class","ontology":"http://data.bioontology.org/metadata/Ontology","children":"http://www.w3.org/2002/07/owl#Class","parents":"http://www.w3.org/2002/07/owl#Class","descendants":"http://www.w3.org/2002/07/owl#Class","ancestors":"http://www.w3.org/2002/07/owl#Class","instances":"http://data.bioontology.org/metadata/Instance","tree":"http://www.w3.org/2002/07/owl#Class","notes":"http://data.bioontology.org/metadata/Note","mappings":"http://data.bioontology.org/metadata/Mapping","ui":"http://www.w3.org/2002/07/owl#Class"}},"@context":{"@vocab":"http://data.bioontology.org/metadata/","prefLabel":"http://data.bioontology.org/metadata/skosprefLabel","synonym":"http://data.bioontology.org/metadata/skossynonym"}},{"prefLabel":"Modular Component","synonym":[],"@id":"http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Modular_Component","@type":"http://www.w3.org/2002/07/owl#Class","links":{"self":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component","ontology":"http://data.bioontology.org/ontologies/BRO","children":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/children","parents":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/parents","descendants":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/descendants","ancestors":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/ancestors","instances":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/instances","tree":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/tree","notes":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/notes","mappings":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component/mappings","ui":"http://bioportal.bioontology.org/ontologies/BRO?p=classes&conceptid=http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Modular_Component","@context":{"self":"http://www.w3.org/2002/07/owl#Class","ontology":"http://data.bioontology.org/metadata/Ontology","children":"http://www.w3.org/2002/07/owl#Class","parents":"http://www.w3.org/2002/07/owl#Class","descendants":"http://www.w3.org/2002/07/owl#Class","ancestors":"http://www.w3.org/2002/07/owl#Class","instances":"http://data.bioontology.org/metadata/Instance","tree":"http://www.w3.org/2002/07/owl#Class","notes":"http://data.bioontology.org/metadata/Note","mappings":"http://data.bioontology.org/metadata/Mapping","ui":"http://www.w3.org/2002/07/owl#Class"}},"@context":{"@vocab":"http://data.bioontology.org/metadata/","prefLabel":"http://data.bioontology.org/metadata/skosprefLabel","synonym":"http://data.bioontology.org/metadata/skossynonym"}},{"prefLabel":"Stimulator","synonym":[],"@id":"http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Stimulator","@type":"http://www.w3.org/2002/07/owl#Class","links":{"self":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator","ontology":"http://data.bioontology.org/ontologies/BRO","children":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/children","parents":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/parents","descendants":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/descendants","ancestors":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/ancestors","instances":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/instances","tree":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/tree","notes":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/notes","mappings":"http://data.bioontology.org/ontologies/BRO/classes/http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator/mappings","ui":"http://bioportal.bioontology.org/ontologies/BRO?p=classes&conceptid=http%3A%2F%2Fbioontology.org%2Fontologies%2FBiomedicalResourceOntology.owl%23Stimulator","@context":{"self":"http://www.w3.org/2002/07/owl#Class","ontology":"http://data.bioontology.org/metadata/Ontology","children":"http://www.w3.org/2002/07/owl#Class","parents":"http://www.w3.org/2002/07/owl#Class","descendants":"http://www.w3.org/2002/07/owl#Class","ancestors":"http://www.w3.org/2002/07/owl#Class","instances":"http://data.bioontology.org/metadata/Instance","tree":"http://www.w3.org/2002/07/owl#Class","notes":"http://data.bioontology.org/metadata/Note","mappings":"http://data.bioontology.org/metadata/Mapping","ui":"http://www.w3.org/2002/07/owl#Class"}},"@context":{"@vocab":"http://data.bioontology.org/metadata/","prefLabel":"http://data.bioontology.org/metadata/skosprefLabel","synonym":"http://data.bioontology.org/metadata/skossynony* Connection #0 to host data.bioontology.org<http://data.bioontology.org> left intact
m"}}]}%


Kind Regards,
Jennifer



On Sep 29, 2016, at 5:04 PM, Ben Leinfelder <leinfelder at nceas.ucsb.edu<mailto:leinfelder at nceas.ucsb.edu>> wrote:

Hello,
I'm investigating BioPortal's "batch" endpoint - described here: http://data.bioontology.org/documentation#nav_batch - but haven't been able to retrieve results from it.

I've used your example, verbatim, to construct the json request and post it to the endpoint:
         curl -X POST -v -d @batch.json "http://data.bioontology.org/batch" -H "Authorization: apikey token=<my token>"
But get this response:
        {"errors":["Batch endpoint only support calls to owl:Class resources"],"status":422}

Am I missing something?

Thank you,
Ben Leinfelder



_______________________________________________
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
https://mailman.stanford.edu/mailman/listinfo/bioontology-support
<batch.json>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20161004/51176781/attachment-0001.html>


More information about the bioontology-support mailing list