Bioprotocols / container-ontology

Container ontology for use with PAML (Protocol Activity Markup Language)
Apache License 2.0
3 stars 3 forks source link

Is it possible to query for a general container specification given a particular container instance? #15

Closed bbartley closed 2 years ago

bbartley commented 2 years ago

Is it possible to query for the general specifications of a container such as cont:Labcyte384-echo so that I could reverse engineer these specs into the queryString for a ContainerSpec?

rpgoldman commented 2 years ago

Yes, it should be possible to do so. Working on getting you an example.

For now, you might do better using the OWL source:

:Labcyte384-echo rdf:type owl:NamedIndividual ,
                          cont:Plate ;
                 cont:availableAt :Strateos ;
                 cont:equipmentVendor cont:Labcyte ;
                 cont:hasCatalogEntry <https://sift.net/container-ontology/strateos-catalog/catalog-entries#LabcytePP-0200> ;
                 cont:hasColor cont:white ;
                 cont:height :height6 ;
                 cont:wellDepth :wellDepth6 ;
                 cont:wellVolume :wellvolume6 ;
                 cont:columnCount 24 ;
                 cont:rowCount 16 ;
                 cont:wellCount 384 ;
                 rdfs:comment "Labcyte 384-Well Echo Qualified Polypropylene Microplate 2.0" ;
                 rdfs:label "384-echo" .

But... you probably want to know how this has been classified, right?

If so, until I can recall how to get this out of the server (might need to augment the API a little), I look at this in Protege and see:

Plate and OpaquePlate and SLAS_4-2004_384_Well_Plate and Standard384WellPlate and StrateosEquipment

And I find 12 other plates that match that description:

image

I'm grappling with the update to an M1 Mac, so trying to figure out why my docker image of the container server isn't working...

rpgoldman commented 2 years ago

In the short term, this kind of gross code will work, if you have the server running on localhost (started with make server):

# coding: utf-8
import owlery_client
configuration = owlery_client.Configuration("http://localhost:8080")
with owlery_client.ApiClient(configuration) as api_client:
    api_instance = owlery_client.api.dl_queries_api.DLQueriesApi(api_client)
    kb = "sd2e-container-catalogs"
    object = "<https://sift.net/container-ontology/strateos-catalog#Labcyte384-echo>"
    direct = False
    response = api_instance.kbs_kb_types_get(kb, object, direct=direct)
response

Please try this out, and if it gives you what you want, then update this ticket, and I will add a wrapper around this to the container_api so that you don't have to deal with the OpenAPI directly.

Also, try with direct = True also. I don't think that's what you want, but have a look.

bbartley commented 2 years ago

Hi @rpgoldman yes, this is good! I tried direct == True and I believe that is indeed what I am looking for, as it appears to give me the most specific classification.

This operation will facilitate some future use cases that I expect users (myself included) will want eventually. In my specific case, I knew the lab uses a 96-well Echo plate, but I didn't know how to specify this is an a general way so that another lab might substitute an equivalent plate.

Thanks!