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] Adding a group to an ontology

Madani, Sina Sina.Madani at vumc.org
Wed Dec 4 09:31:19 PST 2019


Thank you very much Michael

It did the trick!
Is there a way to “un-assign” a “Group” for a given ontology as well?
A graphical interface like the one used for “categories” under Edit Ontology Information panel would be very practical for “groups” as well ☺

Thanks!
Sina

From: Michael Dorf <mdorf at stanford.edu>
Date: Tuesday, December 3, 2019 at 10:12 PM
To: "Madani, Sina" <Sina.Madani at vumc.org>
Cc: "support at bioontology.org" <support at bioontology.org>
Subject: Re: [bioontology-support] Adding a group to an ontology

Hi Sina,

Thank you for contacting us. You were on the right track, it just requires a little more code. Group is an object rather than a string, and an ontology may belong to multiple groups. Here is the code for both creating a group and assigning ontology to it:

Create Group
------------
gr = LinkedData::Models::Group.new({acronym: "TESTGROUP", name: "Test Group", description: "Test Group Description", created: DateTime.parse("2019-12-03T09:26:30-08:00")})
gr.valid?
gr.save

gr = LinkedData::Models::Group.find("TESTGROUP").first
gr.bring_remaining

Assign Ontology to Group
------------------------
ont = LinkedData::Models::Ontology.find("MYONT").first
ont.bring_remaining
groups = ont.group.dup
groups << gr
ont.group = groups
ont.valid?
ont.save

Let me know if this works for you.

Thanks,

Michael


----------------------------------------------------
Michael Dorf
Chief Software Architect
The National Center for Biomedical Ontology
Stanford Biomedical Informatics Research
mdorf at stanford.edu<mailto:mdorf at stanford.edu>
O: 650-723-0357
M: 650-995-4374
----------------------------------------------------




On Dec 3, 2019, at 4:27 PM, Madani, Sina <Sina.Madani at vumc.org<mailto:Sina.Madani at vumc.org>> wrote:

Hi,

How can we add a “group” to an ontology in our local OntoPortal instance?
I tried below commands within ruby console but it was unsuccessful:

ontology  = LinkedData::Models::Ontology.find("MyOntology").first
ontology.group = ”MyGroup”

“MyGroup” group already exists in our BioPortal instance (created in ruby console)

I tried ontology.save command at the end as well as but no success.


Thanks!

Sina
_______________________________________________
bioontology-support mailing list
bioontology-support at lists.stanford.edu<mailto:bioontology-support at lists.stanford.edu>
https://mailman.stanford.edu/mailman/listinfo/bioontology-support<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.stanford.edu%2Fmailman%2Flistinfo%2Fbioontology-support&data=02%7C01%7CSina.Madani%40vumc.org%7C464f6032cc364cb7b6df08d7787020fd%7Cef57503014244ed8b83c12c533d879ab%7C0%7C0%7C637110295299962224&sdata=07RLqCey9V7Mrjv14az%2BDjlYVcjiVDCMKbtgYR%2FARc8%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/bioontology-support/attachments/20191204/2c01e72e/attachment.html>


More information about the bioontology-support mailing list