How to search a class by a substring

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to search a class by a substring

Julio Bonis
Hi,

I was wondering if there is an easy way to retrieve a list of Classes
whose IRIs (or labels) contain a given substring.

The "search" form in protege (and autocomplete function) retrieves
classes just from the beginning of the string but I want to retrieve a
substring (something like "*dementia*" that would retrieve thinks like
"A01 dementia" "Acute dementia", etc, etc).

I have used the ontograph function for searching classes that
"contains" a string, but is not the optimal solution as it uses a lot
of memory to graph the results (I just want the list as in
autocomplete).

Thanks for your help


--
Julio Bonis Sanz MD
http://www.drbonis.com/
_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: How to search a class by a substring

Lorenz Buehmann
Well, you would have to iterate over all classes by e.g. using OWL API,
and check if the IRI or label contains the string. Of course this is not
very efficient, but I see no better ad-hoc solution, unless you have not
indexed the ontology in advance with e.g. Lucene.
On 26.07.2012 09:32, Julio Bonis wrote:

> Hi,
>
> I was wondering if there is an easy way to retrieve a list of Classes
> whose IRIs (or labels) contain a given substring.
>
> The "search" form in protege (and autocomplete function) retrieves
> classes just from the beginning of the string but I want to retrieve a
> substring (something like "*dementia*" that would retrieve thinks like
> "A01 dementia" "Acute dementia", etc, etc).
>
> I have used the ontograph function for searching classes that
> "contains" a string, but is not the optimal solution as it uses a lot
> of memory to graph the results (I just want the list as in
> autocomplete).
>
> Thanks for your help
>
>

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: How to search a class by a substring

Timothy Redmond
In reply to this post by Julio Bonis

This seems to work in Protege 4 as shown below.

One difficulty with this search is that if you are rendering by label then it will only find those entities whose label contains the string.  I have occasionally had to render by fragment for a short time just to find the entities that I want.  We hope to fix this at some point.

-Timothy






On 07/26/2012 12:32 AM, Julio Bonis wrote:
Hi,

I was wondering if there is an easy way to retrieve a list of Classes
whose IRIs (or labels) contain a given substring.

The "search" form in protege (and autocomplete function) retrieves
classes just from the beginning of the string but I want to retrieve a
substring (something like "*dementia*" that would retrieve thinks like
"A01 dementia" "Acute dementia", etc, etc).

I have used the ontograph function for searching classes that
"contains" a string, but is not the optimal solution as it uses a lot
of memory to graph the results (I just want the list as in
autocomplete).

Thanks for your help




_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback