golcas

package module
v0.0.0-...-acf7166 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 6 Imported by: 0

README

golcas

Build Status

golcas is a Go package for writing reading and writing data in the olca-schema format (a JSON-LD based format for LCA data).

Getting started

Install Go and run go get to retrieve this library:

$ go get github.com/msrocka/golcas...
Reading and writing data

golcas has very fast methods for reading and writing data directly from olca-schema packages, e.g.:

import "github.com/msrocka/golcas"

r, err := golcas.NewPackReader("path/to/file.zip")
if err != nil {
    return err
}
err = r.EachFlow(func(f *golcas.Flow) bool {
    // do something with f
    return true  // return false, if you do not want to continue
})

Documentation

Overview

Package golcas provides a Go implementation of the olca-schema definition (http://greendelta.github.io/olca-schema).

Index

Constants

View Source
const ContextURL = "http://greendelta.github.io/olca-schema/context.jsonld"

ContextURL is the URL to the olca-schema definition

Variables

This section is empty.

Functions

func FindUUID

func FindUUID(path string) string

FindUUID returns the UUID from the given path or an empty string if it cannot find it.

func IsActorPath

func IsActorPath(path string) bool

IsActorPath returns true if the given path describes a JSON file in the folder where data sets of type `Actor` are stored.

func IsCategoryPath

func IsCategoryPath(path string) bool

IsCategoryPath returns true if the given path describes a JSON file in the folder where data sets of type `Category` are stored.

func IsCurrencyPath

func IsCurrencyPath(path string) bool

IsCurrencyPath returns true if the given path describes a JSON file in the folder where data sets of type `Currency` are stored.

func IsFlowPath

func IsFlowPath(path string) bool

IsFlowPath returns true if the given path describes a JSON file in the folder where data sets of type `Flow` are stored.

func IsFlowPropertyPath

func IsFlowPropertyPath(path string) bool

IsFlowPropertyPath returns true if the given path describes a JSON file in the folder where data sets of type `FlowProperty` are stored.

func IsImpactCategoryPath

func IsImpactCategoryPath(path string) bool

IsImpactCategoryPath returns true if the given path describes a JSON file in the folder where data sets of type `ImpactCategory` are stored.

func IsImpactMethodPath

func IsImpactMethodPath(path string) bool

IsImpactMethodPath returns true if the given path describes a JSON file in the folder where data sets of type `ImpactMethod` are stored.

func IsLocationPath

func IsLocationPath(path string) bool

IsLocationPath returns true if the given path describes a JSON file in the folder where data sets of type `Location` are stored.

func IsNwSetPath

func IsNwSetPath(path string) bool

IsNwSetPath returns true if the given path describes a JSON file in the folder where data sets of type `NwSet` are stored.

func IsParameterPath

func IsParameterPath(path string) bool

IsParameterPath returns true if the given path describes a JSON file in the folder where data sets of type `Parameter` are stored.

func IsProcessPath

func IsProcessPath(path string) bool

IsProcessPath returns true if the given path describes a JSON file in the folder where data sets of type `Process` are stored.

func IsProductSystemPath

func IsProductSystemPath(path string) bool

IsProductSystemPath returns true if the given path describes a JSON file in the folder where data sets of type `ProductSystem` are stored.

func IsProjectPath

func IsProjectPath(path string) bool

IsProjectPath returns true if the given path describes a JSON file in the folder where data sets of type `Project` are stored.

func IsSocialIndicatorPath

func IsSocialIndicatorPath(path string) bool

IsSocialIndicatorPath returns true if the given path describes a JSON file in the folder where data sets of type `SocialIndicator` are stored.

func IsSourcePath

func IsSourcePath(path string) bool

IsSourcePath returns true if the given path describes a JSON file in the folder where data sets of type `Source` are stored.

func IsUnitGroupPath

func IsUnitGroupPath(path string) bool

IsUnitGroupPath returns true if the given path describes a JSON file in the folder where data sets of type `UnitGroup` are stored.

Types

type Actor

type Actor struct {
	CategorizedEntity
	Address   string `json:"address,omitempty"`
	City      string `json:"city,omitempty"`
	Country   string `json:"country,omitempty"`
	Email     string `json:"email,omitempty"`
	Telefax   string `json:"telefax,omitempty"`
	Telephone string `json:"telephone,omitempty"`
	Website   string `json:"website,omitempty"`
	ZipCode   string `json:"zipCode,omitempty"`
}

Actor http://greendelta.github.io/olca-schema/html/Actor.html

func NewActor

func NewActor(id, name string) *Actor

NewActor initializes a new Actor with the given id and name

func ReadActor

func ReadActor(data []byte) (*Actor, error)

ReadActor converts the given bytes into a Actor

type AllocationFactor

type AllocationFactor struct {
	Entity
	ProductExchange   *Entity        `json:"productExchange,omitempty"`
	Type              AllocationType `json:"allocationType,omitempty"`
	Value             float64        `json:"value"`
	AllocatedExchange *Entity        `json:"allocatedExchange,omitempty"`
}

AllocationFactor http://greendelta.github.io/olca-schema/html/AllocationFactor.html

type AllocationType

type AllocationType string

AllocationType enumeration

const (
	PhysicalAllocation AllocationType = "PHYSICAL_ALLOCATION"
	EconomicAllocation AllocationType = "ECONOMIC_ALLOCATION"
	CausalAllocation   AllocationType = "CAUSAL_ALLOCATION"
)

Enum constants of AllocationType

type CategorizedEntity

type CategorizedEntity struct {
	RootEntity
	Category *Ref `json:"category,omitempty"`
}

CategorizedEntity http://greendelta.github.io/olca-schema/html/CategorizedEntity.html

type Category

type Category struct {
	CategorizedEntity
	ModelType ModelType `json:"modelType,omitempty"`
}

Category http://greendelta.github.io/olca-schema/html/Category.html

func NewCategory

func NewCategory(id, name string, modelType ModelType) *Category

NewCategory initializes a new category with the given ID and name.

func ReadCategory

func ReadCategory(data []byte) (*Category, error)

ReadCategory converts the given bytes into a Category

type Entity

type Entity struct {
	Context string `json:"@context,omitempty"`
	ID      string `json:"@id,omitempty"`
	Type    string `json:"@type,omitempty"`
}

Entity http://greendelta.github.io/olca-schema/html/Entity.html

type Exchange

type Exchange struct {
	Entity
	InternalID              int          `json:"internalId"`
	IsAvoidedProduct        bool         `json:"avoidedProduct"`
	Flow                    *FlowRef     `json:"flow,omitempty"`
	FlowProperty            *Ref         `json:"flowProperty,omitempty"`
	IsInput                 bool         `json:"input"`
	IsQuantitativeReference bool         `json:"quantitativeReference"`
	BaseUncertainty         float64      `json:"baseUncertainty"`
	Provider                *Ref         `json:"provider,omitempty"` // TODO: ProcessRef
	Amount                  float64      `json:"amount"`
	AmountFormula           string       `json:"amountFormula,omitempty"`
	Unit                    *Ref         `json:"unit,omitempty"`
	PedigreeUncertainty     string       `json:"pedigreeUncertainty,omitempty"`
	Uncertainty             *Uncertainty `json:"uncertainty,omitempty"`
	Comment                 string       `json:"comment,omitempty"`
}

Exchange http://greendelta.github.io/olca-schema/html/Exchange.html

type Flow

type Flow struct {
	CategorizedEntity
	Type           FlowType             `json:"flowType,omitempty"`
	Cas            string               `json:"cas,omitempty"`
	Formula        string               `json:"formula,omitempty"`
	FlowProperties []FlowPropertyFactor `json:"flowProperties,omitempty"`
	Location       *Ref                 `json:"location,omitempty"`
}

Flow http://greendelta.github.io/olca-schema/html/Flow.html

func NewFlow

func NewFlow(id, name string) *Flow

NewFlow initializes a new Flow with the given id and name

func ReadFlow

func ReadFlow(data []byte) (*Flow, error)

ReadFlow converts the given bytes into a Flow

func (*Flow) AsRef

func (f *Flow) AsRef() *FlowRef

AsRef converts the given flow into a flow reference.

type FlowProperty

type FlowProperty struct {
	CategorizedEntity
	Type      FlowPropertyType `json:"flowPropertyType,omitempty"`
	UnitGroup *Ref             `json:"unitGroup,omitempty"`
}

FlowProperty http://greendelta.github.io/olca-schema/html/FlowProperty.html

func NewFlowProperty

func NewFlowProperty(id, name string) *FlowProperty

NewFlowProperty initializes a new FlowProperty with the given id and name

func ReadFlowProperty

func ReadFlowProperty(data []byte) (*FlowProperty, error)

ReadFlowProperty converts the given bytes into a FlowProperty

type FlowPropertyFactor

type FlowPropertyFactor struct {
	Entity
	FlowProperty            *Ref    `json:"flowProperty,omitempty"`
	ConversionFactor        float64 `json:"conversionFactor"`
	IsReferenceFlowProperty bool    `json:"referenceFlowProperty"`
}

FlowPropertyFactor http://greendelta.github.io/olca-schema/html/FlowPropertyFactor.html

type FlowPropertyType

type FlowPropertyType string

FlowPropertyType enumeration

const (
	EconomicQuantity FlowPropertyType = "ECONOMIC_QUANTITY"
	PhysicalQuantity FlowPropertyType = "PHYSICAL_QUANTITY"
)

Enum constants of FlowPropertyType

type FlowRef

type FlowRef struct {
	Ref
	RefUnit  string   `json:"refUnit,omitempty"`
	Location string   `json:"location,omitempty"`
	FlowType FlowType `json:"flowType,omitempty"`
}

FlowRef http://greendelta.github.io/olca-schema/html/FlowRef.html

type FlowType

type FlowType string

FlowType enumeration

const (
	ElementaryFlow FlowType = "ELEMENTARY_FLOW"
	ProductFlow    FlowType = "PRODUCT_FLOW"
	WasteFlow      FlowType = "WASTE_FLOW"
)

Enum constants of FlowType

type ImpactCategory

type ImpactCategory struct {
	RootEntity
	ReferenceUnit string         `json:"referenceUnitName,omitempty"`
	ImpactFactors []ImpactFactor `json:"impactFactors,omitempty"`
}

ImpactCategory http://greendelta.github.io/olca-schema/html/ImpactCategory.html

func NewImpactCategory

func NewImpactCategory(id, name string) *ImpactCategory

NewImpactCategory initializes a new ImpactCategory with the given id and name

func ReadImpactCategory

func ReadImpactCategory(data []byte) (*ImpactCategory, error)

ReadImpactCategory converts the given bytes into a ImpactCategory

type ImpactFactor

type ImpactFactor struct {
	Entity
	Flow         *FlowRef     `json:"flow,omitempty"`
	FlowProperty *Ref         `json:"flowProperty,omitempty"`
	Unit         *Ref         `json:"unit,omitempty"`
	Value        float64      `json:"value"`
	Formula      string       `json:"formula,omitempty"`
	Uncertainty  *Uncertainty `json:"uncertainty,omitempty"`
}

ImpactFactor http://greendelta.github.io/olca-schema/html/ImpactFactor.html

type ImpactMethod

type ImpactMethod struct {
	CategorizedEntity
	ImpactCategories []Ref `json:"impactCategories,omitempty"`
	Parameters       []Ref `json:"parameters,omitempty"`
}

ImpactMethod http://greendelta.github.io/olca-schema/html/ImpactMethod.html

func NewImpactMethod

func NewImpactMethod(id, name string) *ImpactMethod

NewImpactMethod initializes a new ImpactMethod with the given id and name

func ReadImpactMethod

func ReadImpactMethod(data []byte) (*ImpactMethod, error)

ReadImpactMethod converts the given bytes into a ImpactMethod

type Location

type Location struct {
	RootEntity
	Code      string  `json:"code,omitempty"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Kml       string  `json:"kml,omitempty"`
}

Location http://greendelta.github.io/olca-schema/html/Location.html

func NewLocation

func NewLocation(id, name string) *Location

NewLocation initializes a new Location with the given id and name

func ReadLocation

func ReadLocation(data []byte) (*Location, error)

ReadLocation converts the given bytes into a Location

type ModelType

type ModelType string

ModelType enumeration

const (
	ProjectModel         ModelType = "PROJECT"
	ImpactMethodModel    ModelType = "IMPACT_METHOD"
	ImpactCategoryModel  ModelType = "IMPACT_CATEGORY"
	ProductSystemModel   ModelType = "PRODUCT_SYSTEM"
	ProcessModel         ModelType = "PROCESS"
	FlowModel            ModelType = "FLOW"
	FlowPropertyModel    ModelType = "FLOW_PROPERTY"
	UnitGroupModel       ModelType = "UNIT_GROUP"
	UnitModel            ModelType = "UNIT"
	ActorModel           ModelType = "ACTOR"
	SourceModel          ModelType = "SOURCE"
	CategoryModel        ModelType = "CATEGORY"
	LocationModel        ModelType = "LOCATION"
	NwSetModel           ModelType = "NW_SET"
	SocialIndicatorModel ModelType = "SOCIAL_INDICATOR"
)

Enum constants of ModelType

type PackReader

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

PackReader reads data sets from a zip file in the olca-schema package format.

func NewPackReader

func NewPackReader(filePath string) (*PackReader, error)

NewPackReader creates a new PackReader

func (*PackReader) Close

func (r *PackReader) Close() error

Close closes the PackReader

func (*PackReader) EachActor

func (r *PackReader) EachActor(fn func(*Actor) bool) error

EachActor iterates over each `Actor` data set in the package unless the given handler returns false.

func (*PackReader) EachCategory

func (r *PackReader) EachCategory(fn func(*Category) bool) error

EachCategory iterates over each `Category` data set in the package unless the given handler returns false.

func (*PackReader) EachFile

func (r *PackReader) EachFile(fn func(f *ZipFile) bool)

EachFile calls the given function for each file in the zip package. It stops when the function returns false or when there are no more files in the package.

func (*PackReader) EachFlow

func (r *PackReader) EachFlow(fn func(*Flow) bool) error

EachFlow iterates over each `Flow` data set in the package unless the given handler returns false.

func (*PackReader) EachFlowProperty

func (r *PackReader) EachFlowProperty(fn func(*FlowProperty) bool) error

EachFlowProperty iterates over each `FlowProperty` data set in the package unless the given handler returns false.

func (*PackReader) EachImpactCategory

func (r *PackReader) EachImpactCategory(fn func(*ImpactCategory) bool) error

EachImpactCategory iterates over each `ImpactCategory` data set in the package unless the given handler returns false.

func (*PackReader) EachImpactMethod

func (r *PackReader) EachImpactMethod(fn func(*ImpactMethod) bool) error

EachImpactMethod iterates over each `ImpactMethod` data set in the package unless the given handler returns false.

func (*PackReader) EachLocation

func (r *PackReader) EachLocation(fn func(*Location) bool) error

EachLocation iterates over each `Location` data set in the package unless the given handler returns false.

func (*PackReader) EachParameter

func (r *PackReader) EachParameter(fn func(*Parameter) bool) error

EachParameter iterates over each `Parameter` data set in the package unless the given handler returns false.

func (*PackReader) EachProcess

func (r *PackReader) EachProcess(fn func(*Process) bool) error

EachProcess iterates over each `Process` data set in the package unless the given handler returns false.

func (*PackReader) EachSocialIndicator

func (r *PackReader) EachSocialIndicator(fn func(*SocialIndicator) bool) error

EachSocialIndicator iterates over each `SocialIndicator` data set in the package unless the given handler returns false.

func (*PackReader) EachSource

func (r *PackReader) EachSource(fn func(*Source) bool) error

EachSource iterates over each `Source` data set in the package unless the given handler returns false.

func (*PackReader) EachUnitGroup

func (r *PackReader) EachUnitGroup(fn func(*UnitGroup) bool) error

EachUnitGroup iterates over each `UnitGroup` data set in the package unless the given handler returns false.

func (*PackReader) GetActor

func (r *PackReader) GetActor(id string) (*Actor, error)

GetActor reads the Actor with the given ID from the package

type PackWriter

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

PackWriter writes data sets to a zip file in the olca-schema package format.

func NewPackWriter

func NewPackWriter(filePath string) (*PackWriter, error)

NewPackWriter creates a new PackWriter

func (*PackWriter) Close

func (w *PackWriter) Close() error

Close closes the PackWriter

func (*PackWriter) Put

func (w *PackWriter) Put(path string, bytes []byte) error

Put writes the given bytes to the given path

func (*PackWriter) PutActor

func (w *PackWriter) PutActor(a *Actor) error

PutActor writes the given actor to the package

func (*PackWriter) PutCategory

func (w *PackWriter) PutCategory(c *Category) error

PutCategory writes the given category to the package

func (*PackWriter) PutFlow

func (w *PackWriter) PutFlow(f *Flow) error

PutFlow writes the given flow to the package

func (*PackWriter) PutFlowProperty

func (w *PackWriter) PutFlowProperty(fp *FlowProperty) error

PutFlowProperty writes the given flow property to the package

func (*PackWriter) PutImpactCategory

func (w *PackWriter) PutImpactCategory(ic *ImpactCategory) error

PutImpactCategory writes the given LCIA category to the package

func (*PackWriter) PutImpactMethod

func (w *PackWriter) PutImpactMethod(im *ImpactMethod) error

PutImpactMethod writes the given LCIA method to the package

func (*PackWriter) PutProcess

func (w *PackWriter) PutProcess(p *Process) error

PutProcess writes the given process to the package

func (*PackWriter) PutSocialIndicator

func (w *PackWriter) PutSocialIndicator(si *SocialIndicator) error

PutSocialIndicator writes the given social indicator to the package

func (*PackWriter) PutSource

func (w *PackWriter) PutSource(s *Source) error

PutSource writes the given source to the package

func (*PackWriter) PutUnitGroup

func (w *PackWriter) PutUnitGroup(ug *UnitGroup) error

PutUnitGroup writes the given unit group to the package

type Parameter

type Parameter struct {
	Entity
	Name             string         `json:"name,omitempty"`
	Description      string         `json:"description,omitempty"`
	Scope            ParameterScope `json:"parameterScope,omitempty"`
	IsInputParameter bool           `json:"inputParameter"`
	Value            float64        `json:"value"`
	Formula          string         `json:"formula,omitempty"`
	ExternalSource   string         `json:"externalSource,omitempty"`
	SourceType       string         `json:"sourceType,omitempty"`
	Uncertainty      *Uncertainty   `json:"uncertainty,omitempty"`
}

Parameter http://greendelta.github.io/olca-schema/html/Parameter.html

func ReadParameter

func ReadParameter(data []byte) (*Parameter, error)

ReadParameter converts the given bytes into a Parameter

type ParameterScope

type ParameterScope string

ParameterScope enumeration

const (
	ProcessScope    ParameterScope = "PROCESS_SCOPE"
	LCIAMethodScope ParameterScope = "LCIA_METHOD_SCOPE"
	GlobalScope     ParameterScope = "GLOBAL_SCOPE"
)

Enum constants of ParameterScope

type Process

type Process struct {
	CategorizedEntity
	DefaultAllocationMethod AllocationType       `json:"defaultAllocationMethod,omitempty"`
	AllocationFactors       []AllocationFactor   `json:"allocationFactors,omitempty"`
	Exchanges               []Exchange           `json:"exchanges,omitempty"`
	Location                *Ref                 `json:"location,omitempty"`
	Parameters              []Ref                `json:"parameters,omitempty"`
	ProcessDocumentation    ProcessDocumentation `json:"processDocumentation"`
	Type                    ProcessType          `json:"processType,omitempty"`
	SocialAspects           []SocialAspect       `json:"socialAspects,omitempty"`
}

Process http://greendelta.github.io/olca-schema/html/Process.html

func NewProcess

func NewProcess(id, name string) *Process

NewProcess initializes a new Process with the given id and name

func ReadProcess

func ReadProcess(data []byte) (*Process, error)

ReadProcess converts the given bytes into a Process

func (*Process) QuantitativeReference

func (p *Process) QuantitativeReference() *Exchange

QuantitativeReference reteruns the Exchange that is the quantitative reference of the process.

type ProcessDocumentation

type ProcessDocumentation struct {
	Entity
	TimeDescription              string `json:"timeDescription,omitempty"`
	ValidUntil                   string `json:"validUntil,omitempty"`
	ValidFrom                    string `json:"validFrom,omitempty"`
	TechnologyDescription        string `json:"technologyDescription,omitempty"`
	DataCollectionDescription    string `json:"dataCollectionDescription,omitempty"`
	CompletenessDescription      string `json:"completenessDescription,omitempty"`
	DataSelectionDescription     string `json:"dataSelectionDescription,omitempty"`
	ReviewDetails                string `json:"reviewDetails,omitempty"`
	DataTreatmentDescription     string `json:"dataTreatmentDescription,omitempty"`
	InventoryMethodDescription   string `json:"inventoryMethodDescription,omitempty"`
	ModelingConstantsDescription string `json:"modelingConstantsDescription,omitempty"`
	Reviewer                     *Ref   `json:"reviewer,omitempty"`
	SamplingDescription          string `json:"samplingDescription,omitempty"`
	Sources                      []Ref  `json:"sources,omitempty"`
	RestrictionsDescription      string `json:"restrictionsDescription,omitempty"`
	HasCopyright                 bool   `json:"copyright"`
	CreationDate                 string `json:"creationDate,omitempty"`
	DataDocumentor               *Ref   `json:"dataDocumentor,omitempty"`
	DataGenerator                *Ref   `json:"dataGenerator,omitempty"`
	DataSetOwner                 *Ref   `json:"dataSetOwner,omitempty"`
	IntendedApplication          string `json:"intendedApplication,omitempty"`
	ProjectDescription           string `json:"projectDescription,omitempty"`
	Publication                  *Ref   `json:"publication,omitempty"`
	GeographyDescription         string `json:"geographyDescription,omitempty"`
}

ProcessDocumentation http://greendelta.github.io/olca-schema/html/ProcessDocumentation.html

type ProcessType

type ProcessType string

ProcessType enumeration

const (
	LCIResult   ProcessType = "LCI_RESULT"
	UnitProcess ProcessType = "UNIT_PROCESS"
)

Enum constants of ProcessType

type Ref

type Ref struct {
	RootEntity
	CategoryPath []string `json:"categoryPath,omitempty"`
}

Ref http://greendelta.github.io/olca-schema/html/Ref.html

func NewReference

func NewReference(eType, id, name string) *Ref

NewReference creates a RootEntity with the given id, type, and name. This function can be used for creating references to root entities.

type RiskLevel

type RiskLevel string

RiskLevel enumeration

const (
	HighOpportunity   RiskLevel = "HIGH_OPPORTUNITY"
	MediumOpportunity RiskLevel = "MEDIUM_OPPORTUNITY"
	LowOpportunity    RiskLevel = "LOW_OPPORTUNITY"
	NoRisk            RiskLevel = "NO_RISK"
	VeryLowRisk       RiskLevel = "VERY_LOW_RISK"
	LowRisk           RiskLevel = "LOW_RISK"
	MediumRisk        RiskLevel = "MEDIUM_RISK"
	HighRisk          RiskLevel = "HIGH_RISK"
	VeryHighRisk      RiskLevel = "VERY_HIGH_RISK"
	NoData            RiskLevel = "NO_DATA"
	NotApplicable     RiskLevel = "NOT_APPLICABLE"
)

Enum constants of RiskLevel

type RootEntity

type RootEntity struct {
	Entity
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Version     string `json:"version,omitempty"`
	LastChange  string `json:"lastChange,omitempty"`
}

RootEntity http://greendelta.github.io/olca-schema/html/RootEntity.html

type SocialAspect

type SocialAspect struct {
	Entity
	Indicator     *Ref      `json:"socialIndicator,omitempty"`
	ActivityValue float64   `json:"activityValue"`
	RawAmount     string    `json:"rawAmount,omitempty"`
	RiskLevel     RiskLevel `json:"riskLevel,omitempty"`
	Comment       string    `json:"comment,omitempty"`
	Source        *Ref      `json:"source,omitempty"`
	Quality       string    `json:"quality,omitempty"`
}

SocialAspect http://greendelta.github.io/olca-schema/html/SocialAspect.html

type SocialIndicator

type SocialIndicator struct {
	CategorizedEntity
	ActivityVariable  string `json:"activityVariable,omitempty"`
	ActivityQuantity  *Ref   `json:"activityQuantity,omitempty"`
	ActivityUnit      *Ref   `json:"activityUnit,omitempty"`
	UnitOfMeasurement string `json:"unitOfMeasurement,omitempty"`
	EvaluationScheme  string `json:"evaluationScheme,omitempty"`
}

SocialIndicator http://greendelta.github.io/olca-schema/html/SocialIndicator.html

func NewSocialIndicator

func NewSocialIndicator(id, name string) *SocialIndicator

NewSocialIndicator initializes a new SocialIndicator with the given id and name

func ReadSocialIndicator

func ReadSocialIndicator(data []byte) (*SocialIndicator, error)

ReadSocialIndicator converts the given bytes into a SocialIndicator

type Source

type Source struct {
	CategorizedEntity
	Doi           string `json:"doi,omitempty"`
	TextReference string `json:"textReference,omitempty"`
	Year          int    `json:"year,omitempty"`
	ExternalFile  string `json:"externalFile,omitempty"`
}

Source http://greendelta.github.io/olca-schema/html/Source.html

func NewSource

func NewSource(id, name string) *Source

NewSource initializes a new Source with the given id and name

func ReadSource

func ReadSource(data []byte) (*Source, error)

ReadSource converts the given bytes into a Source

type Uncertainty

type Uncertainty struct {
	Entity
	Type            UncertaintyType `json:"distributionType,omitempty"`
	Mean            *float64        `json:"mean,omitempty"`
	MeanFormula     string          `json:"meanFormula,omitempty"`
	GeomMean        *float64        `json:"geomMean,omitempty"`
	GeomMeanFormula string          `json:"geomMeanFormula,omitempty"`
	Minimum         *float64        `json:"minimum,omitempty"`
	MinimumFormula  string          `json:"minimumFormula,omitempty"`
	Sd              *float64        `json:"sd,omitempty"`
	SdFormula       string          `json:"sdFormula,omitempty"`
	GeomSd          *float64        `json:"geomSd,omitempty"`
	GeomSdFormula   string          `json:"geomSdFormula,omitempty"`
	Mode            *float64        `json:"mode,omitempty"`
	ModeFormula     string          `json:"modeFormula,omitempty"`
	Maximum         *float64        `json:"maximum,omitempty"`
	MaximumFormula  string          `json:"maximumFormula,omitempty"`
}

Uncertainty http://greendelta.github.io/olca-schema/html/Uncertainty.html

type UncertaintyType

type UncertaintyType string

UncertaintyType enumeration

const (
	LogNormalDistribution UncertaintyType = "LOG_NORMAL_DISTRIBUTION"
	NormalDistribution    UncertaintyType = "NORMAL_DISTRIBUTION"
	TriangleDistribution  UncertaintyType = "TRIANGLE_DISTRIBUTION"
	UniformDistribution   UncertaintyType = "UNIFORM_DISTRIBUTION"
)

Enum constants of UncertaintyType

type Unit

type Unit struct {
	RootEntity
	ConversionFactor float64  `json:"conversionFactor"`
	IsReferenceUnit  bool     `json:"referenceUnit"`
	Synonyms         []string `json:"synonyms,omitempty"`
}

Unit http://greendelta.github.io/olca-schema/html/Unit.html

func NewUnit

func NewUnit(id, name string) *Unit

NewUnit initializes a new Unit with the given id and name

type UnitGroup

type UnitGroup struct {
	CategorizedEntity
	DefaultFlowProperty *Ref   `json:"defaultFlowProperty,omitempty"`
	Units               []Unit `json:"units,omitempty"`
}

UnitGroup http://greendelta.github.io/olca-schema/html/UnitGroup.html

func NewUnitGroup

func NewUnitGroup(id, name string) *UnitGroup

NewUnitGroup initializes a new UnitGroup with the given id and name

func ReadUnitGroup

func ReadUnitGroup(data []byte) (*UnitGroup, error)

ReadUnitGroup converts the given bytes into a UnitGroup

type ZipFile

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

ZipFile embedds the type `File` from the `archive/zip` package and provides additional ILCD specific methods.

func (*ZipFile) Path

func (f *ZipFile) Path() string

Path returns the path of the zip file within the zip package.

func (*ZipFile) Read

func (f *ZipFile) Read() ([]byte, error)

Reads the decompressed data from the zip file.

func (*ZipFile) ReadActor

func (f *ZipFile) ReadActor() (*Actor, error)

ReadActor reads a Actor from the zip file

func (*ZipFile) ReadCategory

func (f *ZipFile) ReadCategory() (*Category, error)

ReadCategory reads a Category from the zip file

func (*ZipFile) ReadFlow

func (f *ZipFile) ReadFlow() (*Flow, error)

ReadFlow reads a Flow from the zip file

func (*ZipFile) ReadFlowProperty

func (f *ZipFile) ReadFlowProperty() (*FlowProperty, error)

ReadFlowProperty reads a FlowProperty from the zip file

func (*ZipFile) ReadImpactCategory

func (f *ZipFile) ReadImpactCategory() (*ImpactCategory, error)

ReadImpactCategory reads a ImpactCategory from the zip file

func (*ZipFile) ReadImpactMethod

func (f *ZipFile) ReadImpactMethod() (*ImpactMethod, error)

ReadImpactMethod reads a ImpactMethod from the zip file

func (*ZipFile) ReadLocation

func (f *ZipFile) ReadLocation() (*Location, error)

ReadLocation reads a Location from the zip file

func (*ZipFile) ReadParameter

func (f *ZipFile) ReadParameter() (*Parameter, error)

ReadParameter reads a Parameter from the zip file

func (*ZipFile) ReadProcess

func (f *ZipFile) ReadProcess() (*Process, error)

ReadProcess reads a Process from the zip file

func (*ZipFile) ReadSocialIndicator

func (f *ZipFile) ReadSocialIndicator() (*SocialIndicator, error)

ReadSocialIndicator reads a SocialIndicator from the zip file

func (*ZipFile) ReadSource

func (f *ZipFile) ReadSource() (*Source, error)

ReadSource reads a Source from the zip file

func (*ZipFile) ReadUnitGroup

func (f *ZipFile) ReadUnitGroup() (*UnitGroup, error)

ReadUnitGroup reads a UnitGroup from the zip file

Jump to

Keyboard shortcuts

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