Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This looks like a bug #39

Open
jaydonnell opened this issue Nov 1, 2020 · 1 comment
Open

This looks like a bug #39

jaydonnell opened this issue Nov 1, 2020 · 1 comment

Comments

@jaydonnell
Copy link

If I'm reading this code correctly, you are checking if something is an IRI with strings.Contains(iri, ":"). This will match strings which have colons but are not IRIs.

func (jldp *JsonLdProcessor) expand(input interface{}, opts *JsonLdOptions) ([]interface{}, error) {

	// 1)
	// TODO: look into promises

	var remoteContext string

	// 2)
	if iri, isString := input.(string); isString && strings.Contains(iri, ":") {

If that is what this code intends to do, maybe use this

import "net/url"

...

u, err := url.ParseRequestURI("http://google.com/")
if err != nil {
   panic(err) // not a valid URI
}
@kazarena
Copy link
Member

kazarena commented Nov 1, 2020

Thanks, that's a fair point. Will address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants