func (r *JsonReference) parse(jsonReferenceString string) (err error) {
	r.referenceUrl, err = url.Parse(jsonReferenceString)
	if err != nil {
		return
	}
	refUrl := r.referenceUrl
	if refUrl.Scheme != "" && refUrl.Host != "" {
		r.HasFullUrl = true
	} else {
		if refUrl.Path != "" {
			r.HasUrlPathOnly = true
		} else if refUrl.RawQuery == "" && refUrl.Fragment != "" {
			r.HasFragmentOnly = true
		}
	}
	r.HasFileScheme = refUrl.Scheme == "file"
	if runtime.GOOS == "windows" {
		if refUrl.Host == "" && strings.HasPrefix(refUrl.Path, "/") {
			r.HasFullFilePath = filepath.IsAbs(refUrl.Path[1:])
		} else {
			r.HasFullFilePath = filepath.IsAbs(refUrl.Host + refUrl.Path)
		}
	} else {
		r.HasFullFilePath = filepath.IsAbs(refUrl.Path)
	}
	r.referencePointer, _ = gojsonpointer.NewJsonPointer(refUrl.Fragment)
	return
}
"Constructor", parses the given string JSON reference
package gojsonreference
import (
	"errors"
	"github.com/xeipuuv/gojsonpointer"
	"net/url"
	"path/filepath"
	"runtime"
	"strings"
)
const (
	const_fragment_char = `#`
)
func NewJsonReference(jsonReferenceString string) (JsonReference, error) {
	var r JsonReference
	err := r.parse(jsonReferenceString)
	return r, err
}
type JsonReference struct {
	referenceUrl     *url.URL
	referencePointer gojsonpointer.JsonPointer
	HasFullUrl      bool
	HasUrlPathOnly  bool
	HasFragmentOnly bool
	HasFileScheme   bool
	HasFullFilePath bool
}
func (r *JsonReference) GetUrl() *url.URL {
	return r.referenceUrl
}
func (r *JsonReference) GetPointer() *gojsonpointer.JsonPointer {
	return &r.referencePointer
}
func (r *JsonReference) String() string {
	if r.referenceUrl != nil {
		return r.referenceUrl.String()
	}
	if r.HasFragmentOnly {
		return const_fragment_char + r.referencePointer.String()
	}
	return r.referencePointer.String()
}
func (r *JsonReference) IsCanonical() bool {
	return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullUrl)
}