Skip to content

Commit

Permalink
Merge pull request #41 from dnlbauer/fix_flattend_ro_crate_detection
Browse files Browse the repository at this point in the history
fix: RO-Crate validation should work for nested properties without id
  • Loading branch information
kikkomep authored Nov 13, 2024
2 parents bcbe829 + ea801a9 commit bc6cad4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
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"
}
]
}
]
}

0 comments on commit bc6cad4

Please sign in to comment.