resources

package module
v0.0.0-...-553158b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

resources

This is a model for resources used in the feeds v2 project.

Documentation

Overview

resources.go package supports feedtools modeling a common structure to describe resources. It describes the output model we use to present records in feeds v2. It is largely based on the DataCite Schema 4.3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Award

type Award struct {
	URI    string `json:"award_uri,omitempty"`
	Title  string `json:"title,omitempty"`
	Number string `json:"number,omitempty"`
}

Awards

func (*Award) String

func (award *Award) String() string

type Date

type Date struct {
	Type       string `json:"type,omitempty"`
	Inforation string `json:"information,omitempty"`
	Value      string `json:"value,omitempty"`
}

func (*Date) String

func (dt *Date) String() string

type Description

type Description struct {
	Language  string `json:"language,omitempty"`
	Type      string `json:"type,omitempty"`
	Schema    string `json:"schema,omitempty"`
	SchemaURI string `json:"schema_uri,omitempty"`
	Value     string `json:"value,omitempty"`
}

Description

func (*Description) String

func (description *Description) String() string

type DigitalObject

type DigitalObject struct {
	// Name holds the basename for file including extension,
	// e.g. thesis.pdf
	Name string `json:"name,omitempty"`

	// DOI this is the identifier for this object.
	DOI string `json:"doi,omitempty"`

	// OfficialURL this is the perma link maintained by Caltech Library
	OfficialURL string `json:"official_url,omitempty"`

	// IsPublic is true then we can show this document to public,
	// if false then document is for dark archive
	OpenAccess bool `json:"open_access,omitempty"`

	// Restrictions hold a string describing any restrictions.
	// "public" means it is openly accessible. Other restrictions
	// might be "internal", "staff only", etc.
	Restrictions string `json:"restrictions,omitempty"`

	// Content holds a short string describing the content.
	// e.g. "final", "archival"
	Content string `json:"content,omitempty"`

	// License, individual documents may vary their license
	License string `json:"license,omitempty"`

	// URL a URL pointing at the actual digital object file
	URL string `json:"url,omitempty"`

	// Size in bytes of file
	Size int `json:"size,omitempty"`

	// MimeType (content type), e.g. application/pdf
	MimeType string `json:"mime_type,omitempty"`

	// Revision of the object, in EPrints this is a single digit value
	// down the road we should support semver version number.
	Revision int `json:"rev_number,omitempty"`
}

DigitalObject holds metadata point to the actual digital file(s) references by the resource.

func (*DigitalObject) Anchor

func (do *DigitalObject) Anchor(id string, class string, title string) string

Given a discription render the Digital Object as HTML Anchor element.

func (*DigitalObject) String

func (do *DigitalObject) String() string

type Funder

type Funder struct {
	Agency   *PersonOrOrg `json:"agency,omitempty"`
	Awards   []*Award     `json:"award,omitempty"`
	Citation string       `json:"citation,omitempty"`
}

Funder deviates from the DataCite schema. It is a heirachy relation of funding source and the awards they provided, e.g. a work might be funded through multiple NSF grants and this would group them together. Funding can be from a person or organization though most of the time it is from an organization. Citation is the string that is required to be included by the funding agent. These can be quite long historically particularly for things like Thesis and Disertations.

func (*Funder) String

func (funder *Funder) String() string

type GeoLocation

type GeoLocation struct {
	Place   string   `json:"place,omitempty"`
	Point   *Point   `json:"point,empty"`
	Box     []*Point `json:"box,omitempty"`
	Polygon []*Point `json:"polygon,omitempty"`
}

GeoLocation

func (*GeoLocation) String

func (geoLocation *GeoLocation) String() string

type Identifier

type Identifier struct {
	// Type of identifier
	Type string `json:"type,omitempty"`
	// Schema name
	Schema string `json:"schema,omitempty"`
	// Schema URI
	SchemURI string `json:"schema_uri,omitempty"`
	// Value of the identifier
	Value string `json:"value,omitempty"`
}

Identifier holds an identifer value and descriptive information E.g. DOI and a DOI value.

func (*Identifier) String

func (identifier *Identifier) String() string

type PersonOrOrg

type PersonOrOrg struct {
	// Type of identifier
	Type string `json:"type,omitempty"`
	// Schema name of identifier
	Schema string `json:"schema,omitempty"`
	// Schema URI
	SchemURI string `json:"schema_uri,omitempty"`
	// Role describes the relationship of the name, e.g. creator,
	// contributor, editor.
	Role string `json:"role,omitempty"`
	// Name holds the name of an organization or person
	Name string `json:"name,omitempty"`
	// GivenName
	// e.g. in European names it is often the "first name".
	GivenName string `json:"given_name,omitempty"`
	// FamilyName
	// e.g. in European names it is often the "last name".
	FamilyName string `json:"family_name,omitempty"`
	// HonorificPrefix (e.g. Dr/Mrs/Ms)
	HonorificPrefix string `json:"honorificPrefix,omitempty"`
	// HonorificSuffix (e.g. M.D./PhD/MSCS)
	HonorificSuffix string `json:"honorificSuffix,omitempty"`
	// Lineage (e.g. Jr., Sr., III)
	Lineage string `json:"lineage,omitempty"`
	// Identifiers associated with person or organizaiton
	Identifiers []*Identifier `json:"identifiers,omitempty"`
	// Affilication of the person or organization
	Affiliation []*PersonOrOrg `json:"affiliation,omitempty"`
}

