Documentation
¶
Overview ¶
Package commonmeta provides functions to read and write commonmeta metadata.
Index ¶
- Variables
- func Write(data Data) ([]byte, error)
- func WriteAll(list []Data) ([]byte, error)
- type APIResponse
- type Affiliation
- type Container
- type Contributor
- type Data
- type Date
- type Description
- type File
- type FundingReference
- type GeoLocation
- type GeoLocationBox
- type GeoLocationPoint
- type GeoLocationPolygon
- type Identifier
- type License
- type Publisher
- type Reader
- type Reference
- type Relation
- type Subject
- type Title
- type Writer
Constants ¶
This section is empty.
Variables ¶
var CMToSOMappings = map[string]string{
"Article": "Article",
"Audiovisual": "CreativeWork",
"BlogPost": "BlogPosting",
"Book": "Book",
"BookChapter": "BookChapter",
"Collection": "CreativeWork",
"Dataset": "Dataset",
"Dissertation": "Dissertation",
"Document": "CreativeWork",
"Entry": "CreativeWork",
"Event": "CreativeWork",
"Figure": "CreativeWork",
"Image": "CreativeWork",
"Instrument": "Instrument",
"JournalArticle": "ScholarlyArticle",
"LegalDocument": "Legislation",
"Software": "SoftwareSourceCode",
"Presentation": "PresentationDigitalDocument",
}
CMToSOMappings maps Commonmeta types to Schema.org types.
var ContainerTypes = map[string]string{
"BookChapter": "Book",
"Dataset": "Database",
"JournalArticle": "Journal",
"JournalIssue": "Journal",
"Book": "BookSeries",
"ProceedingsArticle": "Proceedings",
"Article": "Periodical",
"BlogPost": "Blog",
}
ContainerTypes maps types to associated container types
var ContributorRoles = []string{
"Author",
"Editor",
"Chair",
"Reviewer",
"ReviewAssistant",
"StatsReviewer",
"ReviewerExternal",
"Reader",
"Translator",
"ContactPerson",
"DataCollector",
"DataManager",
"Distributor",
"HostingInstitution",
"Producer",
"ProjectLeader",
"ProjectManager",
"ProjectMember",
"RegistrationAgency",
"RegistrationAuthority",
"RelatedPerson",
"ResearchGroup",
"RightsHolder",
"Researcher",
"Sponsor",
"WorkPackageLeader",
"Conceptualization",
"DataCuration",
"FormalAnalysis",
"FundingAcquisition",
"Investigation",
"Methodology",
"ProjectAdministration",
"Resources",
"Software",
"Supervision",
"Validation",
"Visualization",
"WritingOriginalDraft",
"WritingReviewEditing",
"Maintainer",
"Other",
}
ContributorRoles list of contributor roles defined in commonmeta schema.
from commonmeta schema
var FOSKeyMappings = map[string]string{
"naturalSciences": "Natural sciences",
"mathematics": "Mathematics",
"computerAndInformationSciences": "Computer and information sciences",
"physicalSciences": "Physical sciences",
"chemicalSciences": "Chemical sciences",
"earthAndRelatedEnvironmentalSciences": "Earth and related environmental sciences",
"biologicalSciences": "Biological sciences",
"otherNaturalSciences": "Other natural sciences",
"engineeringAndTechnology": "Engineering and technology",
"civilEngineering": "Civil engineering",
"electricalEngineeringElectronicEngineeringInformationEngineering": "Electrical engineering, electronic engineering, information engineering",
"mechanicalEngineering": "Mechanical engineering",
"chemicalEngineering": "Chemical engineering",
"materialsEngineering": "Materials engineering",
"medicalEngineering": "Medical engineering",
"environmentalEngineering": "Environmental engineering",
"environmentalBiotechnology": "Environmental biotechnology",
"industrialBiotechnology": "Industrial biotechnology",
"nanoTechnology": "Nano technology",
"otherEngineeringAndTechnologies": "Other engineering and technologies",
"medicalAndHealthSciences": "Medical and health sciences",
"basicMedicine": "Basic medicine",
"clinicalMedicine": "Clinical medicine",
"healthSciences": "Health sciences",
"healthBiotechnology": "Health biotechnology",
"otherMedicalSciences": "Other medical sciences",
"agriculturalSciences": "Agricultural sciences",
"agricultureForestryAndFisheries": "Agriculture, forestry, and fisheries",
"animalAndDairyScience": "Animal and dairy science",
"veterinaryScience": "Veterinary science",
"agriculturalBiotechnology": "Agricultural biotechnology",
"otherAgriculturalSciences": "Other agricultural sciences",
"socialScience": "Social science",
"psychology": "Psychology",
"economicsAndBusiness": "Economics and business",
"educationalSciences": "Educational sciences",
"sociology": "Sociology",
"law": "Law",
"politicalScience": "Political science",
"socialAndEconomicGeography": "Social and economic geography",
"mediaAndCommunications": "Media and communications",
"otherSocialSciences": "Other social sciences",
"humanities": "Humanities",
"historyAndArchaeology": "History and archaeology",
"languagesAndLiterature": "Languages and literature",
"philosophyEthicsAndReligion": "Philosophy, ethics and religion",
"artsArtsHistoryOfArtsPerformingArtsMusic": "Arts (arts, history of arts, performing arts, music)",
"otherHumanities": "Other humanities",
}
FOSKeyMappings maps OECD FOS keys to OECD FOS strings
var FOSMappings = map[string]string{
"Natural sciences": "http://www.oecd.org/science/inno/38235147.pdf?1",
"Mathematics": "http://www.oecd.org/science/inno/38235147.pdf?1.1",
"Computer and information sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.2",
"Physical sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.3",
"Chemical sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.4",
"Earth and related environmental sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.5",
"Biological sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.6",
"Other natural sciences": "http://www.oecd.org/science/inno/38235147.pdf?1.7",
"Engineering and technology": "http://www.oecd.org/science/inno/38235147.pdf?2",
"Civil engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.1",
"Electrical engineering, electronic engineering, information engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.2",
"Mechanical engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.3",
"Chemical engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.4",
"Materials engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.5",
"Medical engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.6",
"Environmental engineering": "http://www.oecd.org/science/inno/38235147.pdf?2.7",
"Environmental biotechnology": "http://www.oecd.org/science/inno/38235147.pdf?2.8",
"Industrial biotechnology": "http://www.oecd.org/science/inno/38235147.pdf?2.9",
"Nano technology": "http://www.oecd.org/science/inno/38235147.pdf?2.10",
"Other engineering and technologies": "http://www.oecd.org/science/inno/38235147.pdf?2.11",
"Medical and health sciences": "http://www.oecd.org/science/inno/38235147.pdf?3",
"Basic medicine": "http://www.oecd.org/science/inno/38235147.pdf?3.1",
"Clinical medicine": "http://www.oecd.org/science/inno/38235147.pdf?3.2",
"Health sciences": "http://www.oecd.org/science/inno/38235147.pdf?3.3",
"Health biotechnology": "http://www.oecd.org/science/inno/38235147.pdf?3.4",
"Other medical sciences": "http://www.oecd.org/science/inno/38235147.pdf?3.5",
"Agricultural sciences": "http://www.oecd.org/science/inno/38235147.pdf?4",
"Agriculture, forestry, and fisheries": "http://www.oecd.org/science/inno/38235147.pdf?4.1",
"Animal and dairy science": "http://www.oecd.org/science/inno/38235147",
"Veterinary science": "http://www.oecd.org/science/inno/38235147",
"Agricultural biotechnology": "http://www.oecd.org/science/inno/38235147",
"Other agricultural sciences": "http://www.oecd.org/science/inno/38235147",
"Social science": "http://www.oecd.org/science/inno/38235147.pdf?5",
"Psychology": "http://www.oecd.org/science/inno/38235147.pdf?5.1",
"Economics and business": "http://www.oecd.org/science/inno/38235147.pdf?5.2",
"Educational sciences": "http://www.oecd.org/science/inno/38235147.pdf?5.3",
"Sociology": "http://www.oecd.org/science/inno/38235147.pdf?5.4",
"Law": "http://www.oecd.org/science/inno/38235147.pdf?5.5",
"Political science": "http://www.oecd.org/science/inno/38235147.pdf?5.6",
"Social and economic geography": "http://www.oecd.org/science/inno/38235147.pdf?5.7",
"Media and communications": "http://www.oecd.org/science/inno/38235147.pdf?5.8",
"Other social sciences": "http://www.oecd.org/science/inno/38235147.pdf?5.9",
"Humanities": "http://www.oecd.org/science/inno/38235147.pdf?6",
"History and archaeology": "http://www.oecd.org/science/inno/38235147.pdf?6.1",
"Languages and literature": "http://www.oecd.org/science/inno/38235147.pdf?6.2",
"Philosophy, ethics and religion": "http://www.oecd.org/science/inno/38235147.pdf?6.3",
"Arts (arts, history of arts, performing arts, music)": "http://www.oecd.org/science/inno/38235147.pdf?6.4",
"Other humanities": "http://www.oecd.org/science/inno/38235147.pdf?6.5",
}
FOSMappings maps OECD FOS strings to OECD FOS identifiers
var FOSStringMappings = map[string]string{
"Natural sciences": "naturalSciences",
"Mathematics": "mathematics",
"Computer and information sciences": "computerAndInformationSciences",
"Physical sciences": "physicalSciences",
"Chemical sciences": "chemicalSciences",
"Earth and related environmental sciences": "earthAndRelatedEnvironmentalSciences",
"Biological sciences": "biologicalSciences",
"Other natural sciences": "otherNaturalSciences",
"Engineering and technology": "engineeringAndTechnology",
"Civil engineering": "civilEngineering",
"Electrical engineering, electronic engineering, information engineering": "electricalEngineering",
"Mechanical engineering": "mechanicalEngineering",
"Chemical engineering": "chemicalEngineering",
"Materials engineering": "materialsEngineering",
"Medical engineering": "medicalEngineering",
"Environmental engineering": "environmentalEngineering",
"Environmental biotechnology": "environmentalBiotechnology",
"Industrial biotechnology": "industrialBiotechnology",
"Nano technology": "nanoTechnology",
"Other engineering and technologies": "otherEngineeringAndTechnologies",
"Medical and health sciences": "medicalAndHealthSciences",
"Basic medicine": "basicMedicine",
"Clinical medicine": "clinicalMedicine",
"Health sciences": "healthSciences",
"Health biotechnology": "healthBiotechnology",
"Other medical sciences": "otherMedicalSciences",
"Agricultural sciences": "agriculturalSciences",
"Agriculture, forestry, and fisheries": "agricultureForestryAndFisheries",
"Animal and dairy science": "animalAndDairyScience",
"Veterinary science": "veterinaryScience",
"Agricultural biotechnology": "agriculturalBiotechnology",
"Other agricultural sciences": "otherAgriculturalSciences",
"Social science": "socialScience",
"Psychology": "psychology",
"Economics and business": "economicsAndBusiness",
"Educational sciences": "educationalSciences",
"Sociology": "sociology",
"Law": "law",
"Political science": "politicalScience",
"Social and economic geography": "socialAndEconomicGeography",
"Media and communications": "mediaAndCommunications",
"Other social sciences": "otherSocialSciences",
"Humanities": "humanities",
"History and archaeology": "historyAndArchaeology",
"Languages and literature": "languagesAndLiterature",
"Philosophy, ethics and religion": "philosophyEthicsAndReligion",
"Arts (arts, history of arts, performing arts, music)": "artsArtsHistoryOfArtsPerformingArtsMusic",
"Other humanities": "otherHumanities",
}
FOSStringMappings maps OECD FOS strings to OECD FOS keys
var IdentifierTypes = []string{
"ARK",
"arXiv",
"Bibcode",
"DOI",
"GUID",
"Handle",
"ISBN",
"ISSN",
"PMID",
"PMCID",
"PURL",
"RID",
"URL",
"URN",
"UUID",
"Other",
}
IdentifierTypes list of identifier types defined in the commonmeta schema.
Functions ¶
Types ¶
type APIResponse ¶ added in v0.5.30
type APIResponse struct { DOI string `json:"doi"` ID string `json:"id,omitempty"` DOIBatchID string `json:"doi_batch_id,omitempty"` UUID string `json:"uuid,omitempty"` Community string `json:"community,omitempty"` CommunityID string `json:"community_id,omitempty"` Created string `json:"created,omitempty"` Updated string `json:"updated,omitempty"` Timestamp string `json:"timestamp,omitempty"` Status string `json:"status,omitempty"` }
type Affiliation ¶ added in v0.2.1
type Affiliation struct { ID string `avro:"id,omitempty" json:"id,omitempty"` Name string `avro:"name,omitempty" json:"name,omitempty"` AssertedBy string `avro:"assertedBy,omitempty" json:"assertedBy,omitempty"` }
Affiliation represents the affiliation of a contributor, defined in the commonmeta JSON Schema.
type Container ¶ added in v0.2.1
type Container struct { Identifier string `avro:"identifier,omitempty" json:"identifier,omitempty"` IdentifierType string `avro:"identifierType,omitempty" json:"identifierType,omitempty"` Type string `avro:"type,omitempty" json:"type,omitempty"` Title string `avro:"title,omitempty" json:"title,omitempty"` Description string `avro:"description,omitempty" json:"description,omitempty"` Language string `avro:"language,omitempty" json:"language,omitempty"` License License `avro:"license,omitempty" json:"license,omitempty"` Platform string `avro:"platform,omitempty" json:"platform,omitempty"` Favicon string `avro:"favicon,omitempty" json:"favicon,omitempty"` FirstPage string `avro:"firstPage,omitempty" json:"firstPage,omitempty"` LastPage string `avro:"lastPage,omitempty" json:"lastPage,omitempty"` Volume string `avro:"volume,omitempty" json:"volume,omitempty"` Issue string `avro:"issue,omitempty" json:"issue,omitempty"` }
Container represents the container of a publication, defined in the commonmeta JSON Schema.
type Contributor ¶ added in v0.2.1
type Contributor struct { ID string `avro:"id,omitempty" json:"id,omitempty"` Type string `avro:"type,omitempty" json:"type,omitempty"` Name string `avro:"name,omitempty" json:"name,omitempty"` GivenName string `avro:"givenName,omitempty" json:"givenName,omitempty"` FamilyName string `avro:"familyName,omitempty" json:"familyName,omitempty"` Affiliations []*Affiliation `avro:"affiliations,omitempty" json:"affiliations,omitempty"` ContributorRoles []string `avro:"contributorRoles,omitempty" json:"contributorRoles,omitempty"` }
Contributor represents a contributor of a publication, defined in the commonmeta JSON Schema.
type Data ¶ added in v0.2.1
type Data struct { // required fields ID string `avro:"id" json:"id"` Type string `avro:"type" json:"type"` // optional fields AdditionalType string `avro:"additional_type,omitempty" json:"additionalType,omitempty"` ArchiveLocations []string `avro:"archive_locations,omitempty" json:"archiveLocations,omitempty"` Container Container `avro:"container,omitempty" json:"container,omitempty"` ContentHTML string `avro:"content_html,omitempty" json:"content_html,omitempty"` Contributors []Contributor `avro:"contributors,omitempty" json:"contributors,omitempty"` Date Date `avro:"date,omitempty" json:"date,omitempty"` Descriptions []Description `avro:"descriptions,omitempty" json:"descriptions,omitempty"` FeatureImage string `avro:"image,omitempty" json:"feature_image,omitempty"` Files []File `avro:"files,omitempty" json:"files,omitempty"` FundingReferences []FundingReference `avro:"funding_references,omitempty" json:"fundingReferences,omitempty"` GeoLocations []GeoLocation `avro:"geo_locations,omitempty" json:"geoLocations,omitempty"` Identifiers []Identifier `avro:"identifiers,omitempty" json:"identifiers,omitempty"` Language string `avro:"language,omitempty" json:"language,omitempty"` License License `avro:"license,omitempty" json:"license,omitempty"` Provider string `avro:"provider,omitempty" json:"provider,omitempty"` Publisher Publisher `avro:"publisher,omitempty" json:"publisher,omitempty"` References []Reference `avro:"references,omitempty" json:"references,omitempty"` Relations []Relation `avro:"relations,omitempty" json:"relations,omitempty"` Subjects []Subject `avro:"subjects,omitempty" json:"subjects,omitempty"` Titles []Title `avro:"titles,omitempty" json:"titles,omitempty"` URL string `avro:"url,omitempty" json:"url,omitempty"` Version string `avro:"version,omitempty" json:"version,omitempty"` }
Data represents the commonmeta metadata, defined in the commonmeta JSON Schema.
type Date ¶ added in v0.2.1
type Date struct { Created string `json:"created,omitempty"` Submitted string `json:"submitted,omitempty"` Accepted string `json:"accepted,omitempty"` Published string `json:"published,omitempty"` Updated string `json:"updated,omitempty"` Accessed string `json:"accessed,omitempty"` Available string `json:"available,omitempty"` Copyrighted string `json:"copyrighted,omitempty"` Collected string `json:"collected,omitempty"` Valid string `json:"valid,omitempty"` Withdrawn string `json:"withdrawn,omitempty"` Other string `json:"other,omitempty"` }
Date represents the date of a publication, defined in the commonmeta JSON Schema.
type Description ¶ added in v0.2.1
type Description struct { Description string `json:"description"` Type string `json:"type,omitempty"` Language string `json:"language,omitempty"` }
Description represents the description of a publication, defined in the commonmeta JSON Schema.
type File ¶ added in v0.2.1
type File struct { Bucket string `json:"bucket,omitempty"` Key string `json:"key,omitempty"` Checksum string `json:"checksum,omitempty"` URL string `json:"url"` Size int `json:"size,omitempty"` MimeType string `json:"mimeType,omitempty"` }
File represents a file of a publication, defined in the commonmeta JSON Schema.
type FundingReference ¶ added in v0.2.1
type FundingReference struct { FunderIdentifier string `json:"funderIdentifier,omitempty"` FunderIdentifierType string `json:"funderIdentifierType,omitempty"` FunderName string `json:"funderName,omitempty"` AwardNumber string `json:"awardNumber,omitempty"` AwardTitle string `json:"awardTitle,omitempty"` AwardURI string `json:"awardUri,omitempty"` }
FundingReference represents the funding reference of a publication, defined in the commonmeta JSON Schema.
type GeoLocation ¶ added in v0.2.1
type GeoLocation struct { GeoLocationPlace string `json:"geoLocationPlace,omitempty"` GeoLocationPoint GeoLocationPoint `json:"geoLocationPoint,omitempty"` GeoLocationBox GeoLocationBox `json:"geoLocationBox,omitempty"` }
GeoLocation represents the geographical location of a publication, defined in the commonmeta JSON Schema.
type GeoLocationBox ¶ added in v0.2.1
type GeoLocationBox struct { EastBoundLongitude float64 `json:"eastBoundLongitude,omitempty"` WestBoundLongitude float64 `json:"westBoundLongitude,omitempty"` SouthBoundLatitude float64 `json:"southBoundLatitude,omitempty"` NorthBoundLatitude float64 `json:"northBoundLatitude,omitempty"` }
GeoLocationBox represents a box in a geographical location, defined in the commonmeta JSON Schema.
type GeoLocationPoint ¶ added in v0.2.1
type GeoLocationPoint struct { PointLongitude float64 `json:"pointLongitude,omitempty"` PointLatitude float64 `json:"pointLatitude,omitempty"` }
GeoLocationPoint represents a point in a geographical location, defined in the commonmeta JSON Schema.
type GeoLocationPolygon ¶ added in v0.2.1
type GeoLocationPolygon struct { PolygonPoints []GeoLocationPoint `json:"polygon_points,omitempty"` InPolygonPoint GeoLocationPoint `json:"in_polygon_point,omitempty"` }
GeoLocationPolygon represents a polygon in a geographical location, defined in the commonmeta JSON Schema.
type Identifier ¶ added in v0.2.1
type Identifier struct { Identifier string `json:"identifier"` IdentifierType string `json:"identifierType"` }
Identifier represents the identifier of a publication, defined in the commonmeta JSON Schema.
type License ¶ added in v0.2.1
License represents the license of a publication, defined in the commonmeta JSON Schema.
type Publisher ¶ added in v0.2.1
Publisher represents the publisher of a publication, defined in the commonmeta JSON Schema.
type Reference ¶ added in v0.2.1
type Reference struct { Key string `json:"key,omitempty"` ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` PublicationYear string `json:"publicationYear,omitempty"` Unstructured string `json:"unstructured,omitempty"` AssertedBy string `json:"assertedBy,omitempty"` }
Reference represents the reference of a publication, defined in the commonmeta JSON Schema.
type Relation ¶ added in v0.2.1
Relation represents the relation of a publication, defined in the commonmeta JSON Schema.
type Subject ¶ added in v0.2.1
type Subject struct {
Subject string `json:"subject"`
}
Subject represents the subject of a publication, defined in the commonmeta JSON Schema.