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

Feature request: method properties() and reverse() on Node #20

Closed
pchampin opened this issue Oct 23, 2021 · 6 comments
Closed

Feature request: method properties() and reverse() on Node #20

pchampin opened this issue Oct 23, 2021 · 6 comments
Labels
enhancement New feature or request
Projects

Comments

@pchampin
Copy link
Contributor

These method would produce an iterator over (Reference, Indexed<Object>) pairs, or something similar.

I am working on the JSON-LD parser for Sophia, and I need to inspect the output for expand to produce RDF quads. I could convert it to a JsonValue, but that would introduce an unnecessary overhead, IMO.

Or am I missing something?

@timothee-haudebourg
Copy link
Owner

I think you are not missing anything. I've been so focused on the general design of the library I've neglected the actual API it seems. I should release a new version soon with the changes made in the generic-json branch. I'll try to furnish the API with this kind of methods.

@timothee-haudebourg timothee-haudebourg added this to In Progress in Version 1.0 Oct 26, 2021
@timothee-haudebourg timothee-haudebourg added the enhancement New feature or request label Oct 28, 2021
@timothee-haudebourg
Copy link
Owner

I've released version 0.5.0 which includes the two methods Node::properties and reverse_properties that should do what you need, along with some other useful methods.

Beware that I also moved away from the json crate. The JSON type is now a type parameter. It can theoretically be any JSON type as long as it implements the generic_json::Json trait, but for now only the ijson::IValue type does, which can be parsed using serde_json. I plan to add support for serde_json::Value as soon as possible.

Version 1.0 automation moved this from In Progress to Done Nov 4, 2021
@pchampin
Copy link
Contributor Author

pchampin commented Nov 8, 2021

I tried to do the switch, but it created a subdependency on cc-traits 0.7.0 which needs the unstable toolchain (#![feature(generic_associated_types)]).

Is this dependency unavoidable?? As much as I would love to use GATs myself, I prefer to keep Sophia on the stable channel... :-/

@timothee-haudebourg
Copy link
Owner

I'm afraid it wont be avoidable for a little while even if I don't like it either. I need two unstable features: generic_associated_types and trait_alias. GAT were supposed to be stabilized soon, I guess there are still some details to figure out. I'm a little bit more worried about trait aliases. Those are required to make the JSON abstraction layer work, but sadly it seems it won't be stabilized soon...

If you really need it and absolutely want to avoid unstable features, I can try to release a 0.4.1 version with those methods, if crates.io will let me.

@timothee-haudebourg
Copy link
Owner

timothee-haudebourg commented Nov 9, 2021

I'm currently thinking about getting rid of the trait_alias feature. If I can pull that off, then we'll just have to wait until GATs are stabilized (which should happen soon) and json-ld will be usable with stable Rust.

@pchampin
Copy link
Contributor Author

Thanks for the feedback. Yes, I would prefer to keep Sophia on the stable channel, but I guess I can wait until GATs are stabilized to further integrate json-ld. Anyway, I don't have much time for progressing right now... :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants