Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Pfeil
Copy link
Member

@Pfeil Pfeil commented Sep 3, 2024

  • make it impossible to do this (as it is currently not intended)
  • Linter fixes
  • It is not really required to have a DIRECT connection to the root data entity. This means we can currently confuse DataEntities for ContextEntities. From the specification, I can not derive a perfect way to handle this, though. Should we "fix" it?
    • "Data Entities can also be other types, for instance an online database. These SHOULD be of "@type": "CreativeWork" and typically have a @id which is an absolute URI." --> This is not enough to make a reliable assumption on the type. We need to check "indirect" relations to root somehow.
    • --> Implemented traversal of hasPart and isPartOf from root downwards. Should work.
  • Test this with a hypothetic crate or a real example
  • Make code clean enough

Will not fix:

  • Adding a DataEntity will add it to root implicitly, and we currently do not have an API not to do this and only connect it indirectly to root. At least we recognize such elements as root now, but if we create it today, root will always point to all DataEntities. Which is, I believe, not too bad.

@coveralls
Copy link

coveralls commented Sep 3, 2024

Pull Request Test Coverage Report for Build #238

Details

  • 65 of 65 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 90.503%

Totals Coverage Status
Change from base Build #233: 0.2%
Covered Lines: 1582
Relevant Lines: 1748

💛 - Coveralls

@Pfeil Pfeil force-pushed the fix-49-data-entities-without-hasPart branch from 0c6c224 to 2f22e87 Compare September 3, 2024 10:49
@Pfeil Pfeil force-pushed the fix-49-data-entities-without-hasPart branch from 473233b to 9e9891e Compare September 4, 2024 13:11
@Pfeil
Copy link
Member Author

Pfeil commented Sep 4, 2024

The test fails because we add all our DataEntity to root implicitly... so I will need to see if we can/should avoid this. Fixing this without exposing "dangerous" APIs (which may break your crate) was easier and less frustrating than I anticipated.

@Pfeil Pfeil marked this pull request as ready for review September 4, 2024 13:57
@Pfeil Pfeil merged commit b66b171 into main Sep 4, 2024
9 checks passed
@Pfeil Pfeil deleted the fix-49-data-entities-without-hasPart branch September 4, 2024 14:23
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.

It is possible to create unreferenced data entites, resulting in invalid crates

2 participants