jsonld

package module
v0.0.0-...-4564de9 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

JSON-LD 1.1

JSON-LD 1.1 is a JSON-based format to serialize Linked Data.

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context map[string]TermDefinition

Context is a JSON-LD context.

func (Context) Inverse

func (ctx Context) Inverse() InverseContext

func (*Context) UnmarshalJSON

func (ctx *Context) UnmarshalJSON(bytes []byte) error

type Document

type Document struct {
	Context Context `json:"@context"`
	Graph   Graph   `json:"@graph"`
	ID      string  `json:"@id"`
	Type    Type    `json:"@type"`
	Values  map[string]Node
}

func NewDocument

func NewDocument() *Document

func (*Document) MarshalJSON

func (doc *Document) MarshalJSON() ([]byte, error)

func (*Document) UnmarshalJSON

func (doc *Document) UnmarshalJSON(bytes []byte) error

type Graph

type Graph []Node

func (*Graph) UnmarshalJSON

func (graph *Graph) UnmarshalJSON(bytes []byte) error

type InverseContext

type InverseContext map[string]InverseContextEntry

type InverseContextEntry

type InverseContextEntry struct {
	ID   string
	Term TermDefinition
}

type Literal

type Literal struct {
	Language string `json:"@language"`
	Value    string `json:"@value"`
}

func (*Literal) MarshalJSON

func (l *Literal) MarshalJSON() ([]byte, error)

func (*Literal) UnmarshalJSON

func (l *Literal) UnmarshalJSON(bytes []byte) error

type Node

type Node struct {
	ID       string `json:"@id"`
	Type     Type   `json:"@type,omitempty"`
	Value    string `json:"@value,omitempty"`
	Language string `json:"@language,omitempty"`
	Values   map[string]any
}

func (*Node) MarshalJSON

func (node *Node) MarshalJSON() ([]byte, error)

func (*Node) UnmarshalJSON

func (node *Node) UnmarshalJSON(bytes []byte) error

func (*Node) UnmarshalValue

func (node *Node) UnmarshalValue(key string, bytes []byte) error

func (*Node) UnmarshalValueExtensible

func (node *Node) UnmarshalValueExtensible(bytes []byte, extensible func(key string, bytes []byte) error) error

type NodeReference

type NodeReference struct {
	ID string `json:"@id"`
}

type NodeReferences

type NodeReferences []NodeReference

func (NodeReferences) MarshalJSON

func (ns NodeReferences) MarshalJSON() ([]byte, error)

func (*NodeReferences) UnmarshalJSON

func (ns *NodeReferences) UnmarshalJSON(bytes []byte) error

type TermDefinition

type TermDefinition struct {
	ID   string `json:"@id"`
	Type string `json:"@type,omitempty"`
}

func (*TermDefinition) UnmarshalJSON

func (t *TermDefinition) UnmarshalJSON(bytes []byte) error

type Type

type Type []string

func (Type) IsType

func (typ Type) IsType(t string) bool

func (*Type) UnmarshalJSON

func (typ *Type) UnmarshalJSON(bytes []byte) error

type ValueExtensible

type ValueExtensible interface {
	json.Unmarshaler
	UnmarshalValue(key string, bytes []byte) error
	UnmarshalValueExtensible(bytes []byte, extensible func(key string, bytes []byte) error) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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