Documentation ¶
Index ¶
- func Compact(ctx context.Context, doc map[string]interface{}, uri string, ...) (map[string]interface{}, error)
- func CompactObject(ctx context.Context, obj *Object) (map[string]interface{}, error)
- func Expand(ctx context.Context, doc map[string]interface{}, uri string) (map[string]interface{}, error)
- func ID(id string) map[string]interface{}
- func Is(e Entity, typ string) bool
- func NewDocumentLoader(ctx context.Context) ld.DocumentLoader
- func ObjectIDs(objs []*Object) []string
- func Options(ctx context.Context, uri string) *ld.JsonLdOptions
- func ToSlice(raw interface{}) []interface{}
- func ToString(raw interface{}) string
- func ToStringSlice(raw interface{}) []string
- func Value(v interface{}) map[string]interface{}
- type Entity
- type Object
- func (obj *Object) Apply(patch Entity, mergeArrays bool) error
- func (obj *Object) Get(key string) interface{}
- func (obj *Object) ID() string
- func (obj *Object) IsNull() bool
- func (obj Object) MarshalJSON() ([]byte, error)
- func (obj *Object) Obj() *Object
- func (obj *Object) Set(key string, value interface{})
- func (obj *Object) SetID(id string)
- func (obj *Object) SetType(ts ...string)
- func (obj *Object) SetValue(v string)
- func (obj *Object) Type() []string
- func (obj *Object) UnmarshalJSON(data []byte) error
- func (obj *Object) Value() string
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactObject ¶
func NewDocumentLoader ¶
func NewDocumentLoader(ctx context.Context) ld.DocumentLoader
Returns a DocumentLoader for the json-gold library. It's basically a simplified version of the default DocumentLoader, which can't be tricked into touching the local filesystem, and with the addition of proper request contexts.
func ToSlice ¶
func ToSlice(raw interface{}) []interface{}
Casts to a slice. If the value is a slice, it's returned verbatim. If not, it's returned wrapped in a slice with one item.
func ToStringSlice ¶
func ToStringSlice(raw interface{}) []string
Types ¶
type Entity ¶
type Entity interface { Obj() *Object IsNull() bool ID() string Value() string Type() []string Get(key string) interface{} Set(key string, v interface{}) Apply(other Entity, mergeArrays bool) error }
An interface for any kind of entity which embeds Object.
type Object ¶
type Object struct { V map[string]interface{} // contains filtered or unexported fields }
The base type of all JSON-LD objects.
func ParseObject ¶
Creates a new object from a JSON object.
func ParseObjects ¶
Creates a new list of objects from a JSON array.
func (*Object) Apply ¶
Applies another object as a patch to this object. The mergeArrays argument specifies whether values for existing keys should replace the existing value, or be added as an additional value.
func (Object) MarshalJSON ¶
func (*Object) UnmarshalJSON ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |
as
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |
ldp
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |
owl
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |
rdf
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |
sec
GENERATED FILE, DO NOT EDIT.
|
GENERATED FILE, DO NOT EDIT. |