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

Resolving certain reverse links is broken #92

Open
apdavison opened this issue Sep 15, 2024 · 1 comment
Open

Resolving certain reverse links is broken #92

apdavison opened this issue Sep 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@apdavison
Copy link
Member

e.g.

repo = omcore.FileRepository.from_id("c569b826-9d2e-4ba0-9363-561906c67cd6", kg_client)
files = repo.files.resolve(kg_client)
assert len(files) == 37

This fails, and gives len(files) => 10000

The problem is that in the FileRepository class the reverse property files has reverse="file_repositories", which does not match the forward property name in File, which is file_repository. This results in the query being built incorrectly.

@apdavison apdavison added the bug Something isn't working label Sep 15, 2024
@apdavison apdavison self-assigned this Sep 15, 2024
apdavison added a commit that referenced this issue Sep 15, 2024
The remaining broken cases are where some forward links to the same type have singular names and others plural.

Running builder/update_openminds.py gives
```
Multiple forward link names found: {'specifications', 'specification'}, using specification
Multiple forward link names found: {'digitalIdentifier', 'digitalIdentifiers'}, using digitalIdentifier
Multiple forward link names found: {'formats', 'format'}, using format
Multiple forward link names found: {'licenses', 'license'}, using license
Multiple forward link names found: {'specifications', 'specification'}, using specification
Multiple forward link names found: {'dataLocations', 'dataLocation'}, using dataLocation
Multiple forward link names found: {'origins', 'origin'}, using origin
Multiple forward link names found: {'ageCategories', 'ageCategory'}, using ageCategories
Multiple forward link names found: {'preparationDesigns', 'preparationDesign'}, using preparationDesign
Multiple forward link names found: {'origins', 'origin'}, using origin
Multiple forward link names found: {'origins', 'origin'}, using origin
Multiple forward link names found: {'biologicalSexes', 'biologicalSex'}, using biologicalSex
Multiple forward link names found: {'type', 'types'}, using type
```
apdavison added a commit that referenced this issue Sep 15, 2024
@apdavison apdavison moved this to In Progress in fairgraph development Sep 15, 2024
@apdavison
Copy link
Member Author

This was partially fixed in 28da285 but there are still some cases that fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

No branches or pull requests

1 participant