jsonld

package
v0.0.0-...-9e61a71 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIndexName string = "@index"

Variables

This section is empty.

Functions

func ParseNodeIndex

func ParseNodeIndex(n ipld.Node) (attrs, directives, index ipld.Node, escapedIndex ipld.Node)

func ToLinkedData

func ToLinkedData(d ipld.Node) ipld.Node

Like ToLinkedDataAll but on the root node only, for use in Walk

func ToLinkedDataAll

func ToLinkedDataAll(d ipld.Node) ipld.Node

Reorganize the data to be valid JSON-LD. This expand custom IPLD directives and unescape keys.

The main processing now is to transform a IPLD data structure like this:

{
	"@container": "@index",
	"@index": "index-name",
	"@attrs": {
		"key": "value",
	},
	"index": { ... }
}

to:

{
	"key": "value",
	"index-name": {
		"index": { ... }
	}
}

In that case, it is good practice to define in the context the following type (this function cannot change the context):

"index-name": { "@container": "@index" }

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