Skip to content

WIP: Add support for dicts with @graph keywords#360

Closed
jesper-friis wants to merge 8 commits intomasterfrom
graph-dict
Closed

WIP: Add support for dicts with @graph keywords#360
jesper-friis wants to merge 8 commits intomasterfrom
graph-dict

Conversation

@jesper-friis
Copy link
Contributor

Description

Update save_dict() to allow dicts containing a top-level "@graph" keyword with a list of dicts to save

Type of change

  • Bug fix and code cleanup
  • New feature
  • Documentation update
  • Testing

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?
  • Is the code properly tested?

@jesper-friis jesper-friis marked this pull request as draft March 18, 2025 08:24
@jesper-friis jesper-friis changed the title Add support for dicts with @graph keywords WIP: Add support for dicts with @graph keywords Mar 18, 2025
@codecov
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 5 lines in your changes missing coverage. Please review.

Project coverage is 82.18%. Comparing base (51258ad) to head (0fad89f).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
tripper/datadoc/dataset.py 85.71% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
- Coverage   82.26%   82.18%   -0.08%     
==========================================
  Files          27       27              
  Lines        3439     3452      +13     
==========================================
+ Hits         2829     2837       +8     
- Misses        610      615       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jesper-friis jesper-friis changed the title WIP: Add support for dicts with @graph keywords Add support for dicts with @graph keywords Mar 26, 2025
@jesper-friis jesper-friis changed the title Add support for dicts with @graph keywords WIP: Add support for dicts with @graph keywords Mar 26, 2025
jesper-friis added a commit that referenced this pull request Mar 29, 2025
From the data documentation in COLD we learned that it is useful to also include the classes in the JSON-LD context.

This makes it e.g. possible to short names when referring to classes in JSON-LD files. Ex: `{"@type": "Resource", ...}`

This PR is also used in PR #360 to replace keywords with JSON-LD context in many parts of the dataset API. The benefit with this is that this allows to use existing externally defined JSON-LD contexts.

Also added a `__dir__()` method to Keywords that include the documented attributes. It simplifies interactive exploration of Keyword instances using ipython (used while implementing this PR).
jesper-friis added a commit that referenced this pull request Apr 22, 2025
# Description
We are in a state with many open PRs with mutual conflicts. This branch
merge them together and resolve conflicts.
It merges the following branches:

- context-module, PR #378
- keyword_bugs, PR #375
- master
- matchmaker-demo, PR #377
- fix-readme-link, PR #379
- use_pyld, PR #376

Furthermore it has added support for the graph keyword (in a better
way), replacing PR #360 as well.
See [Tripper network](https://github.com/EMMC-ASBL/tripper/network) for
details.

The speed of tabledoc has been greatly improved. The PINK example with
1021 datasets now runs in a few seconds compared to minutes before...

---------

Co-authored-by: Francesca.L.Bleken@sintef.no <francesca.l.bleken@sintef.no>
@jesper-friis
Copy link
Contributor Author

Closing since a better solution solution was included in PR #380

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.

1 participant