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

Generalized RDF-star #112

Merged
merged 7 commits into from
Dec 6, 2022
Merged

Generalized RDF-star #112

merged 7 commits into from
Dec 6, 2022

Conversation

pchampin
Copy link
Collaborator

@pchampin pchampin commented Dec 2, 2022

This PR mostly extends the generalized parsers to support RDF-star.

In the process, I also updated the documentation, and some internal method, of the other parsers, to align with the latest terminology of RDF-star ("RDF-star" instead of "RDF*", "quoted triples" instead of "embedded triples").

This makes it impossible to convert GeneralizedTerms to strict terms;
however, this is actually not required for normal use.

The only use was in testsuite, so instead I provided a conversion
to OwnedQuad, OwnedTerm, etc.
* add precision to N-Triples and N-Quads parser documentation.
  The previous message was not totally accurate about allocations
  during parsing.

* replace RDF* with RDF-star

* add RDF-star in some places it was missing

* replace "nested triple" and "embedded triple" with "quoted triple"

also removed a few warnings (unused imports, unused names)
The generalized triple allocator enables generalized RDF-star.
The generalized n-quads parser demonstrates that.

TODO: use the generalized triple allocator in GTrig
@pchampin pchampin requested a review from Tpt December 2, 2022 17:18
@pchampin
Copy link
Collaborator Author

pchampin commented Dec 2, 2022

I forgot to mention a few other changes:

  • I have added a 2nd generalized parser: Generalized N-Quads
  • some formatting changes in multiple files have been caused by running the latest cargo fmt

Finally, I ran cargo clippy and fixed all the warnings... but then clippy fails with a compiler panic -- as can be seen in the CI... :-/

Copy link
Collaborator

@Tpt Tpt left a comment

Choose a reason for hiding this comment

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

Looks great to me! Thank you!

I found a few typos (not very important...)

About the CI failure, I have opened a bug in the Clippy repo about it: rust-lang/rust-clippy#10021

api/src/generalized.rs Show resolved Hide resolved
turtle/src/triple_allocator.rs Outdated Show resolved Hide resolved
turtle/src/gtriple_allocator.rs Outdated Show resolved Hide resolved
turtle/src/gnquads.rs Outdated Show resolved Hide resolved
turtle/src/gnquads.rs Outdated Show resolved Hide resolved
turtle/src/gnquads.rs Outdated Show resolved Hide resolved
turtle/src/gtrig.rs Show resolved Hide resolved
@Tpt Tpt force-pushed the main branch 3 times, most recently from 9ec634a to 2e61177 Compare December 5, 2022 20:17
@pchampin
Copy link
Collaborator Author

pchampin commented Dec 6, 2022

@Tpt thanks for these comments. I addressed them all (except for replacing [GeneralizedTerm; 3] with a custom GeneralizedTriple type, which was not a strong requirement IIUC.

@Tpt Tpt merged commit 05fe3a5 into main Dec 6, 2022
@Tpt Tpt deleted the generalized-star branch December 6, 2022 07:47
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.

2 participants