Documentation
¶
Index ¶
- Constants
- func GuardAcquisition(item LegalAcquisitionQueueItem, use string) error
- func GuardExport(asset DocumentAsset) error
- func GuardPrivacyLicensing(review PrivacyLicensingReview) error
- func SelectLegalPDFURL(metadata OpenAccessMetadata) (string, error)
- type BiomedicalFullText
- type BiomedicalLiveDriftSmokeSnapshot
- type BiomedicalLiveDriftSmokeSource
- type BiomedicalSection
- type DocumentAsset
- func FetchArXivAsset(ctx context.Context, projectPath, arxivID, assetURL, kind string) (DocumentAsset, error)
- func FetchPDF(ctx context.Context, projectPath, paperID string, metadata OpenAccessMetadata) (DocumentAsset, error)
- func FetchPDFByDOI(ctx context.Context, projectPath, doi string, metadata OpenAccessMetadata) (DocumentAsset, error)
- func ImportLocalFile(projectPath, sourcePath, paperID string) (DocumentAsset, error)
- func NewDocumentAsset(input DocumentAssetInput) (DocumentAsset, error)
- type DocumentAssetInput
- type LegalAcquisitionQueue
- type LegalAcquisitionQueueItem
- type OpenAccessMetadata
- type PMCIDPMIDLink
- type PrivacyLicensingIssue
- type PrivacyLicensingReview
- type PrivacyLicensingReviewInput
- type SupplementaryFileInfo
Constants ¶
const ( AcquisitionUseDownload = "download" AcquisitionUseArchive = "archive" )
Variables ¶
This section is empty.
Functions ¶
func GuardAcquisition ¶
func GuardAcquisition(item LegalAcquisitionQueueItem, use string) error
func GuardExport ¶
func GuardExport(asset DocumentAsset) error
GuardExport prevents accidental export of restricted or local-only assets.
func GuardPrivacyLicensing ¶
func GuardPrivacyLicensing(review PrivacyLicensingReview) error
func SelectLegalPDFURL ¶
func SelectLegalPDFURL(metadata OpenAccessMetadata) (string, error)
SelectLegalPDFURL returns a PDF URL only when metadata indicates legal open access.
Types ¶
type BiomedicalFullText ¶
type BiomedicalFullText struct {
SchemaVersion string `json:"schemaVersion"`
PMID string `json:"pmid,omitempty"`
PMCID string `json:"pmcid,omitempty"`
DOI string `json:"doi,omitempty"`
Title string `json:"title"`
OAStatus string `json:"oaStatus,omitempty"`
License string `json:"license,omitempty"`
LicenseURL string `json:"licenseUrl,omitempty"`
Sections []BiomedicalSection `json:"sections"`
SupplementaryFiles []SupplementaryFileInfo `json:"supplementaryFiles"`
}
func ImportStructuredBiomedicalFullText ¶
func ImportStructuredBiomedicalFullText(path string) (BiomedicalFullText, error)
func (BiomedicalFullText) Validate ¶
func (f BiomedicalFullText) Validate() error
type BiomedicalLiveDriftSmokeSnapshot ¶
type BiomedicalLiveDriftSmokeSnapshot struct {
SchemaVersion string `json:"schemaVersion"`
Connectors []BiomedicalLiveDriftSmokeSource `json:"connectors"`
}
func NewBiomedicalLiveDriftSmokeSnapshot ¶
func NewBiomedicalLiveDriftSmokeSnapshot() BiomedicalLiveDriftSmokeSnapshot
type BiomedicalSection ¶
type DocumentAsset ¶
type DocumentAsset struct {
SchemaVersion string
PaperID string
AcquisitionSource string
License string
OAStatus string
ChecksumSHA256 string
LocalPath string
MIMEType string
LocalOnly bool
}
DocumentAsset records provenance and policy metadata for a document file.
func FetchArXivAsset ¶
func FetchArXivAsset(ctx context.Context, projectPath, arxivID, assetURL, kind string) (DocumentAsset, error)
FetchArXivAsset downloads an arXiv PDF or TeX source asset into project storage.
func FetchPDF ¶ added in v0.1.8
func FetchPDF(ctx context.Context, projectPath, paperID string, metadata OpenAccessMetadata) (DocumentAsset, error)
FetchPDF downloads a legal open-access PDF into project storage.
func FetchPDFByDOI ¶
func FetchPDFByDOI(ctx context.Context, projectPath, doi string, metadata OpenAccessMetadata) (DocumentAsset, error)
FetchPDFByDOI downloads a legal open-access PDF into project storage.
func ImportLocalFile ¶
func ImportLocalFile(projectPath, sourcePath, paperID string) (DocumentAsset, error)
ImportLocalFile copies a manually supplied document into project-local storage as local-only.
func NewDocumentAsset ¶
func NewDocumentAsset(input DocumentAssetInput) (DocumentAsset, error)
NewDocumentAsset validates metadata and computes the local file checksum.
type DocumentAssetInput ¶
type DocumentAssetInput struct {
PaperID string
AcquisitionSource string
License string
OAStatus string
LocalPath string
MIMEType string
LocalOnly bool
}
DocumentAssetInput is caller-provided metadata for a local document asset.
type LegalAcquisitionQueue ¶
type LegalAcquisitionQueue struct {
SchemaVersion string `json:"schemaVersion"`
Items []LegalAcquisitionQueueItem `json:"items"`
}
func BuildLegalAcquisitionQueue ¶
func BuildLegalAcquisitionQueue(projectPath string, comparison sources.OpenAccessCandidateComparison) LegalAcquisitionQueue
type LegalAcquisitionQueueItem ¶
type LegalAcquisitionQueueItem struct {
ID string `json:"id"`
PaperTitle string `json:"paperTitle"`
DOI string `json:"doi,omitempty"`
Source string `json:"source"`
SourceURL string `json:"sourceUrl"`
ExpectedLocalPath string `json:"expectedLocalPath"`
License string `json:"license,omitempty"`
OAStatus string `json:"oaStatus,omitempty"`
Restricted bool `json:"restricted"`
ReviewerApprovalRequired bool `json:"reviewerApprovalRequired"`
ReviewerApproved bool `json:"reviewerApproved"`
Reviewer string `json:"reviewer,omitempty"`
ApprovalReason string `json:"approvalReason,omitempty"`
Provenance string `json:"provenance"`
Attribution string `json:"attribution,omitempty"`
RateLimitPolicy string `json:"rateLimitPolicy,omitempty"`
APIProvenance string `json:"apiProvenance,omitempty"`
}
func ApproveAcquisition ¶
func ApproveAcquisition(item LegalAcquisitionQueueItem, reviewer, reason string) LegalAcquisitionQueueItem
type OpenAccessMetadata ¶
OpenAccessMetadata is the subset of OA lookup metadata needed for legal PDF selection.
type PMCIDPMIDLink ¶
type PMCIDPMIDLink struct {
PMID string `json:"pmid,omitempty"`
PMCID string `json:"pmcid,omitempty"`
DOI string `json:"doi,omitempty"`
Title string `json:"title,omitempty"`
}
func LinkPMCIDPMID ¶
func LinkPMCIDPMID(records []library.PaperRecord) []PMCIDPMIDLink
type PrivacyLicensingIssue ¶
type PrivacyLicensingReview ¶
type PrivacyLicensingReview struct {
SchemaVersion string `json:"schemaVersion"`
Issues []PrivacyLicensingIssue `json:"issues"`
Blocked bool `json:"blocked"`
Approved bool `json:"approved"`
Reviewer string `json:"reviewer,omitempty"`
ApprovalReason string `json:"approvalReason,omitempty"`
}
func ApprovePrivacyLicensing ¶
func ApprovePrivacyLicensing(review PrivacyLicensingReview, reviewer, reason string) PrivacyLicensingReview
func ReviewPrivacyLicensing ¶
func ReviewPrivacyLicensing(input PrivacyLicensingReviewInput) PrivacyLicensingReview
type PrivacyLicensingReviewInput ¶
type PrivacyLicensingReviewInput struct {
Records []library.PaperRecord `json:"records"`
Assets []DocumentAsset `json:"assets"`
}
type SupplementaryFileInfo ¶
type SupplementaryFileInfo struct {
ID string `json:"id,omitempty"`
Label string `json:"label,omitempty"`
Href string `json:"href"`
}
func DiscoverSupplementaryFiles ¶
func DiscoverSupplementaryFiles(article jatsArticle) []SupplementaryFileInfo