Coder Social home page Coder Social logo

Comments (4)

bobular avatar bobular commented on June 5, 2024

The following seems to work for me (has the XML returned from bioportal changed structure?)

I have only tested it on GAZ and UO (units) terms at the moment.

function itemDefinitionHandler(e) {
    var app = UiApp.getActiveApplication();
    var value = e.parameter.source;
    var ontologyObject = createOntologyObjectFromString(value);

    var searchString = "http://rest.bioontology.org/bioportal/concepts/" + ontologyObject.ontologyVersion
        + "?conceptid=" + ontologyObject.conceptId + "&apikey=INSERT-YOURS-HERE"; // we are using our own
    Logger.log(searchString);

    var text = UrlFetchApp.fetch(searchString).getContentText();
    var doc = Xml.parse(text, true);

    var definition = "";
    if (doc.success.data.classBean.definitions != null) {
      var strings = doc.success.data.classBean.definitions.getElements("string");
      for (var strIndex in strings) {
        var string = strings[strIndex];
        definition += string.getText() + " ";
      }
    }

    if(definition == "") {
      definition = "No definition available for this term.";
    }

    SpreadsheetApp.getActiveSpreadsheet().toast("Definition: " + definition, ontologyObject.conceptId, -1);

    return app;
}

from ontomaton.

eamonnmag avatar eamonnmag commented on June 5, 2024

I had to copy the files over manually since all the coding has to be done
within googles app script UI. I obviously missed this off when I was
copying and pasting...apologies.

Eamonn Maguire
Sent from my iPhone with tiny buttons

On 22 Jan 2013, at 08:11, bobular [email protected] wrote:

Hi guys,

Really finding this tool useful. Thanks very much. We modified it to insert
ONTO:00012345 rather than purls which don't help when we are trying to load
the experiment data into Chado.

What's happened to itemDefinitionHandler() ? I can't find the code for it
anywhere on GitHub - although I can find it in Utils.gs on my local copy.

We found that this is essential (try looking up "London" in GAZ) but seems
broken. I am trying to fix it - will post what I find.

cheers,
Bob.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/6.

from ontomaton.

eamonnmag avatar eamonnmag commented on June 5, 2024

That does look very different from what we originally had. Before there was
no explicit definition block, just lists of generic elements that were
tagged with a label 'definition' sometimes.

If this is a change across the board, then it's great and makes the task of
getting the definition much easier :)

Eamonn Maguire
Sent from my iPhone with tiny buttons

On 22 Jan 2013, at 08:23, bobular [email protected] wrote:

The following seems to work for me (has the XML returned from bioportal
changed structure?)

I have only tested it on GAZ and UO (units) terms at the moment.

function itemDefinitionHandler(e) {
var app = UiApp.getActiveApplication();
var value = e.parameter.source;
var ontologyObject = createOntologyObjectFromString(value);

var searchString =

"http://rest.bioontology.org/bioportal/concepts/" +
ontologyObject.ontologyVersion
+ "?conceptid=" + ontologyObject.conceptId +
"&apikey=INSERT-YOURS-HERE"; // we are using our own
Logger.log(searchString);

var text = UrlFetchApp.fetch(searchString).getContentText();
var doc = Xml.parse(text, true);

var definition = "";
if (doc.success.data.classBean.definitions != null) {
  var strings =

doc.success.data.classBean.definitions.getElements("string");
for (var strIndex in strings) {
var string = strings[strIndex];
definition += string.getText() + " ";
}
}

if(definition == "") {
  definition = "No definition available for this term.";
}

SpreadsheetApp.getActiveSpreadsheet().toast("Definition: " +

definition, ontologyObject.conceptId, -1);

return app;}


Reply to this email directly or view it on
GitHubhttps://github.com//issues/6#issuecomment-12544019.

from ontomaton.

eamonnmag avatar eamonnmag commented on June 5, 2024

This is now added.

from ontomaton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.