-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error messages with badly formatted
@id
s (#584)
- Loading branch information
Showing
7 changed files
with
143 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
python/mlcroissant/mlcroissant/_src/tests/graphs/1.0/distribution_bad_id/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"@context": { | ||
"@language": "en", | ||
"@vocab": "https://schema.org/", | ||
"citeAs": "cr:citeAs", | ||
"column": "cr:column", | ||
"conformsTo": "dct:conformsTo", | ||
"cr": "http://mlcommons.org/croissant/", | ||
"data": { | ||
"@id": "cr:data", | ||
"@type": "@json" | ||
}, | ||
"dataBiases": "cr:dataBiases", | ||
"dataCollection": "cr:dataCollection", | ||
"dataType": { | ||
"@id": "cr:dataType", | ||
"@type": "@vocab" | ||
}, | ||
"dct": "http://purl.org/dc/terms/", | ||
"extract": "cr:extract", | ||
"field": "cr:field", | ||
"fileProperty": "cr:fileProperty", | ||
"fileObject": "cr:fileObject", | ||
"fileSet": "cr:fileSet", | ||
"format": "cr:format", | ||
"includes": "cr:includes", | ||
"isEnumeration": "cr:isEnumeration", | ||
"isLiveDataset": "cr:isLiveDataset", | ||
"jsonPath": "cr:jsonPath", | ||
"key": "cr:key", | ||
"md5": "cr:md5", | ||
"parentField": "cr:parentField", | ||
"path": "cr:path", | ||
"personalSensitiveInformation": "cr:personalSensitiveInformation", | ||
"recordSet": "cr:recordSet", | ||
"references": "cr:references", | ||
"regex": "cr:regex", | ||
"repeated": "cr:repeated", | ||
"replace": "cr:replace", | ||
"sc": "https://schema.org/", | ||
"separator": "cr:separator", | ||
"source": "cr:source", | ||
"subField": "cr:subField", | ||
"transform": "cr:transform" | ||
}, | ||
"@type": "sc:Dataset", | ||
"name": "mydataset", | ||
"description": "This is a description.", | ||
"conformsTo": "http://mlcommons.org/croissant/1.0", | ||
"datePublished": "1990-02-01", | ||
"@language": "en", | ||
"citeAs": "This is a citation.", | ||
"license": "This is a license.", | ||
"url": "https://www.google.com/dataset", | ||
"version": "1.0.0", | ||
"distribution": [ | ||
{ | ||
"@type": "cr:FileObject", | ||
"@id": "ids should not contain spaces", | ||
"name": "distribution name", | ||
"contentSize": "117743 B", | ||
"contentUrl": "https://www.google.com/data.csv", | ||
"encodingFormat": "text/csv", | ||
"sha256": "c617db2c7470716250f6f001be51304c76bcc8815527ab8bae734bdca0735737" | ||
} | ||
], | ||
"recordSet": [ | ||
{ | ||
"@type": "cr:RecordSet", | ||
"@id": "a-record-set", | ||
"name": "a-record-set", | ||
"description": "This is a record set.", | ||
"field": [ | ||
{ | ||
"@id": "a-record-set/first-field", | ||
"@type": "cr:Field", | ||
"name": "first-field", | ||
"dataType": "sc:Integer", | ||
"source": { | ||
"extract": { | ||
"column": "a-column" | ||
}, | ||
"fileObject": { | ||
"@id": "ids should not contain spaces" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
python/mlcroissant/mlcroissant/_src/tests/graphs/1.0/distribution_bad_id/output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Found the following 3 error(s) during the validation: | ||
- Every http://mlcommons.org/croissant/source should declare either http://mlcommons.org/croissant/field or http://mlcommons.org/croissant/fileObject or http://mlcommons.org/croissant/fileSet. | ||
- The dataset contains a wrong `@id`: 'ids should not contain spaces'. Note that currently we do not support `@id`s containing whitespaces (not even if URL-escaped). | ||
- [Metadata(mydataset) > RecordSet(a-record-set) > Field(first-field)] Node "a-record-set/first-field" is a field and has no source. Please, use http://mlcommons.org/croissant/source to specify the source. | ||
Found the following 1 warning(s) during the validation: | ||
- [Metadata(mydataset) > RecordSet(a-record-set) > Field(first-field)] Property "https://schema.org/description" is recommended, but does not exist. |