tgbugs / ontquery

a framework querying ontology terms
MIT License
3 stars 3 forks source link

How would I use the Allen Mouse Brain Atlas? #3

Open bendichter opened 6 years ago

tgbugs commented 6 years ago

OntTerm(search='thalamus', prefix='MBA')

You can use prefix= to filter based on the uri prefix or category= based on the category. You can both of these sets via query.services[0].curies and query.services[0].categories respectively.

Note that right at the moment you will have to use search= for MBA because exact matches against labels does not work correctly since I suffix all parcellation terms with their source (e.g. OntTerm('MBA:678', label='Dorsal auditory area, layer 4 (mba)', synonyms=['Dorsal auditory area layer 4'])).

I will have to reconfigure how labels are indexed for search. For testing purposes you could add the (mba) yourself like this

OntTerm('MBA:549', label='Thalamus (mba)', synonyms=[],
definition='The [thalamus](http://www.knowledge-space.org/wiki/UBERON:0001897)
as delineated by the Allen Mouse Brain Atlas.  Note that compared to the generic definition,
the Mouse Brain Atlas considers the reticular nucleus of the thalamus as part of a grouping
called
[polymodal association cortex related thalamus](http://www.knowledge-space.org/wiki/MBA:856), 
rather than as part of the ventral thalamus, as in many classical hierarchies.')
bendichter commented 6 years ago

Thanks Tom these examples are very helpful

bendichter commented 6 years ago

I see what you mean about the (mba) suffix. Is the plan to remove that and just use the prefix?

I've also noticed that there is a description in 'Thalamus (mba)' but not in 'Hippocampal formation (mba)'. Do you know why there is a description in one and not the other?

tgbugs commented 6 years ago

We need the (mba) to disambiguate from the hundreds of other parcellation thalamus terms. The unsuffixed version is attached to the term via skos:prefLabel and I just need to update a config file so that those are included as synonyms.

One additional note is that label= is really a technical query which requires the user to know the exact rdfs:label for the term , and the rdfs:label often is not at all what any user of the ontology would search for. The term= expands beyond that to match more 'normal' synonyms for the term so that users can find what they are looking for.

The description is sourced from knowledge space descriptions defined here https://github.com/OpenKnowledgeSpace/ksdesc/tree/master/MBA. In this case thalamus is the only one that has been added because it was a demo.

bendichter commented 6 years ago

I'm confused about this. Couldn't we disambiguate using the prefix? Does it need to be in the label? Is that what you mean with the first paragraph? What's a skos? Sorry, still learning the ontology jargon.

tgbugs commented 6 years ago

While in some cases it is possible for humans to disambiguate by prefix, it is generally considered bad practice to do so when building an ontology or a system that uses ontologies (your question about what skos means is a perfect example of why). You don't ever want to have to 'look inside' the identifier to know what it means, because identifiers are supposed to be opaque and not have any internal 'implicit' semantics. To give another example, in InterLex every term receives a numerical identifier and has the same prefix, so if I have ILX:0073450 and ILX:0067213 that both have the label thalamus, users should rightly be angry with me because they now have to go look at the definition. In fact, we have found over time that it is quite confusing to have the exact same label on terms with different meanings, to the point where if someone wants to have a term with a different meaning, we require them to change the label. Their preferred local usage within their own context can be captured under some other predicate, but the semantics of rdfs:label as used in almost all ontologies do not permit the under specified local usage and require at least some qualification. In this context (mba) is about as minimal as I can get it, since the alternative is thalamus as defined by the Allen Mouse Brain Atlas.

The meaning of skos is that it is the prefix that maps to http://www.w3.org/2004/02/skos/core#. Essentially meaningless beyond that it tell us that the meaning of its identifiers can be found by navigating to that url and looking them up. skos:prefLabel on the other hand is the predicate that we use to keep track of the 'preferred label' of a term. In this case the original unqualified form of the term thalamus.

More generally SKOS is the acronym for Simple Knowledge Organization System and provides a schema that is useful for managing the lexical elements of a terminology.

Does this make sense?

bendichter commented 6 years ago

Not really. Maybe this would be easier over the phone? Let's coordinate over email: ben.dichter@gmail.com