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] Obtaining ontology term/class object from form_complete.js (Term-selection_field_on_a_form Widget)

Paul R Alexander palexander at stanford.edu
Tue May 21 14:08:19 PDT 2013


Lewis,

There are a set of hidden fields that get added/updated when a term is selected from the autocomplete. They contain details about the term that was selected. Their ids are based on the name of the input field that you created. In your example, after a user selects a term, you could use the following javascript code to get the URI:
document.getElementById("query_bioportal_full_id").value

You could do the same for the term name:
document.getElementById("query_bioportal_preferred_name").value

This is safer than going into the code and looking at the li.extra[4] element.

Paul


On May 21, 2013, at 1:13 PM, Lewis John McGibbney <lewis2 at stanford.edu> wrote:

> Hi Trish, 
> Yes, after importing the widget my html markup is like this
> 
>      <h2>Ontology Concept Enrichment</h2>
>      <span id="search_help">(Use BioPortal to add term-selections as field queries)</span>
>      <div id="search">
>        <input type="text" id="bp_form_complete" name="query" class="bp_form_complete-all-name" 
>          data-bp_objecttypes="class,property" data-bp_include_definitions="true"/>
>      </div>
> 
> I am looking at the JS right now, and I think the value that I am after is 
> 
> jQuery(input).val(li.extra[4])
> 
> which represents the name case. 
> 
> I will try this out and see where i get with it.
> Thank you for your feedback
> Lewis
> 
> 
> ----- Original Message -----
> From: "Trish Whetzel" <whetzel at stanford.edu>
> To: "Lewis John McGibbney" <lewis2 at stanford.edu>
> Cc: "BioPortal User Support" <bioontology-support at lists.stanford.edu>
> Sent: Tuesday, May 21, 2013 1:05:17 PM
> Subject: Re: [bioontology-support] Obtaining ontology term/class object from form_complete.js (Term-selection_field_on_a_form Widget)
> 
> 
> Lewis, 
> 
> 
> A quick question, do you have the widget configured to return the ontology term name value, e.g. using name to put the preferred name of the term (e.g., "Common Neoplasm") as the autocomplete value? What value is returned? 
> 
> 
> Trish 
> 
> 
> 
> On May 20, 2013, at 12:20 PM, Lewis John McGibbney wrote: 
> 
> 
> 
> Hi All, 
> I am having a problem (e.g. I am lost) with my implementation of the Term-selection on a form widget [0][1]. 
> Right now I am unable to obtain the object which directly represents the user text input e.g. the search term or query for the above widget. 
> Consider the following example, a user enters the text String "zebra" and thr autocompletion functionality suggests "zebrafish". The user then selects "zebrafish". It is the object which represents "zebrafish" which I need to access. 
> The reason I wish to get this object is that I wish to then use it as a field query for faceting within Apache Solr. 
> 
> Any direction which would enable me to identify this object would be greatly appreciated. Additionally some direction from any dev's who work on the widgets and who know them inside out would be the mecca right now. 
> 
> Thank you so much in advance for any help. 
> 
> Best 
> 
> Lewis 
> 
> [0] http://www.bioontology.org/wiki/index.php/NCBO_Widgets#Term-selection_field_on_a_form 
> [1] http://bioportal.bioontology.org/javascripts/widgets/form_complete.js 
> 
> Dr. Lewis John McGibbney 
> Post Doctoral Research Scholar 
> Engineering Informatics Group 
> Civil and Environmental Engineering 
> Room 279, Jerry Yang and Akiko Yamazaki Environment and Energy Building (Y2E2) 
> 473 Via Ortega 
> Stanford University 
> Stanford, CA 94305-4020 
> web | http://stanford.edu/people/lewis2 
> Linkedin | http://linkedin.com/in/lmcgibbney 
> Phone | +1(408).757.2791 
> Skype | lewis.john.mcgibbney 
> 
> 
> _______________________________________________ 
> bioontology-support mailing list 
> bioontology-support at lists.stanford.edu 
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support 
> 
> _______________________________________________
> bioontology-support mailing list
> bioontology-support at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/bioontology-support

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


More information about the bioontology-support mailing list