jsonld

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 49

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRDFFound = processor.ErrInvalidRDFFound

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 added in v0.1.6

func TransformBlankNode(row string) string

TransformBlankNode replaces blank node identifiers in the RDF statements. For example, transform from "_:c14n0" to "urn:bnid:_:c14n0".

Types

type Processor

type Processor = processor.Processor

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

func NewProcessor(algorithm string) *Processor

NewProcessor returns new JSON-LD processor for aries.

type ProcessorOpts

type ProcessorOpts = processor.Opts

ProcessorOpts are the options for JSON LD operations on docs (like canonicalization or compacting).

func WithDocumentLoader

func WithDocumentLoader(loader ld.DocumentLoader) ProcessorOpts

WithDocumentLoader option is for passing custom JSON-LD document loader.

func WithExternalContext

func WithExternalContext(context ...string) ProcessorOpts

WithExternalContext option is for definition of external context when doing JSON-LD operations.

func WithFrameBlankNodes added in v0.1.6

func WithFrameBlankNodes() ProcessorOpts

WithFrameBlankNodes option for transforming blank node identifiers into nodes. For example, _:c14n0 is transformed into <urn:bnid:_:c14n0>.

func WithRemoveAllInvalidRDF

func WithRemoveAllInvalidRDF() ProcessorOpts

WithRemoveAllInvalidRDF option for removing all invalid RDF dataset from normalize document.

func WithValidateRDF added in v0.1.4

func WithValidateRDF() ProcessorOpts

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.

Jump to

Keyboard shortcuts

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