Exemplo n.º 1
0
/*
GetNRef returns the id of a node reference if the input is one.
*/
func GetNRef(input interface{}) (string, bool) {
	var (
		nref map[string]interface{}
	)

	if !ld.IsNodeReference(input) {
		return "", false
	}
	nref = input.(map[string]interface{})
	return nref["@id"].(string), true
}
Exemplo n.º 2
0
/*
IsNref returns true if the input is a JSON LD node reference.
*/
func IsNref(input interface{}) bool {
	return ld.IsNodeReference(input)
}