Skip to content

Remove shortcut from compactIri when iri is a keyword #218

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

Merged
merged 3 commits into from
Jan 25, 2018

Conversation

gkellogg
Copy link
Collaborator

which was preventing cases when keyword alias had @type defined, as in Compact 0073.

…venting cases when keyword alias had `@type` defined, as in Compact 0073.
@gkellogg gkellogg added this to the v0.5.0 milestone Jan 21, 2018
@gkellogg gkellogg changed the title Remove shortcut for compactIri when iri is a keyword Remove shortcut from compactIri when iri is a keyword Jan 22, 2018
lib/compact.js Outdated
}
return iri;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to leave this in place, and exit quickly if an iri is found, and otherwise continue. That would allow for more complicated behavior, while keeping the typical case fast.

lib/compact.js Outdated
return inverseCtx[iri]['@none']['@type']['@none'];
}
return iri;
// if term is a keyword, it can may be compacted to a simple alias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: it can may be => it may be compacted

@dlongley
Copy link
Member

LGTM, just noticed a typo in a comment.

@davidlehn davidlehn merged commit 62651aa into 0.5.x Jan 25, 2018
@davidlehn davidlehn deleted the keyword-aliases-with-type branch January 25, 2018 18:39
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

Successfully merging this pull request may close these issues.

3 participants