rdflib icon indicating copy to clipboard operation
rdflib copied to clipboard

Term improvements

Open multimeric opened this issue 3 months ago • 11 comments

Summary of changes

Rebase of #3169 against 7-maintenance.

All these changes should have no impact at runtime, they're purely to improve UX through static analysis.

  • Convert Term to a typed NamedTuple from a namedtuple. This makes static analysis easier in that your IDE and type checker can understand which fields are present on the type, the type of each field, and give each field its own documentation
  • Document the meaning of each field in Term for usability
  • Move the type definition of Context fields into the class body. This is also for static analysis and allows the user to get tab completion etc when using these fields.

My long term goal is to make this context API usage as a public API, so that I can generate and interact with contexts programmatically instead of just by defining these in JSON.

Checklist

  • [x] Checked that there aren't other open pull requests for the same change.
  • [x] Checked that all tests and type checking passes.
  • [x] Considered granting push permissions to the PR branch, so maintainers can fix minor issues and keep your PR up to date.

multimeric avatar Sep 04 '25 06:09 multimeric

Check the deploy log for errors here: https://app.netlify.com/sites/fundamental-react/deploys

Name Link
Latest commit 581ee2c43a51e3bd278c24ed703c7d3f95044a03
Latest deploy log https://app.netlify.com/projects/fundamental-react/deploys/691cbf13cb447b00082b1387

netlify[bot] avatar Nov 18 '25 18:11 netlify[bot]