documents

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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 BiomedicalLiveDriftSmokeSource

type BiomedicalLiveDriftSmokeSource struct {
	Source         string   `json:"source"`
	OptInEnv       string   `json:"optInEnv"`
	ExpectedFields []string `json:"expectedFields"`
}

type BiomedicalSection

type BiomedicalSection struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

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"`
	Shareable                bool   `json:"shareable"`
	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

type OpenAccessMetadata struct {
	OpenAccess bool
	OAStatus   string
	License    string
	PDFURL     string
}

OpenAccessMetadata is the subset of OA lookup metadata needed for legal PDF selection.

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 PrivacyLicensingIssue struct {
	Kind     string `json:"kind"`
	Severity string `json:"severity"`
	Target   string `json:"target"`
	Message  string `json:"message"`
}

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

type PrivacyLicensingReviewInput

type PrivacyLicensingReviewInput struct {
	Records         []library.PaperRecord `json:"records"`
	Assets          []DocumentAsset       `json:"assets"`
	ShareableReport string                `json:"shareableReport,omitempty"`
}

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

Jump to

Keyboard shortcuts

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