-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implementation necessary to achieve use case 3 - obtaining events #11
Implementation necessary to achieve use case 3 - obtaining events #11
Conversation
It seems this PR went unnoticed. Is there any criticism about changes provided? |
I was on vacation, too bad no one else picked it up in the meantime. Feel free to ping the mailing list for each new PR. It might be that most people still aren't subscribed to the repo and thus won't get a notification. Review status: 0 of 6 files reviewed at latest revision, 7 unresolved discussions. integration-tests/HydraClient.spec.ts, line 37 at r1 (raw file):
What is this tilde ( integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file):
This interface seems very un-intuitive to me. As a user of Heracles I'd expect to be able to do something like integration-tests/HydraClient.spec.ts, line 42 at r1 (raw file):
Given the description, we should probably type the members and check whether there are a few events instead of looking for a specific URL. integration-tests/server/api/events.jsonld, line 6 at r1 (raw file):
As already mentioned in the test, I think we should type this and perhaps add 1 or 2 more members. src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file):
Did you forget to remove the method above or the code below? You are doing the same thing twice. I would also recommend to rename this method to something like makeTypeArray or something similar that is a bit more descriptive. tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 34 at r1 (raw file):
Is this nesting off? You seem to close the describe block above tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 39 at r1 (raw file):
I think this shows the leaky nature of this interface quite clearly. It returns a more or less random set of data. I'd expect to be able to get a list of links to related resources and a list of operations that I then can invoke. Something like
This link could then simply be passed to the client Comments from Reviewable |
No problem - I expected it somehow Review status: 0 of 6 files reviewed at latest revision, 7 unresolved discussions. integration-tests/HydraClient.spec.ts, line 37 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
Nicely converts result of the indexOf [-1; n] method into a boolean integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
It was the cheapest. As for your example - event is the original resource - we agreed that by default we don't modify it. I'd put it to the hypermedia property. As for the members, I think get(hydra.member) seems more generic as hypermedia is a bag of various objects. integration-tests/HydraClient.spec.ts, line 42 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
Good point integration-tests/server/api/events.jsonld, line 6 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
You mean have it inlined in assertions? src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
Indeed, something's redundant here tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 34 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
I'm not sure I get it tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 39 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
I'll think it over Comments from Reviewable |
Reviewed 6 of 6 files at r1. integration-tests/HydraClient.spec.ts, line 37 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
Could we please make this more explicit? The tilde is a bitwise NOT operator so -1 becomes 0, 0 becomes -1, 1 becomes -2.. not easy to follow integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
Sure, it's more generic but is that a problem? I understand that it is more difficult to implement but it makes the use of this library much easier.. I'm fine to leave that to a separate PR though if you prefer integration-tests/server/api/events.jsonld, line 6 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
I meant changing it to something like
src/DataModel/JsonLd/context.json, line 26 at r1 (raw file):
I assume this should be
instead tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 34 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
Sorry, my bad.. I missed the Comments from Reviewable |
integration-tests/HydraClient.spec.ts, line 37 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
stepping aside from the code style aspect, it looks like client just picks any first collection that appears in the entry point with Comments from Reviewable |
…use-cases/3.obtaining-events
Review status: 2 of 13 files reviewed at latest revision, 7 unresolved discussions. integration-tests/HydraClient.spec.ts, line 37 at r1 (raw file): Previously, elf-pavlik (elf Pavlik) wrote…
Ok, I've removed this pseudo-discovery and replaced it with explicit resource Url. integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
I've added integration-tests/HydraClient.spec.ts, line 42 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
Replaced with typed member check integration-tests/server/api/events.jsonld, line 6 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
I've added types and two more members src/DataModel/JsonLd/context.json, line 26 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
Ahh. It was some time ago, but I think this was to force either framing or flattening to enforce those urls. For some reason these were incorrectly processed. tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 34 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
Ok Comments from Reviewable |
Reviewed 9 of 11 files at r2, 2 of 2 files at r3. integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
OK. I'm still not very happy about this integration-tests/server/api/events.jsonld, line 6 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
Thanks src/DataModel/JsonLd/context.json, line 26 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
I don't follow. What's the point of mapping these URLs to themselves? Comments from Reviewable |
src/DataModel/JsonLd/context.json, line 26 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
It looks that in rest of the codebase you always Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
I think you might have extracted
Comments from Reviewable |
Review status: all files reviewed at latest revision, 4 unresolved discussions. integration-tests/HydraClient.spec.ts, line 38 at r1 (raw file): Previously, lanthaler (Markus Lanthaler) wrote…
OK src/DataModel/JsonLd/context.json, line 26 at r1 (raw file): Previously, elf-pavlik (elf Pavlik) wrote…
As for those two full urls - I'm using a hydra's Url as src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file): Previously, elf-pavlik (elf Pavlik) wrote…
Yeah - I've tried using @set for @type. I've raised it at digitalbazaar/jsonld.js#191 (unsure whether it is implementation or specification issue). BTW - I forgot to fix - I'll try to update PR ASAP. Comments from Reviewable |
Review status: 12 of 13 files reviewed at latest revision, 3 unresolved discussions. src/DataModel/JsonLd/context.json, line 26 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
I think we shouldn't let this block this PR so I captured it in separate issue #15 src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
regarding changing naming of this function, maybe we could propose fine tuning it after merging this PR with a dedicated PR? tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 39 at r1 (raw file): Previously, alien-mcl (Karol Szczepański) wrote…
can we possibly capture it into a separate issue so that we can merge this PR and keep iterating? Comments from Reviewable |
Reviewed 1 of 1 files at r4. src/DataModel/JsonLd/JsonLdHypermediaProcessor.ts, line 140 at r1 (raw file): Previously, elf-pavlik (elf Pavlik) wrote…
Using Tweaking the naming in a dedicated PR sounds good to me. tests/DataModel/JsonLd/JsonLdMetadataProvider.spec.ts, line 39 at r1 (raw file): Previously, elf-pavlik (elf Pavlik) wrote…
Sure. Filed issue #16 for this Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. Comments from Reviewable |
Please find this PR approaching use case 3 - obtaining events.
While the changes in the implementation are relatively small, this PR should open a discussion on how the public API should look like.
I personally prefer a bag of hypermedia controls from which developer can filter out what he needs. Alternative is to have specialized methods that will pick i.e. links or operations.
Drawback of the latter from my perspective is that we may find nuances that link may be considered a special kind of operation or other interesting observations.
Also suggested implementation uses the client instance directly to obtain resources - alternative is to have hypermedia controls to expose methods for doing so.
This change is