Class: AnnotationView

AnnotationView()

A view of a single semantic annotation for a metadata field. It is usually displayed on the MetadataView.

Screenshot

Constructor

new AnnotationView()

Source:

Extends

  • Backbone.View

Members

className

Source:

context :string

Context string is a human-readable bit of text that comes out of the Metacat view service and describes the context of the annotation i.e., what entity, or which attribute within which entity the annotation is on
Type:
  • string
Source:

events

Source:

popupTemplate :UnderscoreTemplate

The template for the popup content that appears when the user clicks on the annotation.
Type:
  • UnderscoreTemplate
Source:

property :AnnotationPart

The property part of the annotation. Created in initialize.
Type:
Source:

type :string

The type of View this is
Type:
  • string
Source:

value :AnnotationPart

The value part of the annotation. Created in initialize.
Type:
Source:

Methods

createPopup(annotationPart)

Create a new popup for the given annotation part.
Parameters:
Name Type Description
annotationPart "property" | "value" Which annotation part to create a popup for.
Source:

fetchClass(uri) → {Promise.<(BioontologyClass|null)>}

Fetch a BioPortal class from the BioPortal API.
Parameters:
Name Type Description
uri string The URI of the class to fetch
Since:
  • 2.32.0
Source:
Returns:
The BioontologyClass model for the given URI, or null if it could not be found.
Type
Promise.<(BioontologyClass|null)>

findClass(annotationPart) → {Promise.<(BioontologyClass|null)>}

Find a BioPortal class for the given annotation part, either from the cache or by fetching it.
Parameters:
Name Type Description
annotationPart "property" | "value" The annotation part to find a class for
Since:
  • 2.32.0
Source:
Returns:
The BioontologyClass model for the annotation part, or null if it could not be found.
Type
Promise.<(BioontologyClass|null)>

findMore(e)

Send the user to a pre-canned search for a term.
Parameters:
Name Type Description
e Event Click event
Source:

getClassFromCache(uri) → {BioontologyClass|null}

Get a BioPortal class from the cache.
Parameters:
Name Type Description
uri string The URI of the class to get from the cache
Since:
  • 2.32.0
Source:
Returns:
The BioontologyClass model for the given URI, or null if it could not be found.
Type
BioontologyClass | null

getFriendlyOntologyName(uri) → {string}

Get a friendly name (ie ECSO) from a long BioPortal URI
Parameters:
Name Type Description
uri string A URI returned from the BioPortal API
Source:
Returns:
A friendly name for the ontology
Type
string

handleClick(e)

Click handler for when the user clicks either the property or the value portion of the pill. If the popup hasn't yet been created for either, we create the popup and query BioPortal for more information. Otherwise, we do nothing and Semantic's default popup handling is triggered, showing the popup.
Parameters:
Name Type Description
e Event Click event
Source:

initialize()

Source:

queryAndUpdate(annotationPart)

Find a definition for the value URI either from cache or from Bioportal. Updates the popup if necessary.
Parameters:
Name Type Description
annotationPart "property" | "value" The annotation part to query for a definition.
Source:

render()

Source:

setAnnotationDataFromDOM()

Given the DOM element that was passed in (via {el: ...}), extract the label and URI for both the annoation property and value.
Since:
  • 2.32.0
Source:

showPopup(annotationPart)

Show the popup for the given annotation part.
Parameters:
Name Type Description
annotationPart "property" | "value" The annotation part to show the popup for.
Since:
  • 2.32.0
Source:

updatePopup(annotationPart)

Update the popup data and raw HTML.
Parameters:
Name Type Description
annotationPart "property" | "value" The annotation part to update
Source: