Class: CanonicalDatasetHandlerView

CanonicalDatasetHandlerView()

A scoped subview responsible for inspecting the rendered DOM within the MetadataView to identify and highlight the canonical (original) dataset based on schema.org:sameAs and prov:derivedFrom annotations. This view modifies specific parts of the MetadataView when a canonical dataset is detected, providing a clearer distinction between original and derived datasets.

Screenshot

Constructor

new CanonicalDatasetHandlerView()

Since:
  • 2.32.0
Source:

Extends

  • Backbone.View

Members

metdataView :MetadataView

The MetadataView instance this view is scoped to.
Type:
Source:

type

Source:

Methods

addAlertBox() → {Element}

Adds an alert box to the top of the MetadataView to indicate that the dataset being displayed is a replica or minor variant of the original dataset.
Source:
Returns:
The alert box element that was added to the view.
Type
Element

addInfoIcon() → {Element}

Adds a icon to the header of the MetadataView to indicate that the dataset being displayed is essentially a duplicate
Source:
Returns:
The info icon element that was added to the view.
Type
Element

detectCanonicalDataset() → {boolean}

Inspects the MetadataView DOM to determine if a canonical dataset is present based on schema.org:sameAs and prov:wasDerivedFrom annotations. If a canonical dataset is detected, this method sets the appropriate properties on the view instance.
Source:
Returns:
True if a canonical dataset is detected, false otherwise.
Type
boolean

findCanonicalAnnotations() → {Object}

Given a set annotation views for the sameAs property and a set of annotation views for the derivedFrom property, this method finds any matches between the two sets. A match is found if the URI of the sameAs annotation is the same as the URI of the derivedFrom annotation.
Source:
Returns:
An object containing the matching sameAs and derivedFrom annotation and the URI they share.
Type
Object

getAnnotationViews() → {Array.<AnnotationView>}

Gets all annotation views from the MetadataView.
Source:
Returns:
An array of AnnotationView instances.
Type
Array.<AnnotationView>

getCitationInfo()

Given the canonical dataset URI, fetches citation information for the canonical dataset, like the title, authors, publication date, etc. Saves this information in a CitationModel instance.
Source:

getDerivedFromAnnotationViews() → {Array.<AnnotationView>}

Gets the AnnotationView for the prov:wasDerivedFrom annotation.
Source:
Returns:
An array of derivedFrom AnnotationViews.
Type
Array.<AnnotationView>

getSameAsAnnotationViews() → {Array.<AnnotationView>}

Gets the AnnotationView for the schema.org:sameAs annotation.
Source:
Returns:
An array of sameAs AnnotationViews.
Type
Array.<AnnotationView>

hideAnnotations()

Hides the sameAs and derivedFrom annotations from the MetadataView. This is done to prevent redundancy in the metadata display.
Source:

initialize(options)

Initialize the CanonicalDatasetHandlerView.
Parameters:
Name Type Description
options object A set of options to initialize the view with.
Properties
Name Type Description
metadataView MetadataView The MetadataView instance this view is scoped to. Required.
Source:

modifyCitationModal()

Modifies the CitationModalView to add the citation information for the canonical dataset in addition to the citation information for the current dataset.
Source:

onClose()

Called when the view is removed.
Source:

openCitationModal()

Open the citation modal.
Source:

removeDuplicateAnnotations(annotationViews) → {Array.<AnnotationView>}

Removes duplicate annotations from an array of AnnotationView instances.
Parameters:
Name Type Description
annotationViews Array.<AnnotationView> An array of AnnotationView all with the same property URI.
Source:
Returns:
An array of AnnotationView instances with duplicates removed.
Type
Array.<AnnotationView>

render()

Source:

reset()

Resets the MetadataView to its original state by removing any changes made by this view.
Source:

showAnnotations()

Show previously hidden annotations in the MetadataView.
Source:

updateAlertBox()

Updates the citation information in the alert box.
Source: