entities

package module
v0.0.0-...-7ab3522 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Unlicense Imports: 11 Imported by: 0

README

Entities for data management in Go

This is early work

The idea is simple enough -- design some entities -- structs in Go -- with common names, common slots, and a common pointer architecture to replicate the kinds of data needs of the Semantic Web. Provide methods for loading and unloading the structures to triples -- this allows for storage and query in triple stores and the use of the SPARQL query language for reporting.

The Go data structures are simple, extensible, and fast. Should be useful for many data problems, and the construction of CRM systems, academic profiling systems such as VIVO, and many other common data applications.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Addresses []*Address
View Source
var AwardTypeSet = makeAwardTypeSet()
View Source
var Awards []*Award
View Source
var Concepts []*Concept
View Source
var CourseTypeSet = makeCourseTypeSet()
View Source
var Courses []*Course
View Source
var DateTypeSet = makeDateTypeSet()
View Source
var Dates []*Date
View Source
var EmailAddresses []*EmailAddress
View Source
var EventTypeSet = makeEventTypeSet()
View Source
var Events []*Event
View Source
var GeoLocations []*GeoLocation
View Source
var GrantTypeSet = makeGrantTypeSet()
View Source
var Grants []*Grant
View Source
var Images []*Image
View Source
var KeySet = makeKeySet()
View Source
var LocationTypeSet = makeLocationTypeSet()
View Source
var Locations []*Location
View Source
var OrganizationTypeSet = makeOrganizationTypeSet()
View Source
var Organizations []*Organization
View Source
var People []*Person
View Source
var PhoneNumbers []*PhoneNumber
View Source
var Portfolios []*Portfolio
View Source
var PositionTypeSet = makePositionTypeSet()
View Source
var Positions []*Position
View Source
var PublicationTypeSet = makePublicationTypeSet()
View Source
var Publications []*Publication
View Source
var RelationshipTypeSet = makeRelationshipTypeSet()
View Source
var Relationships []*Relationship
View Source
var ResourceTypeSet = makeResourceTypeSet()
View Source
var Resources []*Resource
View Source
var Teachings []*Teaching
View Source
var URLs []*URL
View Source
var VenueTypeSet = makeVenueTypeSet()
View Source
var Venues []*Venue

Functions

func AddAddressFact

func AddAddressFact(a []string)

func AddAwardFact

func AddAwardFact(a []string)

func AddConceptFact

func AddConceptFact(a []string)

func AddCourseFact

func AddCourseFact(a []string)

func AddDateFact

func AddDateFact(a []string)

func AddEmailAddressFact

func AddEmailAddressFact(a []string)

func AddEntityFact

func AddEntityFact(a []string)

func AddEventFact

func AddEventFact(a []string)

func AddGeoLocationFact

func AddGeoLocationFact(a []string)

func AddGrantFact

func AddGrantFact(a []string)

func AddImageFact

func AddImageFact(a []string)

func AddLocationFact

func AddLocationFact(a []string)

func AddOrganizationFact

func AddOrganizationFact(a []string)

func AddPersonFact

func AddPersonFact(a []string)

func AddPhoneNumberFact

func AddPhoneNumberFact(a []string)

func AddPortfolioFact

func AddPortfolioFact(a []string)

func AddPositionFact

func AddPositionFact(a []string)

func AddPublicationFact

func AddPublicationFact(a []string)

func AddRelationshipFact

func AddRelationshipFact(a []string)

func AddResourceFact

func AddResourceFact(a []string)

func AddTeachingFact

func AddTeachingFact(a []string)

func AddURLFact

func AddURLFact(a []string)

func AddVenueFact

func AddVenueFact(a []string)

func CreateEntity

func CreateEntity(a []string)

func EmptyLists

func EmptyLists()

func FindAddressKey

func FindAddressKey(kf *Key) int

func FindAwardKey

func FindAwardKey(kf *Key) int

func FindConceptKey

func FindConceptKey(kf *Key) int

func FindCourseKey

func FindCourseKey(kf *Key) int

func FindDateKey

func FindDateKey(kf *Key) int

func FindEmailAddressKey

func FindEmailAddressKey(kf *Key) int

func FindEventKey

func FindEventKey(kf *Key) int

func FindGeoLocationKey

func FindGeoLocationKey(kf *Key) int

func FindGrantKey

func FindGrantKey(kf *Key) int

func FindImageKey

func FindImageKey(kf *Key) int

func FindLocationKey

func FindLocationKey(kf *Key) int

func FindOrganizationKey

func FindOrganizationKey(kf *Key) int

func FindPersonKey

func FindPersonKey(kf *Key) int

func FindPhoneNumberKey

func FindPhoneNumberKey(kf *Key) int

func FindPortfolioKey

func FindPortfolioKey(kf *Key) int

func FindPositionKey

func FindPositionKey(kf *Key) int

func FindPublicationKey

func FindPublicationKey(kf *Key) int

func FindRelationshipKey

func FindRelationshipKey(kf *Key) int

func FindResourceKey

func FindResourceKey(kf *Key) int

func FindTeachingKey

func FindTeachingKey(kf *Key) int

func FindURLKey

func FindURLKey(kf *Key) int

func FindVenueKey

func FindVenueKey(kf *Key) int

func LoadEntities

func LoadEntities(n string)

func New

func New(text string) error

New returns an error that formats as the given text

func SampleEntities

func SampleEntities()

func SaveEntities

func SaveEntities(n string)

func SaveTables

func SaveTables(n string)

func ShowEntities

func ShowEntities()

func ShowSets

func ShowSets()

func WriteRow

func WriteRow(f *os.File, row []string)

func WriteTriples

func WriteTriples(f *os.File, triples [][3]string)

Types

type Address

type Address struct {
	Key         *Key
	AddressLine string
	Location    *Location
	PostalCode  string
}

func NewAddress

func NewAddress(a string, l *Location, c string) (*Address, error)

func (*Address) Row

func (a *Address) Row() []string

func (*Address) Triples

func (a *Address) Triples() [][3]string

type Award

type Award struct {
	Key                  *Key
	AwardType            string
	Title                string
	AwardingOrganization *Organization
	Awardee              *Person
	AwardDate            *Date
}

func NewAward

func NewAward(t string, d string) (*Award, error)

func (*Award) Row

func (a *Award) Row() []string

func (*Award) Triples

func (a *Award) Triples() [][3]string

type Concept

type Concept struct {
	Key      *Key
	Name     string
	Broader  *Concept
	Narrower *Concept
}

func NewConcept

func NewConcept(d string) *Concept

func (*Concept) Row

func (a *Concept) Row() []string

func (*Concept) Triples

func (a *Concept) Triples() [][3]string

type Course

type Course struct {
	Key                *Key
	CourseType         string
	CourseNumber       string
	CourseTitle        string
	CourseDescription  string
	CourseOrganization *Organization
}

func NewAcademicCourse

func NewAcademicCourse(nu string, nm string) (*Course, error)

func NewCourse

func NewCourse(nt string, nu string, nm string) (*Course, error)

func NewSeminar

func NewSeminar(nu string, nm string) (*Course, error)

func NewShortCourse

func NewShortCourse(nu string, nm string) (*Course, error)

func NewThesisAdvising

func NewThesisAdvising(nu string, nm string) (*Course, error)

func (*Course) Row

func (a *Course) Row() []string

func (*Course) Triples

func (a *Course) Triples() [][3]string

type Date

type Date struct {
	Key      *Key
	DateType string
	UTC      time.Time
}

func NewDate

func NewDate(d string) (*Date, error)

func NewDateTime

func NewDateTime(d string) (*Date, error)

func NewYear

func NewYear(d string) (*Date, error)

func NewYearMonth

func NewYearMonth(d string) (*Date, error)

func (*Date) Row

func (a *Date) Row() []string

func (*Date) Triples

func (a *Date) Triples() [][3]string

type EmailAddress

type EmailAddress struct {
	Key              *Key
	EmailAddressText string
}

func NewEmailAddress

func NewEmailAddress(e string) (*EmailAddress, error)

func (*EmailAddress) Row

func (a *EmailAddress) Row() []string

func (*EmailAddress) Triples

func (a *EmailAddress) Triples() [][3]string

type Event

type Event struct {
	Key       *Key
	EventType string
	Name      string
	Organizer *Organization
	Location  *Location
	StartDate *Date
	EndDate   *Date
	Sponsors  []*Organization
	Attendees []*Person
}

func NewConference

func NewConference(n string) (*Event, error)

func NewEvent

func NewEvent(t string, n string) (*Event, error)

func NewFundraiser

func NewFundraiser(n string) (*Event, error)

func NewMeeting

func NewMeeting(n string) (*Event, error)

func NewSymposium

func NewSymposium(n string) (*Event, error)

func NewWorkshop

func NewWorkshop(n string) (*Event, error)

func (*Event) Row

func (a *Event) Row() []string

func (*Event) Triples

func (a *Event) Triples() [][3]string

type GeoLocation

type GeoLocation struct {
	Key *Key
	// contains filtered or unexported fields
}

func NewGeoLocation

func NewGeoLocation(lat float64, long float64) (*GeoLocation, error)

func (*GeoLocation) Row

func (a *GeoLocation) Row() []string

func (*GeoLocation) Triples

func (a *GeoLocation) Triples() [][3]string

type Grant

type Grant struct {
	Key                  *Key
	GrantType            string
	Title                string
	Administrator        *Organization
	AwardingOrganization *Organization
	StartDate            *Date
	EndDate              *Date

	PIs    []*Person
	CoIs   []*Person
	Topics []*Concept
	// contains filtered or unexported fields
}

func NewGrant

func NewGrant(ty string, ti string) (*Grant, error)

func NewResearchGrant

func NewResearchGrant(n string) (*Grant, error)

func NewServiceGrant

func NewServiceGrant(n string) (*Grant, error)

func NewTeachingGrant

func NewTeachingGrant(n string) (*Grant, error)

func NewUnrestrictedGrant

func NewUnrestrictedGrant(n string) (*Grant, error)

func (*Grant) Row

func (a *Grant) Row() []string

func (*Grant) Triples

func (a *Grant) Triples() [][3]string

type Image

type Image struct {
	Key      *Key
	FileName string
	Caption  string
	AltText  string
	// contains filtered or unexported fields
}

func NewImage

func NewImage(n string) (*Image, error)

func (*Image) Row

func (a *Image) Row() []string

func (*Image) Triples

func (a *Image) Triples() [][3]string

type Key

type Key struct {
	// contains filtered or unexported fields
}

type Location

type Location struct {
	Key          *Key
	LocationType string
	Name         string
	Abbreviation string
	GeoLocation  *GeoLocation
	Contains     []*Location
	Inside       []*Location
}

func NewBuilding

func NewBuilding(n string) (*Location, error)

func NewCity

func NewCity(n string) (*Location, error)

func NewCountry

func NewCountry(n string) (*Location, error)

func NewCounty

func NewCounty(n string) (*Location, error)

func NewLocation

func NewLocation(t string, n string) (*Location, error)

func NewState

func NewState(n string) (*Location, error)

func (*Location) Row

func (a *Location) Row() []string

func (*Location) Triples

func (a *Location) Triples() [][3]string

type Organization

type Organization struct {
	Key                *Key
	OrganizationType   string
	Name               string
	ChildOrganization  *Organization
	ParentOrganization *Organization
	Homepage           *URL
	Resources          []*Resource
}

func NewAssociation

func NewAssociation(n string) (*Organization, error)

func NewChurch

func NewChurch(n string) (*Organization, error)

func NewClub

func NewClub(n string) (*Organization, error)

func NewCollege

func NewCollege(n string) (*Organization, error)

func NewCompany

func NewCompany(n string) (*Organization, error)

func NewDepartment

func NewDepartment(n string) (*Organization, error)

func NewGovernance

func NewGovernance(n string) (*Organization, error)

func NewGovernanment

func NewGovernanment(n string) (*Organization, error)

func NewInstitute

func NewInstitute(n string) (*Organization, error)

func NewMilitary

func NewMilitary(n string) (*Organization, error)

func NewNGO

func NewNGO(n string) (*Organization, error)

func NewNonprofit

func NewNonprofit(n string) (*Organization, error)

func NewOffice

func NewOffice(n string) (*Organization, error)

func NewOrganization

func NewOrganization(t string, n string) (*Organization, error)

func NewSchool

func NewSchool(n string) (*Organization, error)

func NewUniversity

func NewUniversity(n string) (*Organization, error)

func (*Organization) Triples

func (a *Organization) Triples() [][3]string

type Person

type Person struct {
	Key           *Key
	Name          string
	Orcid         *URL
	HomeAddress   *Address
	Portfolio     *Portfolio
	HomeEmail     *EmailAddress
	WorkEmail     *EmailAddress
	HomePhone     *PhoneNumber
	ResearchAreas []*Concept
	BirthDate     *Date
}

func NewPerson

func NewPerson(n string) (*Person, error)

func (*Person) Triples

func (a *Person) Triples() [][3]string

type PhoneNumber

type PhoneNumber struct {
	Key             *Key
	PhoneNumberText string
}

func NewPhoneNumber

func NewPhoneNumber(e string) (*PhoneNumber, error)

func (*PhoneNumber) Triples

func (a *PhoneNumber) Triples() [][3]string

type Portfolio

type Portfolio struct {
	Key           *Key
	Person        *Person
	Positions     []*Position
	Awards        []*Award
	Publications  []*Publication
	Teachings     []*Teaching
	Relationships []*Relationship
	Grants        []*Grant
}

func NewPortfolio

func NewPortfolio() *Portfolio

func (*Portfolio) Triples

func (a *Portfolio) Triples() [][3]string

type Position

type Position struct {
	Key          *Key
	PositionType string
	Title        string
	Description  string
	Organization *Organization
	Person       *Person
	StartDate    *Date
	EndDate      *Date
}

func NewDirector

func NewDirector(n string) (*Position, error)

func NewFaculty

func NewFaculty(n string) (*Position, error)

func NewMember

func NewMember(n string) (*Position, error)

func NewPosition

func NewPosition(t, e string) (*Position, error)

func NewRetired

func NewRetired(n string) (*Position, error)

func NewStaff

func NewStaff(n string) (*Position, error)

func NewVolunteer

func NewVolunteer(n string) (*Position, error)

func (*Position) Triples

func (a *Position) Triples() [][3]string

type Publication

type Publication struct {
	Key             *Key
	PublicationType string
	Title           string
	Abstract        string
	PublicationDate *Date
	Venue           *Venue
	DOI             *URL
	FullTextURL     *URL
	Authors         []*Person
	Keywords        []*Concept
}

func NewAbstract

func NewAbstract(n string) (*Publication, error)

func NewArticle

func NewArticle(n string) (*Publication, error)

func NewBook

func NewBook(n string) (*Publication, error)

func NewBooklet

func NewBooklet(n string) (*Publication, error)

func NewDataset

func NewDataset(n string) (*Publication, error)

func NewEditorial

func NewEditorial(n string) (*Publication, error)

func NewInBook

func NewInBook(n string) (*Publication, error)

func NewInCollection

func NewInCollection(n string) (*Publication, error)

func NewManual

func NewManual(n string) (*Publication, error)

func NewMasterThesis

func NewMasterThesis(n string) (*Publication, error)

func NewPhDThesis

func NewPhDThesis(n string) (*Publication, error)

func NewPresentation

func NewPresentation(n string) (*Publication, error)

func NewProceedings

func NewProceedings(n string) (*Publication, error)

func NewPublication

func NewPublication(ty string, ti string) (*Publication, error)

func NewTechReport

func NewTechReport(n string) (*Publication, error)

func NewUnpublished

func NewUnpublished(n string) (*Publication, error)

func (*Publication) Triples

func (a *Publication) Triples() [][3]string

type Relationship

type Relationship struct {
	Key              *Key
	RelationshipType string
	PersonA          *Person
	PersonB          *Person
	StartDate        *Date
	EndDate          *Date
}

func NewFriend

func NewFriend(pa *Person, pb *Person) (*Relationship, error)

func NewMentor

func NewMentor(pa *Person, pb *Person) (*Relationship, error)

func NewParent

func NewParent(pa *Person, pb *Person) (*Relationship, error)

func NewRelationship

func NewRelationship(t string, pa *Person, pb *Person) (*Relationship, error)

func NewSpouse

func NewSpouse(pa *Person, pb *Person) (*Relationship, error)

func NewSupervisor

func NewSupervisor(pa *Person, pb *Person) (*Relationship, error)

func (*Relationship) Triples

func (a *Relationship) Triples() [][3]string

type Resource

type Resource struct {
	Key          *Key
	Name         string
	ResourceType string
	Description  string
	Contact      *Person
	Admin        *Organization
}

func NewEquipment

func NewEquipment(n string) (*Resource, error)

func NewResource

func NewResource(t string, n string) (*Resource, error)

func NewService

func NewService(n string) (*Resource, error)

func (*Resource) Triples

func (a *Resource) Triples() [][3]string

type Teaching

type Teaching struct {
	Key         *Key
	Description string
	Course      *Course
	Teacher     *Person
	StartDate   *Date
	EndDate     *Date
	Students    []*Person
}

func NewTeaching

func NewTeaching(c *Course, pe *Person) *Teaching

func (*Teaching) Triples

func (a *Teaching) Triples() [][3]string

type Triple

type Triple struct {
	Subject   *Key
	Predicate string
	Literal   string
	Referent  *Key
}

type URL

type URL struct {
	Key     *Key
	Name    string
	URLText string
}

func NewURL

func NewURL(n string, url string) (*URL, error)

func (*URL) Triples

func (a *URL) Triples() [][3]string

type Venue

type Venue struct {
	Key       *Key
	VenueType string
	Name      string
	Publisher *Organization
}

func NewJournal

func NewJournal(n string) (*Venue, error)

func NewMagazine

func NewMagazine(n string) (*Venue, error)

func NewNewsletter

func NewNewsletter(n string) (*Venue, error)

func NewVenue

func NewVenue(t string, n string) (*Venue, error)

func (*Venue) Triples

func (a *Venue) Triples() [][3]string

Jump to

Keyboard shortcuts

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