Discussion Forum

TypeQL Error: Illegal grammar!

i am using grakn for testing precision medicine based on genes. I have referred a blog How to Use a Knowledge Graph for Precision Medicine | by Syed Irtaza Raza | Vaticle | Medium here when i added the rules i am getting an error as [TQL39] TypeQL Error: Illegal grammar!

rules i have written here in my schema are:

personalised-patient-therapy sub rule,
when{
    ($person, $trial) isa eligible-trial-participant;
    ($person, $trial) isa relevant-trial-participant;
},
then{
    ($person, $trial) isa personalized-therapy;
};



trial-participant-eligibility sub rule,
when{
    $person isa person, has age $age, has gender $gender;
    $trial isa clinical-trial,
        has min-age <= $age,
        has max-age >= $age,
        has gender = $gender;
    $disease isa disease; ($disease, $person); ($disease, $trial);

},
then{
    ($person, $trial) isa eligible-trial-participant;
};


trial-participant-relevance sub rule,
when{
    $person isa person;
    ($person, $gene); $gene isa gene, has gene-symbol $gs;
    ($person, $variant); $variant isa variant, has variant-symbol $vs;
    $trial isa clinical-trial, 
        has gene-title = $gs, 
        has variant-title = $vs;
},
then{
    ($person, $trial) isa relevant-trial-participant;
};

can’t find what is causing this error

you’re using 1.x syntax, make sure you conver it to 2.x TypeQL syntax :slight_smile:

yes thanks…it’s working :slight_smile:

1 Like