<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://protegewiki.stanford.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jnair</id>
		<title>Protege Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://protegewiki.stanford.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jnair"/>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/wiki/Special:Contributions/Jnair"/>
		<updated>2026-04-16T02:25:05Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9707</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9707"/>
				<updated>2011-04-16T00:13:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Notice that the highlighted class in the above example, &amp;lt;code&amp;gt;Physical Force&amp;lt;/code&amp;gt; (Term ID 78621006) of the SNOMED CT ontology, is one of the classes imported into the NCI Thesaurus ontology, and is displayed using the value of the &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; property, imported as &amp;lt;code&amp;gt;rdfs:label&amp;lt;/code&amp;gt;. This is much more intuitive than displaying the default &amp;lt;code&amp;gt;rdf:id&amp;lt;/code&amp;gt; property, which has the value &amp;lt;code&amp;gt;http://purl.bioontology.org/ontology/SNOMEDCT/78621006&amp;lt;/code&amp;gt;. To enable this, select &amp;quot;''OWL&amp;gt;Preferences''&amp;quot; from the Protege window menu bar, click on the &amp;quot;''Rendering''&amp;quot; tab, and set the value of the &amp;quot;''Render entities in this ontology using property:''&amp;quot; to whichever property that you want to use to display the class. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Setting_Render_Property.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Setting_Render_Property.png&amp;diff=9706</id>
		<title>File:Setting Render Property.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Setting_Render_Property.png&amp;diff=9706"/>
				<updated>2011-04-16T00:12:10Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Setting Render Property.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Setting_Render_Property.png&amp;diff=9705</id>
		<title>File:Setting Render Property.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Setting_Render_Property.png&amp;diff=9705"/>
				<updated>2011-04-16T00:11:25Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9704</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9704"/>
				<updated>2011-04-16T00:10:13Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result1.png]]&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Notice that the highlighted class in the above example, &amp;lt;code&amp;gt;Physical Force&amp;lt;/code&amp;gt; (Term ID 78621006) of the SNOMED CT ontology, is one of the classes imported into the NCI Thesaurus ontology, and is displayed using the value of the &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; property, imported as &amp;lt;code&amp;gt;rdfs:label&amp;lt;/code&amp;gt;. This is much more intuitive than displaying the default &amp;lt;code&amp;gt;rdf:id&amp;lt;/code&amp;gt; property, which has the value &amp;lt;code&amp;gt;http://purl.bioontology.org/ontology/SNOMEDCT/78621006&amp;lt;/code&amp;gt;. To enable this, select &amp;quot;''OWL&amp;gt;Preferences''&amp;quot; from the Protege window menu bar, click on the &amp;quot;''Rendering''&amp;quot; tab, and set the value of the &amp;quot;''Render entities in this ontology using property:''&amp;quot; to whichever property that you want to use to display the class. &lt;br /&gt;
