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

fix: RO-Crate validation should work for nested properties without id #41

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def is_entity_flat_recursive(entity: Any, is_first: bool = True) -> bool:
return False
# if this is not the root element, it must not contain more properties than @id
else:
if "@id" in entity and len(entity) > 1:
if "@id" not in entity or len(entity) > 1:
return False
if isinstance(entity, list):
for element in entity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
"@id": "https://w3id.org/ro/crate/1.1"
},
"about": {
"@type": "Dataset",
"@id": "./",
"hasPart": [
{
"@type": "File",
"@id": "test.csv",
"encodingFormat": "text/csv",
"name": "This is a test file",
"description": "This is a test dataset"
}
],
"name": "This is a test dataset",
"description": "This is a test dataset",
"license": {
"@id": "https://creativecommons.org/licenses/by/4.0/"
},
"datePublished": "2024-11-05"
"@id": "./"
}
},
{
"@id": "./",
"@type": "Dataset",
"name": "This is a test dataset",
"description": "This is a test dataset",
"license": {
"@id": "https://creativecommons.org/licenses/by/4.0/"
},
"datePublished": "2024-11-05",
"hasPart": [
{
"@type": "File",
"name": "File in a nested entity"
}
]
}
]
}