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

getProperties() does not expose the value of literals #248

Closed
johnslaughter-ihsmarkit opened this issue Sep 7, 2021 · 1 comment · Fixed by #251
Closed

getProperties() does not expose the value of literals #248

johnslaughter-ihsmarkit opened this issue Sep 7, 2021 · 1 comment · Fixed by #251

Comments

@johnslaughter-ihsmarkit
Copy link

johnslaughter-ihsmarkit commented Sep 7, 2021

I am calling the helper method getProperties on a resource. I would expect that I could get all defined values off of the objects object. However, if the value of the property is a literal (e.g. {name: 'test'}) no values are returned via the objects object.

From preliminary investigation, I believe the source might be from the use of getArray() which won't return literals (If I'm not mistaken)

const objects = this.getArray(predicate.term)

I believe this is a regression because this seems to be working on v1.1.1 (via the wikibus.org site).

@tpluscode
Copy link
Member

Indeed, and interestingly it changed as result of fix in this commit

See that getArray is generic, intending to return only resources and it was in fact a "bug" that it did not filter out literals.

Anyway, I agree that it should not be like that in Alcaeus. Will fix soon 👍

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 a pull request may close this issue.

2 participants