model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package model defines data structures for annotations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DocToIDs

func DocToIDs(ml []*AnnoDoc) []string

DocToIDs extracts the document keys from a slice of AnnoDoc pointers.

func FeatureAnnotationSchema

func FeatureAnnotationSchema() ([]byte, error)

FeatureAnnotationSchema returns a JSON schema for validating feature annotations.

func PubSchema

func PubSchema() ([]byte, error)

PubSchema returns a JSON schema containing three mandatory fields: id (string), created_at (date-time), and updated_at (date-time).

func Schema

func Schema() []byte

Schema returns a JSON schema definition for OrganismDoc as []byte.

func UniqueModel

func UniqueModel[T comparable](slice []T) []T

UniqueModel returns a new slice containing only the unique elements of the input.

Types

type AnnoDoc

type AnnoDoc struct {
	driver.DocumentMeta
	Value         string    `json:"value"`
	EditableValue string    `json:"editable_value"`
	CreatedBy     string    `json:"created_by"`
	EnrtyID       string    `json:"entry_id"`
	Rank          int64     `json:"rank"`
	IsObsolete    bool      `json:"is_obsolete"`
	Version       int64     `json:"version"`
	CreatedAt     time.Time `json:"created_at"`
	Ontology      string    `json:"ontology,omitempty"`
	Tag           string    `json:"tag,omitempty"`
	CvtID         string    `json:"cvtid,omitempty"`
	NotFound      bool
}

AnnoDoc represents a single tagged annotation document stored in ArangoDB.

func ConvToModel

func ConvToModel(i any) (*AnnoDoc, error)

ConvToModel converts a generic interface value to an AnnoDoc model.

type AnnoGroup

type AnnoGroup struct {
	AnnoDocs  []*AnnoDoc `json:"annotations"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	GroupID   string     `json:"group_id"`
}

AnnoGroup represents a group of annotation documents.

type AnnoTag

type AnnoTag struct {
	Name       string `json:"name"`
	ID         string `json:"id"`
	IsObsolete bool   `json:"is_obsolete"`
	Ontology   string `json:"ontology"`
}

AnnoTag represents an ontology term used as an annotation tag.

type DBGroup

type DBGroup struct {
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Group     []string  `json:"group"`
	GroupID   string    `json:"_key,omitempty"`
}

DBGroup represents the database-level structure of an annotation group.

type DBLinkDoc

type DBLinkDoc struct {
	PrimaryID string `json:"primary_id"`
	Database  string `json:"database"`
	Version   int64  `json:"version"`
	LinkType  string `json:"linktype,omitempty"`
	URL       string `json:"url,omitempty"`
	Label     string `json:"label,omitempty"`
}

DBLinkDoc represents a link to an external database identifier.

type FeatureAnnotationDoc

type FeatureAnnotationDoc struct {
	driver.DocumentMeta
	Type         string           `json:"feature_type,omitempty"`
	AnnoID       string           `json:"feature_id"`
	CreatedAt    time.Time        `json:"created_at"`
	UpdatedAt    time.Time        `json:"updated_at"`
	CreatedBy    string           `json:"created_by"`
	UpdatedBy    string           `json:"updated_by"`
	Name         string           `json:"name"`
	Synonyms     []string         `json:"synonyms,omitempty"`
	Publications []string         `json:"publications,omitempty"`
	Pubmed       []string         `json:"pubmed,omitempty"`
	DBLinks      []DBLinkDoc      `json:"dblinks,omitempty"`
	Properties   []TagPropertyDoc `json:"properties,omitempty"`
	IsObsolete   bool             `json:"is_obsolete"`
	NotFound     bool             `json:"-"`
}

FeatureAnnotationDoc represents a feature annotation document in the database.

type OrganismDoc

type OrganismDoc struct {
	driver.DocumentMeta
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	CreatedBy    string    `json:"created_by"`
	UpdatedBy    string    `json:"updated_by"`
	Abbreviation string    `json:"abbreviation,omitempty"`
	CommonName   string    `json:"common_name,omitempty"`
	Species      string    `json:"species"`
	Genus        string    `json:"genus"`
	NotFound     bool
}

OrganismDoc represents an organism document stored in ArangoDB.

type TagPropertyDoc

type TagPropertyDoc struct {
	Tag       string    `json:"tag"`
	Value     string    `json:"value"`
	CreatedBy string    `json:"created_by"`
	UpdatedBy string    `json:"updated_by"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

TagPropertyDoc represents a key-value pair for custom attributes.

type UploadStatus

type UploadStatus int

UploadStatus represents the result status of an OBO file upload operation.

const (
	Created UploadStatus = iota
	Updated
	Failed
)

Created, Updated, and Failed are the possible upload status values.

Jump to

Keyboard shortcuts

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