&lt;br /&gt;
[[File:Setting_Render_Property.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9703</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9703"/>
				<updated>2011-04-15T23:47:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result1.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Import_Result1.png&amp;diff=9702</id>
		<title>File:Import Result1.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Import_Result1.png&amp;diff=9702"/>
				<updated>2011-04-15T23:46:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Import_Result.png&amp;diff=9701</id>
		<title>File:Import Result.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Import_Result.png&amp;diff=9701"/>
				<updated>2011-04-15T23:42:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Import Result.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9700</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9700"/>
				<updated>2011-04-15T02:14:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Developer's Guide */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9699</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9699"/>
				<updated>2011-04-15T02:14:12Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Under the hood */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9698</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9698"/>
				<updated>2011-04-15T02:13:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
[[File:Import_Result.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Import_Result.png&amp;diff=9697</id>
		<title>File:Import Result.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Import_Result.png&amp;diff=9697"/>
				<updated>2011-04-15T02:12:24Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9696</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9696"/>
				<updated>2011-04-15T02:05:26Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9695</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9695"/>
				<updated>2011-04-15T02:04:40Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* The result */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the NCI Thesaurus ontology from the OWLClasses tab, into which we have imported classes from the SNOMED CT ontology.&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties.png&amp;diff=9694</id>
		<title>File:Configuring Properties.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties.png&amp;diff=9694"/>
				<updated>2011-04-15T02:02:54Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9693</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9693"/>
				<updated>2011-04-15T02:02:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Configuring properties to be imported */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9692</id>
		<title>File:Configuring Properties To Be Imported.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9692"/>
				<updated>2011-04-15T01:58:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Configuring Properties To Be Imported.png&amp;quot;:&amp;amp;#32;Reverted to version as of 01:53, April 15, 2011&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9691</id>
		<title>File:Configuring Properties To Be Imported.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9691"/>
				<updated>2011-04-15T01:57:53Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Configuring Properties To Be Imported.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9690</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9690"/>
				<updated>2011-04-15T01:56:19Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Configuring properties to be imported */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9689</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9689"/>
				<updated>2011-04-15T01:55:55Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Importing into a separate ontology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Importing_Into_Existing_Ontology.png&amp;diff=9688</id>
		<title>File:Importing Into Existing Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Importing_Into_Existing_Ontology.png&amp;diff=9688"/>
				<updated>2011-04-15T01:55:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9687</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9687"/>
				<updated>2011-04-15T01:55:01Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Importing into a separate ontology */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
[[File:Importing_Into_Existing_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9686</id>
		<title>File:Configuring Properties To Be Imported.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Configuring_Properties_To_Be_Imported.png&amp;diff=9686"/>
				<updated>2011-04-15T01:53:39Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Importing_Into_Separate_Ontology.png&amp;diff=9685</id>
		<title>File:Importing Into Separate Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Importing_Into_Separate_Ontology.png&amp;diff=9685"/>
				<updated>2011-04-15T01:37:58Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Importing_Subtree.png&amp;diff=9684</id>
		<title>File:Importing Subtree.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Importing_Subtree.png&amp;diff=9684"/>
				<updated>2011-04-15T01:35:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9683</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9683"/>
				<updated>2011-04-15T01:33:48Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Plugin configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9682</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9682"/>
				<updated>2011-04-15T01:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Importing classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Plugin Configuration&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9681</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9681"/>
				<updated>2011-04-15T01:32:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Plugin configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Subtree.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be &lt;br /&gt;
provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Importing_Into_Separate_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Configuring_Properties_To_Be_Imported.png]]&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9680</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9680"/>
				<updated>2011-04-15T01:30:32Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Configure the widget */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9679</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9679"/>
				<updated>2011-04-15T01:30:17Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Configuring Imports */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
== Plugin configuration ==&lt;br /&gt;
&lt;br /&gt;
The user can configure the settings for all the above features of the plugin in two ways: 1. selecting &amp;quot;''BioPortal&amp;gt;Configure...''&amp;quot; from the Protege window menu bar, or 2. clicking on &amp;quot;''Configure Import...''&amp;quot; in the plugin window. It also allows the user to configure the base URL for BioPortal and BioPortal REST services, if required.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Imports ===&lt;br /&gt;
&lt;br /&gt;
==== Importing a subtree of classes ====&lt;br /&gt;
&lt;br /&gt;
If the user wants to import an entire subtree of classes, the plugin provides an option to enable it, as well as to configure the number of levels down the tree to import, starting from the children of the selected class. This makes it very convenient to import entire parts of an ontology at once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Importing into a separate ontology ====&lt;br /&gt;
&lt;br /&gt;
Often, a user might want to import classes into a separate ontology, which can then be imported into the main ontology. One advantage of this is that the imported classes can be edited and maintained separately. It also makes removing all the imports altogether much easier. If so desired, the user can configure whether he/she wants to import the selected classes into an entirely new ontology (in which case the ontology name and the name of the file to save it to needs to be provided), or as part of an already imported ontology (for which he needs to select from a list of already imported ontologies which are writable).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring properties to be imported ====&lt;br /&gt;
&lt;br /&gt;
Apart from the classes, the user might also wish to import various properties of each class, along with their values. However, since the same property might not exist in the local ontology, the user can choose which property of the local ontology to assign it to. Currently, the plugin allows a user to import only the Label, Definitions and Synonyms properties from BioPortal. However, this list might be extended in the future. The figure below depicts how to configure which properties to import for each class, and their equivalent properties in the local ontology.&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9678</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9678"/>
				<updated>2011-04-15T01:22:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Importing classes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
Below is an example of the &amp;lt;code&amp;gt;Mosquito-borne flavivirus hemorrhagic fever&amp;lt;/code&amp;gt; class (Term ID 240489005) of the SNOMED CT ontology imported into the &amp;lt;code&amp;gt;Abnormal_Cell&amp;lt;/code&amp;gt; class of the NCI Thesaurus ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9677</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9677"/>
				<updated>2011-04-15T01:16:26Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How to use it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9676</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9676"/>
				<updated>2011-04-15T01:16:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* What does it look like */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9675</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9675"/>
				<updated>2011-04-15T01:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9674</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9674"/>
				<updated>2011-04-15T01:14:27Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Under the hood */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Imported_Classes.png&amp;diff=9673</id>
		<title>File:Imported Classes.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Imported_Classes.png&amp;diff=9673"/>
				<updated>2011-04-15T01:13:40Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9672</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9672"/>
				<updated>2011-04-15T00:37:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How to use it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Importing classes ==&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select a BioPortal ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane. Select one or more classes to import from the BioPortal ontology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the settings for importing classes by clicking on the &amp;quot;''Configure Import...''&amp;quot; button. More details about configuring the settings are provided in the &amp;quot;Configuring Imports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;''Import''&amp;quot; button to import all selected classes into the local ontology. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Imported_Classes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring Imports ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Select_Class.png&amp;diff=9671</id>
		<title>File:Select Class.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Select_Class.png&amp;diff=9671"/>
				<updated>2011-04-15T00:21:38Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9670</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9670"/>
				<updated>2011-04-15T00:20:01Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How to use it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select an ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The plugin will show all the classes belonging to the selected ontology in an expandable tree format in the left pane. Selecting one of the classes will show the properties for that class in the details pane.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Class.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9669</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9669"/>
				<updated>2011-04-15T00:17:45Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How to use it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the plugin window, select an ontology from the dropdown list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Select_Ontology.png]]&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Select_Ontology.png&amp;diff=9668</id>
		<title>File:Select Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Select_Ontology.png&amp;diff=9668"/>
				<updated>2011-04-15T00:15:31Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9667</id>
		<title>File:Select An Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9667"/>
				<updated>2011-04-15T00:14:32Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Select An Ontology.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9666</id>
		<title>File:Select An Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9666"/>
				<updated>2011-04-15T00:09:45Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: uploaded a new version of &amp;quot;File:Select An Ontology.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9665</id>
		<title>File:Select An Ontology.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:Select_An_Ontology.png&amp;diff=9665"/>
				<updated>2011-04-15T00:07:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9664</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9664"/>
				<updated>2011-04-14T23:45:20Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* Under the hood */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9663</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9663"/>
				<updated>2011-04-14T23:44:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* What does it look like */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9662</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9662"/>
				<updated>2011-04-14T23:44:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* What does it look like */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9661</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9661"/>
				<updated>2011-04-14T23:44:26Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* What does it look like */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
This is a screenshot of the BioPortal Import plugin showing the SNOMED CT ontology classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9660</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9660"/>
				<updated>2011-04-14T23:42:36Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How does it work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
Like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9659</id>
		<title>BioPortal Import Plugin</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=BioPortal_Import_Plugin&amp;diff=9659"/>
				<updated>2011-04-14T23:41:03Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: /* How to use it */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Plugin&lt;br /&gt;
|Description=The BioPortal Import Plugin allows the user to import classes from external ontologies stored in BioPortal. The user can import entire trees of classes with a desired depth and choose which properties to import for each class.&lt;br /&gt;
|PluginType=Slot Widget&lt;br /&gt;
|ForApplication1=Protege-OWL&lt;br /&gt;
|HomepageURL=http://protegewiki.stanford.edu/index.php/BioPortal_Import_Plugin&lt;br /&gt;
|DeveloperID1=Jithun Nair&lt;br /&gt;
|DeveloperID2=Tania Tudorache&lt;br /&gt;
|LastUpdated=April 12, 2011&lt;br /&gt;
|Topic1=Biomedical Informatics&lt;br /&gt;
|Topic2=Search&lt;br /&gt;
|Topic3=Navigation&lt;br /&gt;
|Topic4=Terminologies&lt;br /&gt;
|Topic5=Import&lt;br /&gt;
|License=MPL&lt;br /&gt;
|Affiliation1=Stanford Center for Biomedical Informatics Research&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:block; float:left; width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
`&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The BioPortal Reference plugin is added as an action to the OWLClasses tab of the Protege-OWL user interface. The plugin allows a user to import classes from external BioPortal ontologies into a local ontology in Protege-OWL. The basic steps in using the plugin are to: a) browse through all the BioPortal ontologies (except remote ones) and select which one to import classes from; b) select one or more classes to import from the BioPortal ontology, and c) import them as subclasses of the selected class in the local ontology.&lt;br /&gt;
&lt;br /&gt;
The plugin uses the RESTful services provided by BioPortal to allow the user to browse through the latest versions of all BioPortal ontologies. However, remote ontologies (identified by the value of their isRemote property) cannot be explored in the plugin, since BioPortal does not provide the information for these ontologies through its REST services. The user can view the classes of the selected ontology in an expandable tree format, and also view the properties of each class. &lt;br /&gt;
&lt;br /&gt;
The plugin is configurable and works with Protege-OWL. The configurations provide users with the ability to: a) import entire subtrees of classes from BioPortal ontologies; b) save the imported classes as a separate ontology and/or as a file to the local disk, and c) choose which (if any) property values to import for each class and assign an equivalent user property for each imported property, if desired.&lt;br /&gt;
&lt;br /&gt;
= What does it look like =&lt;br /&gt;
&lt;br /&gt;
Like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Import_classes_from_BioPortal.png]]&lt;br /&gt;
&lt;br /&gt;
= Under the hood =&lt;br /&gt;
&lt;br /&gt;
The plugin creates instances of the &amp;lt;code&amp;gt;OWLNamedClass&amp;lt;/code&amp;gt; class to store all the imported classes from BioPortal. If the user chooses to import any property of the imported classes, it is assigned to one of the &amp;lt;code&amp;gt;OWLAnnotationProperties&amp;lt;/code&amp;gt; of the current &amp;lt;code&amp;gt;OWLModel&amp;lt;/code&amp;gt;, as configured by the user.&lt;br /&gt;
&lt;br /&gt;
An example of an imported class &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;SNOMED Clinical Terms&amp;lt;/code&amp;gt; ontology in BioPortal is shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ExternalReferenceInstance.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To display the list of ontologies in BioPortal, get the details of the classes and their properties etc., the plugin invokes the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services BioPortal Restful Services].&lt;br /&gt;
&lt;br /&gt;
= How does it work =&lt;br /&gt;
&lt;br /&gt;
The usage of the plugin should be quite straightforward. &lt;br /&gt;
&lt;br /&gt;
'''To create a new external reference''' just click on the link ''Create a new reference from BioPortal''. After that you will see a popup window like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearch.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By default, the plugin will start a search in BioPortal using the selected class (or property, individual) name; in the case above, ''Heart''. The panel shows the list of search results for the term from BioPortal: You will see the term name and the ontology in which it was found.&lt;br /&gt;
&lt;br /&gt;
If you are not satisfied with the searched term or results, you may type in your own search term.&lt;br /&gt;
&lt;br /&gt;
'''To import an external reference''' simply click on the ''Import'' link. A new external reference instance (or class, depending on your configuration) has been created for you.&lt;br /&gt;
&lt;br /&gt;
Before importing, you also have the option of '''looking at the content of the term in BioPortal''', by clicking on the little File icon on a row. You will see the details of the term from BioPortal (this will not be imported):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalDetails.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively, you may click on the little tree icon from a row to '''see a graph representation of the neighbourhood of the referenced term''' from BioPortal. A new window will open in your default web browser (e.g. Firefox, Safari, IE, etc.) showing the neighbourhood graph. You will need to have Flash installed to see the graph.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalGraph.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to use it = &lt;br /&gt;
&lt;br /&gt;
The BioPortal Import plugin can be invoked by selecting a class of a domain ontology in the &amp;lt;code&amp;gt;OwlClasses&amp;lt;/code&amp;gt; tab in Protege-OWL and then clicking on the icon as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortal_Import_Plugin_icon.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Create a reference property ==&lt;br /&gt;
&lt;br /&gt;
To use it with OWL projects, first decide on a property that will store as values the instances of external references. You can either choose from existing properties (''foaf:topicOf'', or others), or you can create your own annotation property, for example, ''externalReference''. You may also use object properties, or just plain RDF properties. If you don't already have this property defined in your ontology, please create it.&lt;br /&gt;
&lt;br /&gt;
== Configure the form ==&lt;br /&gt;
&lt;br /&gt;
Second step is to configure the form of the class where you want to use the plugin. For example, if you would like to add external references to all classes (e.g., ''Pizza'' class, ''Heart'' class, etc.), then you will have to configure the form of the &amp;lt;code&amp;gt;owl:Class&amp;lt;/code&amp;gt;. To configure the form, click on a class in your ontology and click on the little &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt; icon at the top-right hand side of the ClassesTab. You will get a dialog whether to make owl:Class visible, click OK.&lt;br /&gt;
&lt;br /&gt;
Then go to the ''Forms Tab'' (you may already be there after closing the dialog), make sure that owl:Class is selected, and double click on an empty spot. You will get a dialog with all properties and their attached widget. For the reference property from step 1 (e.g., ''externalReference'') associate the ''BioPortalReferenceWidget''. &lt;br /&gt;
&lt;br /&gt;
'''Note''': The new widget will be created under the top widget (it's a bug), so just drag the top widget to right a little bit, and drag from underneath the BioPortalReference widget to a place of your choice in the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configure the widget ==&lt;br /&gt;
&lt;br /&gt;
Normally, you would not change the default configuration of the widget, but in case you need to customize it for your own project please read this section. Otherwise, you may just skip it.&lt;br /&gt;
&lt;br /&gt;
You may configure the widget in the Forms Tab by double clicking on the BioPortalReference widget. In the '''Columns'' Tab, you may configure what columns and the width of each column that should show up:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalColumns.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, you may remove the ''url'' slot and this will be removed from the display of the BioPortalReferenceWidget, or you may add other column, or switch the order.&lt;br /&gt;
&lt;br /&gt;
In the '''Search Tab''', you may configure the search parameters for BioPortal:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BioPortalSearchConfig.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The result ==&lt;br /&gt;
&lt;br /&gt;
Below is a screenshot that shows the OWLClasses tab, for which we have configured using the steps above, the BioPortalReference widget:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pizza_with_BPRef.png]]&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
&lt;br /&gt;
The plugin is distributed with the Protege 3.4.2 release and newer. However, we might need to make changes to the plugin to keep in sync with the BioPortal releases. For this reason, we also provide separate downloads for the plugin.&lt;br /&gt;
&lt;br /&gt;
We have a patch version of the plugin for Protege 3.4.3, that can be downloaded from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here]. Unzip it into your Protege 3.4.x plugin folder. (Make sure you override the old versions of the plugin.)&lt;br /&gt;
&lt;br /&gt;
The source code of the plugin is available in our SVN: http://smi-protege.stanford.edu/svn/bioportal-reference-plugin/trunk/ and it is licensed under Mozilla Public License.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Developer's Guide =&lt;br /&gt;
&lt;br /&gt;
This plugin is very easy to extend.&lt;br /&gt;
&lt;br /&gt;
== Configure the classpath and Eclipse setup ==&lt;br /&gt;
&lt;br /&gt;
First, you should get the sources of the plugin from the SVN repository, as explained in the above section. The plugin depends on:&lt;br /&gt;
* standard-extensions (get the one in the zip from [http://smi-protege.stanford.edu/collab-protege/tmp/bioportalReference.zip here])&lt;br /&gt;
* protege-owl&lt;br /&gt;
* xstream libs (get the binary version from [http://xstream.codehaus.org/download.html here], Libs needed in the classpath: xpp3_min_xyz.jar and xstream-xyz.jar)&lt;br /&gt;
&lt;br /&gt;
If you would like to use Eclipse development environment, we have a guide of how to set it up for plugin development [[SetUpEclipseForPlugin|here]].&lt;br /&gt;
&lt;br /&gt;
== Explanation of classes ==&lt;br /&gt;
&lt;br /&gt;
The plugin is very simple. It has classes for UI and classes for accessing BioPortal through rest services.&lt;br /&gt;
&lt;br /&gt;
The slot plugin class (main UI) is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.BioPortalReferenceWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The panel in which you can search and import from BioPortal is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reference model class that creates the reference instances and makes the actual import is: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.ReferenceModel&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to change the way that references are imported, change the method (or create your own):&lt;br /&gt;
&lt;br /&gt;
 public Instance createReference(String bpBaseUrl, String conceptId, String ontologyVersionId, String preferredName, String ontologyName)&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;code&amp;gt;org.ncbo.stanford&amp;lt;/code&amp;gt; contains the classes that can can invoke a rest service to BioPortal and that can read in the results. All you need to invoke the services is in the &amp;lt;code&amp;gt;org.ncbo.stanford.util&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Invoke BioPortal Rest services ==&lt;br /&gt;
&lt;br /&gt;
The BioPortal Rest services are documented [http://www.bioontology.org/wiki/index.php/NCBO_REST_services here].&lt;br /&gt;
&lt;br /&gt;
For example, to invoke a search in BioPortal, you can use the utility class:&lt;br /&gt;
&lt;br /&gt;
 BioportalSearch sd = new BioportalSearch();&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/search/Myocardial%20Infarct?pagesize=20&amp;amp;pagenum=1&amp;quot;;&lt;br /&gt;
 try {			&lt;br /&gt;
    Page p = sd.getSearchResults(new URL(urlStr));&lt;br /&gt;
    SearchResultListBean data = p.getContents();&lt;br /&gt;
    for (SearchBean searchBean : data.getSearchResultList()) {&lt;br /&gt;
        System.out.println(searchBean.getPreferredName() + &amp;quot;\t&amp;quot; + searchBean.getOntologyDisplayLabel());&lt;br /&gt;
    }&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  } catch (IOException e) {			&lt;br /&gt;
     e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
For an example implementation see: &amp;lt;code&amp;gt;edu.stanford.bmir.protegex.bp.ref.SearchPanel.getSearchResultsHtml()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get all details of a concept, you can use the following code:&lt;br /&gt;
&lt;br /&gt;
 BioportalConcept c = new BioportalConcept();		&lt;br /&gt;
 String urlStr = &amp;quot;http://rest.bioontology.org/bioportal/concepts/39002/BRO:Resource&amp;quot;;		&lt;br /&gt;
 try {			&lt;br /&gt;
    ClassBean cb = c.getConceptProperties(new URL(urlStr));&lt;br /&gt;
    System.out.println(cb.getFullId() + &amp;quot; &amp;quot; + cb.getId() + &amp;quot; &amp;quot; + cb.getLabel());&lt;br /&gt;
    Map&amp;lt;Object, Object&amp;gt; relationsMap = cb.getRelations();&lt;br /&gt;
    for (Map.Entry&amp;lt;Object, Object&amp;gt; e : relationsMap.entrySet()) {&lt;br /&gt;
         System.out.println(e.getKey() + &amp;quot;: &amp;quot; + e.getValue());				&lt;br /&gt;
    }			&lt;br /&gt;
  } catch (MalformedURLException e) {&lt;br /&gt;
        e.printStackTrace();&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to get help and complain =&lt;br /&gt;
&lt;br /&gt;
If you have any problems with the plugin, please post a message on the protege mailing list (protege-owl for OWL ontologies, and protege-discussion for Protege frames ontologies). Instructions for posting on the lists are here: &lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/lists.html&lt;br /&gt;
&lt;br /&gt;
'''Before posting, please check the email list archives, whether the question has already been answered:'''&lt;br /&gt;
&lt;br /&gt;
http://protege.stanford.edu/community/archives.html&lt;br /&gt;
&lt;br /&gt;
'''Thank you!'''&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=File:BioPortal_Import_Plugin_icon.png&amp;diff=9658</id>
		<title>File:BioPortal Import Plugin icon.png</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=File:BioPortal_Import_Plugin_icon.png&amp;diff=9658"/>
				<updated>2011-04-14T23:39:27Z</updated>
		
		<summary type="html">&lt;p&gt;Jnair: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jnair</name></author>	</entry>

	</feed>