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 Stripe Calling validation rules #443

Closed
wants to merge 2 commits into from

Conversation

leexgh
Copy link

@leexgh leexgh commented Jul 25, 2024

Background

The script is failing at se.load_schema(url) with error message:

jsonschema.exceptions.ValidationError: The json_schema has an error in the validation_rules set for attribute StripeCalling. Validation failed with the following errors: [['NA', 'StripeCalling', 'The json_schema, has an error in the validation rule for the attribute: StripeCalling, the provided validation rules (-?\\d+) is not a valid rule. Please check spelling.', 'Not a Rule']]

Solution
The validation rule of StripeCalling needs to be fixed. The valid format should be list :: regex module regular_expression.
Current StripeCalling validation rule is

"sms:validationRules": [
                "list",
                "-?\\d+"
            ]

Compared with other data types, for example "LoopWindow" has:

"sms:validationRules": [
                "list like ",
                " regex search -?\\d+"
            ]

regex search is missing in validationRules. So StripeCalling schema should be:

            "@id": "bts:StripeCalling",
            "@type": "rdfs:Class",
            "rdfs:comment": "Tool used for identifying architectural stripe-forming, interaction hotspots.",
            "rdfs:label": "StripeCalling",
            "rdfs:subClassOf": [
                {
                    "@id": "bts:Sequencing"
                }
            ],
            "schema:isPartOf": {
                "@id": "http://schema.biothings.io"
            },
            "schema:rangeIncludes": [
                {
                    "@id": "bts:MACS2"
                },
                {
                    "@id": "bts:Other"
                }
            ],
            "sms:displayName": "Stripe Calling",
            "sms:required": "sms:true",
            "sms:validationRules": [
                "list",
                " regex search -?\\d+"
            ]
        },

Copy link
Contributor

@adamjtaylor adamjtaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for spotting and fixing

Copy link
Contributor

@aditigopalan aditigopalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! @leexgh I think you would need to push changes from a branch on ncihtan/data-models for the check to pass.

@aclayton555
Copy link
Contributor

24-7 close out: @adamjtaylor will take a look at this one, merge, and include in data model release to close out 24-7 sprint

@adamjtaylor
Copy link
Contributor

JSON-LD conversion seems to have failed. I am investigating

@adamjtaylor adamjtaylor self-requested a review July 29, 2024 16:55
@adamjtaylor
Copy link
Contributor

Oh, I think I see the issue, @leexgh you edited both the CSV and JSON-LD by hand. The JSON-LD should be left untouched and then generated by a GH action. Not your fault not to know - I will revert those changes in the branch and see if that triggers the action correctly

@adamjtaylor
Copy link
Contributor

I was wrong... looking at the full error it is failing because the action bot does not have permission to commit from fork. I will close this PR and make the modification in a new branch of this repo

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.

4 participants