Documentation ¶
Index ¶
- Variables
- func AppendExternalContexts(context interface{}, extraContexts ...string) []interface{}
- func TransformBlankNode(row string) string
- type Opts
- type Processor
- func (p *Processor) Compact(input, context map[string]interface{}, opts ...Opts) (map[string]interface{}, error)
- func (p *Processor) Frame(inputDoc map[string]interface{}, frameDoc map[string]interface{}, opts ...Opts) (map[string]interface{}, error)
- func (p *Processor) GetCanonicalDocument(doc map[string]interface{}, opts ...Opts) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidRDFFound = errors.New("invalid JSON-LD context")
ErrInvalidRDFFound is returned when normalized view contains invalid RDF.
Functions ¶
func AppendExternalContexts ¶
func AppendExternalContexts(context interface{}, extraContexts ...string) []interface{}
AppendExternalContexts appends external context(s) to the JSON-LD context which can have one or several contexts already.
func TransformBlankNode ¶
TransformBlankNode replaces blank node identifiers in the RDF statements. For example, transform from "_:c14n0" to "urn:bnid:_:c14n0".
Types ¶
type Opts ¶
type Opts func(opts *processorOpts)
Opts are the options for JSON LD operations on docs (like canonicalization or compacting).
func WithDocumentLoader ¶
func WithDocumentLoader(loader ld.DocumentLoader) Opts
WithDocumentLoader option is for passing custom JSON-LD document loader.
func WithExternalContext ¶
WithExternalContext option is for definition of external context when doing JSON-LD operations.
func WithFrameBlankNodes ¶
func WithFrameBlankNodes() Opts
WithFrameBlankNodes option for transforming blank node identifiers into nodes. For example, _:c14n0 is transformed into <urn:bnid:_:c14n0>.
func WithRemoveAllInvalidRDF ¶
func WithRemoveAllInvalidRDF() Opts
WithRemoveAllInvalidRDF option for removing all invalid RDF dataset from normalize document.
func WithValidateRDF ¶
func WithValidateRDF() Opts
WithValidateRDF option validates result view and fails if any invalid RDF dataset found. This option will take precedence when used in conjunction with 'WithRemoveAllInvalidRDF' option.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is JSON-LD processor for aries. processing mode JSON-LD 1.0 {RFC: https://www.w3.org/TR/2014/REC-json-ld-20140116}
func Default ¶
func Default() *Processor
Default returns new JSON-LD processor with default RDF dataset algorithm.
func NewProcessor ¶
NewProcessor returns new JSON-LD processor for aries.
func (*Processor) Compact ¶
func (p *Processor) Compact(input, context map[string]interface{}, opts ...Opts) (map[string]interface{}, error)
Compact compacts given json ld object.