generator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDRef

type IDRef struct {
	Value json.RawMessage
}

func (*IDRef) GetIDs

func (idr *IDRef) GetIDs() ([]NodeID, error)

func (IDRef) MarshalJSON

func (idr IDRef) MarshalJSON() ([]byte, error)

func (*IDRef) UnmarshalJSON

func (idr *IDRef) UnmarshalJSON(data []byte) error

type LanguageString

type LanguageString struct {
	Value    string `json:"@value,omitempty"`
	Language string `json:"@language,omitempty"`
}

func (LanguageString) MarshalJSON

func (ls LanguageString) MarshalJSON() ([]byte, error)

MarshalJSON para LanguageString

func (LanguageString) String

func (ls LanguageString) String() string

String retorna apenas o valor (ignorando o idioma)

func (*LanguageString) UnmarshalJSON

func (ls *LanguageString) UnmarshalJSON(data []byte) error

UnmarshalJSON para LanguageString

type NodeID

type NodeID string

func (NodeID) ToKebab

func (nid NodeID) ToKebab() string

type SchemaContext

type SchemaContext struct {
	Bibo           string `json:"bibo"`
	Brick          string `json:"brick"`
	CmnsCls        string `json:"cmns-cls"`
	CmnsCol        string `json:"cmns-col"`
	CmnsDt         string `json:"cmns-dt"`
	CmnsGe         string `json:"cmns-ge"`
	CmnsID         string `json:"cmns-id"`
	CmnsLoc        string `json:"cmns-loc"`
	CmnsQ          string `json:"cmns-q"`
	CmnsTxt        string `json:"cmns-txt"`
	Csvw           string `json:"csvw"`
	Dc             string `json:"dc"`
	Dcam           string `json:"dcam"`
	Dcat           string `json:"dcat"`
	Dcmitype       string `json:"dcmitype"`
	Dct            string `json:"dct"`
	Dcterms        string `json:"dcterms"`
	Dctype         string `json:"dctype"`
	Doap           string `json:"doap"`
	Eli            string `json:"eli"`
	FiboBeCorpCorp string `json:"fibo-be-corp-corp"`
	FiboBeGeGe     string `json:"fibo-be-ge-ge"`
	FiboBeLeCb     string `json:"fibo-be-le-cb"`
	FiboBeLeLp     string `json:"fibo-be-le-lp"`
	FiboBeNfpNfp   string `json:"fibo-be-nfp-nfp"`
	FiboBeOacCctl  string `json:"fibo-be-oac-cctl"`
	FiboFbcDaeDbt  string `json:"fibo-fbc-dae-dbt"`
	FiboFbcPasFpas string `json:"fibo-fbc-pas-fpas"`
	FiboFndAccCur  string `json:"fibo-fnd-acc-cur"`
	FiboFndAgrCtr  string `json:"fibo-fnd-agr-ctr"`
	FiboFndArrDoc  string `json:"fibo-fnd-arr-doc"`
	FiboFndArrLif  string `json:"fibo-fnd-arr-lif"`
	FiboFndDtOc    string `json:"fibo-fnd-dt-oc"`
	FiboFndOrgOrg  string `json:"fibo-fnd-org-org"`
	FiboFndPasPas  string `json:"fibo-fnd-pas-pas"`
	FiboFndPlcAdr  string `json:"fibo-fnd-plc-adr"`
	FiboFndPlcFac  string `json:"fibo-fnd-plc-fac"`
	FiboFndPlcLoc  string `json:"fibo-fnd-plc-loc"`
	FiboFndPtyPty  string `json:"fibo-fnd-pty-pty"`
	FiboFndRelRel  string `json:"fibo-fnd-rel-rel"`
	FiboPayPsPs    string `json:"fibo-pay-ps-ps"`
	Foaf           string `json:"foaf"`
	GleifL1        string `json:"gleif-L1"`
	Gs1            string `json:"gs1"`
	Hydra          string `json:"hydra"`
	Lcc31661       string `json:"lcc-3166-1"`
	Lcc4217        string `json:"lcc-4217"`
	LccCr          string `json:"lcc-cr"`
	LccLr          string `json:"lcc-lr"`
	Lrmoo          string `json:"lrmoo"`
	Mo             string `json:"mo"`
	Odrl           string `json:"odrl"`
	Org            string `json:"org"`
	Owl            string `json:"owl"`
	Prof           string `json:"prof"`
	Prov           string `json:"prov"`
	Qb             string `json:"qb"`
	Rdf            string `json:"rdf"`
	Rdfs           string `json:"rdfs"`
	Sarif          string `json:"sarif"`
	Schema         string `json:"schema"`
	Sh             string `json:"sh"`
	Skos           string `json:"skos"`
	Snomed         string `json:"snomed"`
	Sosa           string `json:"sosa"`
	Ssn            string `json:"ssn"`
	Time           string `json:"time"`
	Unece          string `json:"unece"`
	Vann           string `json:"vann"`
	Vcard          string `json:"vcard"`
	Void           string `json:"void"`
	Xsd            string `json:"xsd"`
}

type SchemaGraphNode

type SchemaGraphNode struct {
	ID          NodeID         `json:"@id"`
	Type        StringOrArray  `json:"@type"`
	RdfsComment LanguageString `json:"rdfs:comment,omitempty"` // will generates comments on structs
	RdfsLabel   LanguageString `json:"rdfs:label,omitempty"`

	// To be filtered
	SchemaInverseOf    *IDRef `json:"schema:inverseOf,omitempty"`    // May be used to remove inversed definitions
	SchemaSupersededBy *IDRef `json:"schema:supersededBy,omitempty"` // May be used to remove deprecated definitions

	// Child node pointers
	RdfsSubPropertyOf    *IDRef `json:"rdfs:subPropertyOf,omitempty"`
	SchemaDomainIncludes *IDRef `json:"schema:domainIncludes,omitempty"`
	SchemaRangeIncludes  *IDRef `json:"schema:rangeIncludes,omitempty"`
	RdfsSubClassOf       *IDRef `json:"rdfs:subClassOf,omitempty"`

	Childs []NodeID // Populate by search RdfsSubPropertyOf
	// contains filtered or unexported fields
}

func (*SchemaGraphNode) GenDecl

func (node *SchemaGraphNode) GenDecl() *ast.GenDecl

type SchemaOrg

type SchemaOrg struct {
	ExpandedCounter int
	Context         SchemaContext      `json:"@context"`
	Graph           []*SchemaGraphNode `json:"@graph"`
	// contains filtered or unexported fields
}

func Parse

func Parse(r io.Reader) (*SchemaOrg, error)

func (*SchemaOrg) FindDef

func (so *SchemaOrg) FindDef(sID NodeID) *SchemaGraphNode

func (*SchemaOrg) GenFile

func (so *SchemaOrg) GenFile(ident string) *ast.File

type StringOrArray

type StringOrArray struct {
	Values []string
}

StringOrArray lida com campos que podem ser string ou []string

func (StringOrArray) Contains

func (sa StringOrArray) Contains(value string) bool

func (StringOrArray) First

func (sa StringOrArray) First() string

Métodos auxiliares para facilitar o uso

func (StringOrArray) MarshalJSON

func (sa StringOrArray) MarshalJSON() ([]byte, error)

MarshalJSON para StringOrArray

func (*StringOrArray) UnmarshalJSON

func (sa *StringOrArray) UnmarshalJSON(data []byte) error

UnmarshalJSON para StringOrArray

Jump to

Keyboard shortcuts

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