Skip to content

Commit

Permalink
Update annotation policy and fix versioning for Digital Specimen and …
Browse files Browse the repository at this point in the history
…Media

Update annotation policy and fix versioning for Digital Specimen and Media
  • Loading branch information
TomDijkema committed Nov 8, 2024
1 parent 422b8d6 commit 658cfc9
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 80 deletions.
4 changes: 2 additions & 2 deletions src/components/digitalMedia/DigitalMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const DigitalMedia = () => {
fetch.Fetch({
params: {
handle: `${params.prefix}/${params.suffix}`,
version: ''
version: params.version
},
triggers: [params.suffix],
triggers: [params.suffix, params.version],
Method: GetDigitalMedia,
Handler: (digitalMedia: DigitalMediaType) => dispatch(setDigitalMedia(digitalMedia))
});
Expand Down
42 changes: 24 additions & 18 deletions src/components/digitalMedia/components/topBar/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Import Dependencies */
import { useState } from "react";
import { Row, Col } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

/* Import Hooks */
import { useFetch } from "app/Hooks";
Expand Down Expand Up @@ -40,10 +41,11 @@ const TopBar = (props: Props) => {
const { digitalMedia, annotationMode, annotoriousMode, ToggleAnnotationSidePanel, SetAnnotoriousMode } = props;

/* Hooks */
const navigate = useNavigate();
const fetch = useFetch();

/* Base variables */
const [digitalMediaVersions, setDigitalMediaVersions] = useState<string[]>([]);
const [digitalMediaVersions, setDigitalMediaVersions] = useState<number[] | undefined>();
const actionDropdownItems: DropdownItem[] = [
{
label: 'View JSON',
Expand All @@ -58,9 +60,9 @@ const TopBar = (props: Props) => {
];

/* Construct version dropdown items */
const versionDropdownItems: DropdownItem[] = digitalMediaVersions?.map(digitalMediaVersion => ({
const versionDropdownItems: DropdownItem[] | undefined = digitalMediaVersions?.map(digitalMediaVersion => ({
label: `Version ${digitalMediaVersion}`,
value: digitalMediaVersion
value: `${digitalMediaVersion}`
}));

/* OnLoad: fetch digital media versions */
Expand All @@ -69,7 +71,7 @@ const TopBar = (props: Props) => {
handle: digitalMedia['ods:ID'].replace(import.meta.env.VITE_DOI_URL, '')
},
Method: GetDigitalMediaVersions,
Handler: (versions: string[]) => {
Handler: (versions: number[]) => {
setDigitalMediaVersions(versions);
}
});
Expand Down Expand Up @@ -117,20 +119,24 @@ const TopBar = (props: Props) => {
{/* MIDS level and version select */}
<Col lg={{ span: 3 }}>
<Row>
<Col lg="auto">
<Dropdown items={versionDropdownItems}
selectedItem={{
label: fetch.loading ? 'Loading..' : `Version ${digitalMedia['ods:version']}`,
value: fetch.loading ? 'loading' : digitalMedia['ods:version'].toString()
}}
hasDefault={true}
styles={{
color: '#f1f1f3',
background: '#a1d8ca',
borderRadius: '999px'
}}
/>
</Col>
{versionDropdownItems &&
<Col lg="auto">
<Dropdown items={versionDropdownItems}
selectedItem={{
label: fetch.loading ? 'Loading..' : `Version ${digitalMedia['ods:version']}`,
value: fetch.loading ? 'loading' : digitalMedia['ods:version'].toString()
}}
hasDefault={true}
styles={{
color: '#f1f1f3',
background: '#a1d8ca',
borderRadius: '999px'
}}
OnChange={(dropdownItem: DropdownItem) =>
navigate(`/dm/${digitalMedia["ods:ID"].replace(import.meta.env.VITE_DOI_URL, '')}/${dropdownItem.value}`)}
/>
</Col>
}
</Row>
</Col>
<Col lg="auto">
Expand Down
28 changes: 15 additions & 13 deletions src/components/digitalSpecimen/DigitalSpecimen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const DigitalSpecimen = () => {
{
alias: 'digitalSpecimen',
params: {
handle: `${params.prefix}/${params.suffix}`
handle: `${params.prefix}/${params.suffix}`,
version: params.version
},
Method: GetDigitalSpecimen

Expand All @@ -65,6 +66,7 @@ const DigitalSpecimen = () => {
Method: GetDigitalSpecimenDigitalMedia
}
],
triggers: [params.version],
Handler: (results: {
digitalSpecimen: DigitalSpecimenType | undefined,
digitalMedia: DigitalMedia[]
Expand Down Expand Up @@ -161,18 +163,18 @@ const DigitalSpecimen = () => {
<Footer />
</div>
</Col>
{digitalSpecimen &&
<div className={`${annotationSidePanelClass} h-100 tr-smooth`}>
<AnnotationSidePanel superClass={digitalSpecimen}
schema={DigitalSpecimenSchema}
GetAnnotations={GetDigitalSpecimenAnnotations}
GetMas={GetDigitalSpecimenMas}
GetMasJobRecords={GetDigitalSpecimenMasJobRecords}
ScheduleMas={ScheduleDigitalSpecimenMas}
HideAnnotationSidePanel={() => setAnnotationMode(false)}
/>
</div>
}
{digitalSpecimen &&
<div className={`${annotationSidePanelClass} h-100 tr-smooth`}>
<AnnotationSidePanel superClass={digitalSpecimen}
schema={DigitalSpecimenSchema}
GetAnnotations={GetDigitalSpecimenAnnotations}
GetMas={GetDigitalSpecimenMas}
GetMasJobRecords={GetDigitalSpecimenMasJobRecords}
ScheduleMas={ScheduleDigitalSpecimenMas}
HideAnnotationSidePanel={() => setAnnotationMode(false)}
/>
</div>
}
</Row>
</Container>
</div>
Expand Down
42 changes: 24 additions & 18 deletions src/components/digitalSpecimen/components/topBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useState } from "react";
import { Row, Col } from "react-bootstrap";
import { useNavigate } from "react-router-dom";

/* Import Hooks */
import { useFetch } from "app/Hooks";
Expand Down Expand Up @@ -40,10 +41,11 @@ const TopBar = (props: Props) => {
const { digitalSpecimen, annotationMode, ToggleAnnotationSidePanel } = props;

/* Hooks */
const navigate = useNavigate();
const fetch = useFetch();

/* Base variables */
const [digitalSpecimenVersions, setDigitalSpecimenVersions] = useState<string[]>([]);
const [digitalSpecimenVersions, setDigitalSpecimenVersions] = useState<number[] | undefined>();
const actionDropdownItems: DropdownItem[] = [
{
label: 'View JSON',
Expand All @@ -58,9 +60,9 @@ const TopBar = (props: Props) => {
];

/* Construct version dropdown items */
const versionDropdownItems: DropdownItem[] = digitalSpecimenVersions?.map(digitalSpecimenVersion => ({
const versionDropdownItems: DropdownItem[] | undefined = digitalSpecimenVersions?.map(digitalSpecimenVersion => ({
label: `Version ${digitalSpecimenVersion}`,
value: digitalSpecimenVersion
value: `${digitalSpecimenVersion}`
}));

/* OnLoad: fetch digital specimen versions */
Expand All @@ -69,7 +71,7 @@ const TopBar = (props: Props) => {
handle: digitalSpecimen['ods:ID'].replace(import.meta.env.VITE_DOI_URL, '')
},
Method: GetDigitalSpecimenVersions,
Handler: (versions: string[]) => {
Handler: (versions: number[]) => {
setDigitalSpecimenVersions(versions);
}
});
Expand Down Expand Up @@ -129,20 +131,24 @@ const TopBar = (props: Props) => {
{`MIDS level ${digitalSpecimen["ods:midsLevel"]}`}
</span>
</Col>
<Col lg="auto">
<Dropdown items={versionDropdownItems}
selectedItem={{
label: fetch.loading ? 'Loading..' : `Version ${digitalSpecimen['ods:version']}`,
value: fetch.loading ? 'loading' : digitalSpecimen['ods:version'].toString()
}}
hasDefault={true}
styles={{
color: '#f1f1f3',
background: '#a1d8ca',
borderRadius: '999px'
}}
/>
</Col>
{versionDropdownItems &&
<Col lg="auto">
<Dropdown items={versionDropdownItems}
selectedItem={{
label: fetch.loading ? 'Loading..' : `Version ${digitalSpecimen['ods:version']}`,
value: fetch.loading ? 'loading' : digitalSpecimen['ods:version'].toString()
}}
hasDefault={true}
styles={{
color: '#f1f1f3',
background: '#a1d8ca',
borderRadius: '999px'
}}
OnChange={(dropdownItem: DropdownItem) =>
navigate(`/ds/${digitalSpecimen["ods:ID"].replace(import.meta.env.VITE_DOI_URL, '')}/${dropdownItem.value}`)}
/>
</Col>
}
</Row>
</Col>
<Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,80 +49,116 @@ const AnnotationPolicyText = (props: Props) => {
{/* Policy content */}
<Row className="mt-5">
<Col>
{/* User requirements */}
{/* Requirements for Annotations */}
<Row>
<Col>
<p className="fs-3 fw-bold">
User Requirements
<p className="fs-4 fw-bold">
Requirements for Annotations
</p>

<ul>
<ul className="fs-5">
<li>
To create annotations, users must have a valid ORCID identifier.
Annotators are required to provide annotations that are true, unabiguous, traceable and reusable by others to the
best of their abilities, with appropriate attribution for used sources. This does not apply for DiSSCo’s sandbox and
development environments, which have a testing purpose.
</li>
<li>
We recommend that users add their institutional email to their ORCID record.
DiSSCo may block and report users that provide fake or inappropriate data.
</li>
</ul>
</Col>
</Row>
{/* Visibility of annotations */}
{/* Identification */}
<Row className="mt-2">
<Col>
<p className="fs-3 fw-bold">
Visibility of Annotations
<p className="fs-4 fw-bold">
Identification
</p>

<ul>
<ul className="fs-5">
<li>
All annotations are public and can be viewed by anyone.
To create annotations, you are identified with the ORCID identifier you supplied. This identifier must be about you and
not misrepresent your identity in any manner, in agreement with ORCID terms-of-use.
</li>
<li>
No authentication is required to view annotation records.
DiSSCo aims to use your ORCID to identify you and credit you for your annotations and DiSSCo may share this information
openly with other infrastructures.
</li>
<li>
Annotations are also accessible via our API without authentication.
It is recommended to make your ORCID profile public so that people can discover your expertise, published works and can contact you by email.
</li>
</ul>
</Col>
</Row>
{/* Machine annotations */}
{/* Accessibility of Annotations */}
<Row className="mt-2">
<Col>
<p className="fs-3 fw-bold">
Machine Annotations
<p className="fs-4 fw-bold">
Accessibility of Annotations
</p>

<ul>
<ul className="fs-5">
<li>
Machine agents and machine annotation services must undergo review and verification before being
added to the Machine Annotation Service Registry.
All annotations are public and are accessible through DiSSCover and through the DiSSCo API.
</li>
<li>
All annotations can be used by anyone without any rights reserved (Creative Commons Zero license).
</li>
</ul>
</Col>
</Row>
{/* Archiving annotations */}
{/* Machine Annotation Services (MAS) */}
<Row className="mt-2">
<Col>
<p className="fs-3 fw-bold">
User Requirements
<p className="fs-4 fw-bold">
Machine Annotation Services (MAS)
</p>

<ul>
<ul className="fs-5">
<li>
Users who run a MAS service are not responsible for the produced MAS annotations.
</li>
<li>
MAS services are free to use unless otherwise stated. Access to MAS may be restricted and service providers
may charge for usage of a MAS service.
</li>
<li>
Users can archive their own individual annotations.
Depending on their function, machine annotations may not always produce trustworthy or valid results.
It is encouraged that MAS implement a confidence score for this purpose.
</li>
<li>
We do not delete annotations. Archived annotations are still accessible via the API;
they are just not visible with the latest digital specimen version.
To ensure trustworthy and secure services, MAS must undergo review and verification before being approved
and added to the MAS Registry.
</li>
</ul>
</Col>
</Row>
{/* Deletion and archiving of annotations*/}
<Row className="mt-2">
<Col>
<p className="fs-4 fw-bold">
Deletion and archiving of annotations
</p>

<p className="fst-italic mt-4">
Note: This policy is subject to refinement. Please check for updates regularly.
</p>
<ul className="fs-5">
<li>
“Deletion” is implemented by making the annotation data inaccessible, the annotation identifier then resolves
to a message explaining why the annotation can no longer be accessed.
</li>
<li>
Annotations can be deleted by the annotator but may also be deleted by DiSSCo, either by an admin or an automated process.
</li>
<li>
Depending on their function, machine annotations may not always produce trustworthy or valid results.
It is encouraged that MAS implement a confidence score for this purpose.
</li>
<li>
Users can also archive annotations if they become obsolete. The annotation is then still accessible via the
API but no longer not visible with the annotated object for users of the DiSSCover interface.
</li>
</ul>
</Col>
</Row>
</Col>
</Row>
</div>
Expand Down

0 comments on commit 658cfc9

Please sign in to comment.