Documentation
¶
Index ¶
- type Context
- type Continuation
- type Entity
- func (anEntity *Entity) GetBooleanPropertyValues(typeURI string) ([]bool, error)
- func (anEntity *Entity) GetFirstBooleanPropertyValue(typeURI string) (bool, error)
- func (anEntity *Entity) GetFirstFloatPropertyValue(typeURI string) (float64, error)
- func (anEntity *Entity) GetFirstIntPropertyValue(typeURI string) (int, error)
- func (anEntity *Entity) GetFirstReferenceValue(typeURI string) (string, error)
- func (anEntity *Entity) GetFirstStringPropertyValue(typeURI string) (string, error)
- func (anEntity *Entity) GetFloatPropertyValues(typeURI string) ([]float64, error)
- func (anEntity *Entity) GetIntPropertyValues(typeURI string) ([]int, error)
- func (anEntity *Entity) GetReferenceValues(typeURI string) ([]string, error)
- func (anEntity *Entity) GetStringPropertyValues(typeURI string) ([]string, error)
- type EntityCollection
- func (ec *EntityCollection) AddEntity(entity *Entity) error
- func (ec *EntityCollection) GetContinuationToken() *Continuation
- func (ec *EntityCollection) GetEntities() []*Entity
- func (ec *EntityCollection) GetNamespaceManager() NamespaceManager
- func (ec *EntityCollection) GetNamespaceMappings() map[string]string
- func (ec *EntityCollection) SetContinuationToken(continuation *Continuation)
- func (ec *EntityCollection) WriteEntityGraphJSON(writer io.Writer) error
- func (ec *EntityCollection) WriteJSON_LD(writer io.Writer) error
- type EntityParser
- func (esp *EntityParser) GetIdentityValue(value string) (string, error)
- func (esp *EntityParser) GetNamespaceManager() NamespaceManager
- func (esp *EntityParser) LoadEntityCollection(reader io.Reader) (*EntityCollection, error)
- func (esp *EntityParser) Parse(reader io.Reader, emitEntity func(*Entity) error, ...) error
- func (esp *EntityParser) WithCompressURIs() *EntityParser
- func (esp *EntityParser) WithExpandURIs() *EntityParser
- func (esp *EntityParser) WithNoContext() *EntityParser
- type JsonLDWriter
- type JsonLdRef
- type NamespaceContext
- func (aContext *NamespaceContext) AsContext() *Context
- func (aContext *NamespaceContext) AssertPrefixFromURI(URI string) (string, error)
- func (aContext *NamespaceContext) GetFullURI(value string) (string, error)
- func (aContext *NamespaceContext) GetNamespaceExpansionForPrefix(prefix string) (string, error)
- func (aContext *NamespaceContext) GetNamespaceMappings() map[string]string
- func (aContext *NamespaceContext) GetPrefixForExpansion(expansion string) (string, error)
- func (aContext *NamespaceContext) GetPrefixedIdentifier(value string) (string, error)
- func (aContext *NamespaceContext) IsFullUri(value string) bool
- func (aContext *NamespaceContext) StorePrefixExpansionMapping(prefix string, expansion string)
- type NamespaceManager
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
func NewContext ¶
func NewContext() *Context
type Continuation ¶
func NewContinuation ¶
func NewContinuation() *Continuation
type Entity ¶
type Entity struct {
ID string `json:"id,omitempty"`
InternalID uint64 `json:"internalId,omitempty"`
Recorded uint64 `json:"recorded,omitempty"`
IsDeleted bool `json:"deleted,omitempty"`
References map[string]interface{} `json:"refs"`
Properties map[string]interface{} `json:"props"`
}
func (*Entity) GetBooleanPropertyValues ¶
func (*Entity) GetFirstBooleanPropertyValue ¶
func (*Entity) GetFirstFloatPropertyValue ¶
func (*Entity) GetFirstIntPropertyValue ¶
func (*Entity) GetFirstReferenceValue ¶
func (*Entity) GetFirstStringPropertyValue ¶
func (*Entity) GetFloatPropertyValues ¶
func (*Entity) GetIntPropertyValues ¶
func (*Entity) GetReferenceValues ¶
type EntityCollection ¶
type EntityCollection struct {
Entities []*Entity
Continuation *Continuation
NamespaceManager NamespaceManager
}
EntityCollection is a utility structure for collecting together a set of entities, namespace mappings and a continuation token
func NewEntityCollection ¶
func NewEntityCollection(nsManager NamespaceManager) *EntityCollection
func (*EntityCollection) AddEntity ¶
func (ec *EntityCollection) AddEntity(entity *Entity) error
add entity to collection
func (*EntityCollection) GetContinuationToken ¶
func (ec *EntityCollection) GetContinuationToken() *Continuation
func (*EntityCollection) GetEntities ¶
func (ec *EntityCollection) GetEntities() []*Entity
func (*EntityCollection) GetNamespaceManager ¶
func (ec *EntityCollection) GetNamespaceManager() NamespaceManager
func (*EntityCollection) GetNamespaceMappings ¶
func (ec *EntityCollection) GetNamespaceMappings() map[string]string
func (*EntityCollection) SetContinuationToken ¶
func (ec *EntityCollection) SetContinuationToken(continuation *Continuation)
Set Continuation Token
func (*EntityCollection) WriteEntityGraphJSON ¶
func (ec *EntityCollection) WriteEntityGraphJSON(writer io.Writer) error
func (*EntityCollection) WriteJSON_LD ¶
func (ec *EntityCollection) WriteJSON_LD(writer io.Writer) error
type EntityParser ¶
type EntityParser struct {
// contains filtered or unexported fields
}
func NewEntityParser ¶
func NewEntityParser(nsmanager NamespaceManager) *EntityParser
func (*EntityParser) GetIdentityValue ¶
func (esp *EntityParser) GetIdentityValue(value string) (string, error)
func (*EntityParser) GetNamespaceManager ¶
func (esp *EntityParser) GetNamespaceManager() NamespaceManager
func (*EntityParser) LoadEntityCollection ¶
func (esp *EntityParser) LoadEntityCollection(reader io.Reader) (*EntityCollection, error)
func (*EntityParser) Parse ¶
func (esp *EntityParser) Parse(reader io.Reader, emitEntity func(*Entity) error, emitContinuation func(*Continuation)) error
func (*EntityParser) WithCompressURIs ¶
func (esp *EntityParser) WithCompressURIs() *EntityParser
func (*EntityParser) WithExpandURIs ¶
func (esp *EntityParser) WithExpandURIs() *EntityParser
func (*EntityParser) WithNoContext ¶
func (esp *EntityParser) WithNoContext() *EntityParser
type JsonLDWriter ¶
type JsonLDWriter struct {
}
func (*JsonLDWriter) Write ¶
func (jsonLDWriter *JsonLDWriter) Write(ec *EntityCollection, writer io.Writer) error
type NamespaceContext ¶
type NamespaceContext struct {
// contains filtered or unexported fields
}
func NewNamespaceContext ¶
func NewNamespaceContext() *NamespaceContext
func (*NamespaceContext) AsContext ¶
func (aContext *NamespaceContext) AsContext() *Context
func (*NamespaceContext) AssertPrefixFromURI ¶
func (aContext *NamespaceContext) AssertPrefixFromURI(URI string) (string, error)
func (*NamespaceContext) GetFullURI ¶
func (aContext *NamespaceContext) GetFullURI(value string) (string, error)
func (*NamespaceContext) GetNamespaceExpansionForPrefix ¶
func (aContext *NamespaceContext) GetNamespaceExpansionForPrefix(prefix string) (string, error)
func (*NamespaceContext) GetNamespaceMappings ¶
func (aContext *NamespaceContext) GetNamespaceMappings() map[string]string
implement get namespace mappings
func (*NamespaceContext) GetPrefixForExpansion ¶
func (aContext *NamespaceContext) GetPrefixForExpansion(expansion string) (string, error)
func (*NamespaceContext) GetPrefixedIdentifier ¶
func (aContext *NamespaceContext) GetPrefixedIdentifier(value string) (string, error)
implement get prefixed identifier
func (*NamespaceContext) IsFullUri ¶
func (aContext *NamespaceContext) IsFullUri(value string) bool
func (*NamespaceContext) StorePrefixExpansionMapping ¶
func (aContext *NamespaceContext) StorePrefixExpansionMapping(prefix string, expansion string)
type NamespaceManager ¶
type NamespaceManager interface {
GetNamespaceExpansionForPrefix(prefix string) (string, error)
GetPrefixForExpansion(expansion string) (string, error)
StorePrefixExpansionMapping(prefix string, expansion string)
IsFullUri(value string) bool
GetFullURI(value string) (string, error)
GetPrefixedIdentifier(value string) (string, error)
GetNamespaceMappings() map[string]string
AssertPrefixFromURI(URI string) (string, error)
AsContext() *Context
}
type Parser ¶
type Parser interface {
Parse(data io.Reader, entity func(*Entity) error, continuation func(*Continuation)) error
LoadEntityCollection(reader io.Reader) (*EntityCollection, error)
GetNamespaceManager() NamespaceManager
}
Click to show internal directories.
Click to hide internal directories.