PersonOrOrg holds a person or organization's name, role (e.g. creator, contributor, editor), identifiers and affiliation

func (*PersonOrOrg) String

func (personOrOrg *PersonOrOrg) String() string

type Point

type Point struct {
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
	Altitude  float64 `json:"altitude,omitempty"`
}

Point

func (*Point) String

func (pt *Point) String() string

type RelatedItem

type RelatedItem struct {
	RelationType              string `json:"relation_type,omitempty"`
	RelatedItemType           string `json:"related_item_type,omitempty"`
	RelatedItemIdentifier     string `json:"related_item_identifier,omitempty"`
	RelatedItemIdentifierType string `json:"related_item_identifier_type,omitempty"`
	Creator                   string `json:"creator,omitempty"`
	Title                     string `json:"title,omitempty"`
	PublicationYear           string `json:"publication_year,omitempty"`
	Volume                    string `json:"volume,omitempty"`
	Issue                     string `json:"issue,omitempty"`
	Number                    string `json:"numnber,omitempty"`
	FirstPage                 string `json:"first_page,omitempty"`
	LastPage                  string `json:"last_page,omitempty"`
	Publisher                 string `json:"publisher,omitempty"`
	Edition                   string `json:"edition,omitempty"`
	Contributor               string `json:"contributor,omitempty"`
}

RelatedItem follows DataCite but feels wrong. It seems like you want describe a relationship and point at anther resource rather than hold minimal journal citation values

func (*RelatedItem) String

func (relatedItem *RelatedItem) String() string

type Resource

type Resource struct {
	Identifier      *Identifier    `json:"identifier,omitempty"`
	Creators        []*PersonOrOrg `json:"creators,omitempty"`
	Titles          []*Title       `json:"titles,omitempty"`
	Publisher       string         `json:"publisher,omitempty"`
	PublicationYear string         `json:"publication_year,omitempty"`
	// An approxite date in YYYY-MM-DD notation. Not in datacite spec.
	PublicationDate    string         `json:"publication_date,omitempty"`
	Subjects           []*Subject     `json:"subjects,omitempty"`
	Contributors       []*PersonOrOrg `json:"contributors,omitempty"`
	Dates              []*Date        `json:"dates,omitempty"`
	Language           string         `json:"language,omitempty"`
	ResourceType       *ResourceType  `json:"resource_type,omitempty"`
	AltIdentifiers     []*Identifier  `json:"alternate_identifiers,omitempty"`
	RelatedIdentifiers []*Identifier  `json:"related_identifiers,omitempty"`
	Sizes              []string       `json:"sizes,omitempty"`
	Formats            []string       `json:"formats,omitempty"`
	Version            string         `json:"version,omitempty"`
	RightsList         []*Rights      `json:"rights_list,omitempty"`
	Descriptions       []*Description `json:"description,omitempty"`
	GeoLocations       []*GeoLocation `json:"geo_locations,omitempty"`
	Funders            []*Funder      `json:"funders,omitempty"`
	RelatedItems       []*RelatedItem `json:"related_items,omitempty"`

	// PrimaryObject holds the primary digital artifact
	PrimaryObject *DigitalObject `json:"primary_object,omitempty"`

	// RelatedObjects is the other objects associated with resource
	RelatedObjects []*DigitalObject `json:"related_objects,omitempty"`

	// Additoinal custom fields ...
	CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
}

Resource holds a record such as an description of a dataset, journal article, thesis, etc. It includes more root fields than a DataCite resource because feeds needs more specificity.

func (*Resource) String

func (resource *Resource) String() string

type ResourceType

type ResourceType struct {
	Type string `json:"type,omitempty"`
	// Schema name
	Schema string `json:"schema,omitempty"`
	// Schema URI
	SchemURI string `json:"schema_uri,omitempty"`
	// Value describing resource type
	Value string `json:"value,omitempty"`
}

ResourceType

func (*ResourceType) String

func (resourceType *ResourceType) String() string

type Rights

type Rights struct {
	// Identifier
	Identifier *Identifier `json:"identifier,omitempty"`
	Language   string      `json:"language,omitempty"`
	// Schema name
	Schema string `json:"schema,omitempty"`
	// Schema URI
	SchemURI string `json:"schema_uri,omitempty"`
	// URI to rights document
	URI string `json:"uri,omitempty"`
	// describing rights
	Value string `json:"value,omitempty"`
}

Rights

func (*Rights) String

func (rights *Rights) String() string

type Subject

type Subject struct {
	Language  string `json:"language,omitempty"`
	Schema    string `json:"schema,omitempty"`
	SchemaURI string `json:"schema_uri,omitempty"`
	// Code holds the classification code is one applies
	Code string `json:"code,omitempty"`
	// Value holds the subject itself
	Value string `json:"subject,omitempty"`
}

Subject

func (*Subject) String

func (subject *Subject) String() string

type Title

type Title struct {
	// Language title is expressed in
	Language string `json:"language,omitempty"`
	// Type of title, e.g. sub-title
	Type string `json:"type,omitempty"`
	// Value holds the title itself
	Value string `json:"title"`
}

Title holds the title associated with a resource

func (*Title) String

func (title *Title) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL