Jonathan's SPARQL problems#91
Conversation
Typo fix Not best practice to accept one's own pull request
This is my attempt. I have only a handful that need their SPARQL queries fixed (they are obviously broken). Those are marked with "borked" in the body. I will adjust those in next 24 hrs. Any PRs welcome.
This reverts commit 0a0b2e6.
This is my attempt. I have only a handful that need their SPARQL queries fixed (they are obviously broken). Those are marked with "borked" in the body. I will adjust those in next 24 hrs. Any PRs welcome.
Tweaked 7-1, 7-3 Fixed 7-8 Realized 7-9 is actually more difficult, and a Kata-6 (now Problem 6-7) Still have to fix: 6-3, 6-6 5-3, 5-4, 5-5 4-2, 4-4 Problem 4-2 should probably be harder. I have a plan.
Tweaked 7-7 Fixed 6-3 Fixed 6-6 Remaining: 5-3, 5-4, 5-5 4-2, 4-4 Problem 4-2 should probably be harder. I have a plan.
fixed code format
Fixed 5-3 Swapped 4-2 (became 5-4) and 5-4 (became 4-2) Fixed 5-4 Fixed 4-2 Still need to fix 5-5 and 4-4
need to fix 5-5 and 4-4
I am not confident that the syntax is right for the negation of the regex. I am going for a negation of a disjunction
Finally fixed all of them to the best of my ability, sans others' feedback.
Giacomo gave feedback that this would be helpful. I think it would be helpful for all of the prompts, but I will probably not be able to furnish them all in time.
I was making it too difficult to filter by age. Fixed!
Giacomo's comment was right. Fixed!
Giacomo said it seemed too easy. I agree. I think it is better now.
fixed primarily composed of
I don't want it to be a kata 6, so I have ramped up the expectations by requiring a CONSTRUCT
raising the number of operators or functions for my Kata-7's, per Jaron's recommendation
Hopefully I have raised the expectations
Create SPARQL-JV.md
giacomodecolle
left a comment
There was a problem hiding this comment.
All good for me, see
| - The FBI wants to put several people on a watchlist if they have performed some suspicious activity. Suppose that they wanted to put anyone on the watchlist who fit the following conditions: the person owns a phone that was present at the US Capital Building on January 6, 2022. There are some ways to connect the device to the building by finding such cases where the mobile device has certain GPS coordinates and communicating with the cell tower such information. This would be too hasty, except that they want to prioritize those who have had a criminal record (bearer of 'FormerCriminalRole') and not a political figure nor a journalist ('PoliticalOfficeRole' and 'JournalistRole', respectively). | ||
| - Assert with CONSTRUCT that such persons bear a FBIWatchlistMemberRole | ||
| - NOTE: Feel free to tell me that this is a Kata-3? | ||
| ``` |
There was a problem hiding this comment.
That's good, unfortunately I am not sure whether it can be a level 3 or not. The way in which the query is set up is for sure complex, and you do use multiple "tricks" (filters, etc.) but there is still no consensus on what distinguishes a level 4 from a level 3.
| - Find all specimens that are instances of blood or bone marrow, derived from a woman younger than 25 years old, who has not tested positive for cancer (and if there has been a negative test result for cancer, include that information), and the specimen is located in the state of Illinois, Indiana, Michigan, or Ohio. | ||
| - NOTE 1: This is largely from ChatGPT, generated 2023-03-25 | ||
| - NOTE 2: I am kinda hoping you rate this as a Kata-3. Nudge. | ||
| ``` |
There was a problem hiding this comment.
I am still not sure about the difference between level 3 and level 4. But this could be a level 3, more than the exercise below. I'm not sure how to express this, but I have the feeling that this kata requires a bit more lateral thinking from the user.
|
|
||
| **Problem 4-2.** | ||
| - An E. coli breakout has occurred recently and the culprit is contaminated iceberg lettuce pallets in the distribution for fastfood restaurants in the midwestern states. All pallets of lettuce that passed through distribution chains in Arkansas and Nebraska are at risk. Declare all such lettuce to bear an "E. coli risk" role and "recall" quality status, if they were present on shipping routes through these two states. (You must change the safety rating, and then assert a new triple that the pallet bears a risk role with CONSTRUCT or a similar function) | ||
| ``` |
There was a problem hiding this comment.
Cool use of DELETE, you might be the first person I have seen using this. Would you consider saying more explicitly in the prompt that teh user needs to use DELETE?
| ``` | ||
|
|
||
| **Problem 5-5.** | ||
| - Suppose that new research shows that males are at heightened risk for testicular cancer if they have the conjunction of two genes, erbB-2 (Receptor tyrosine-protein kinase erbB-2) and PMS2 (Mismatch repair endonuclease PMS2). However, those whose mitochondrial haplogroup L0, L1, L2, L4, L5, L6 (i.e., L1-L6, except L3) are not yet known to be significantly affected. Notifications must be sent out about the incidental findings to patients who have received DNA testing. So clinicians want to tag all patients in their database as having a "cancer vulnerability role" when they meet the aforementioned criteria. Assert two triples that reflects this new information about such persons: the person has a predisposition to testicular cancer, and the person bears a cancer vulnerability role. |
There was a problem hiding this comment.
If you are interested into ontological representations of the receptor tyrosine kinase family, check out the PRC (protein conformation ontology), on which I am currently working on!
|
|
||
| **Problem 5-5.** | ||
| - Suppose that new research shows that males are at heightened risk for testicular cancer if they have the conjunction of two genes, erbB-2 (Receptor tyrosine-protein kinase erbB-2) and PMS2 (Mismatch repair endonuclease PMS2). However, those whose mitochondrial haplogroup L0, L1, L2, L4, L5, L6 (i.e., L1-L6, except L3) are not yet known to be significantly affected. Notifications must be sent out about the incidental findings to patients who have received DNA testing. So clinicians want to tag all patients in their database as having a "cancer vulnerability role" when they meet the aforementioned criteria. Assert two triples that reflects this new information about such persons: the person has a predisposition to testicular cancer, and the person bears a cancer vulnerability role. | ||
| ``` |
There was a problem hiding this comment.
Besides my self-adverstising, the query is good for a five
| } | ||
| ``` | ||
|
|
||
| **Problem 5-3.** |
There was a problem hiding this comment.
with concat and the other functions used it is a solid level 5. I am myself ignorant about the syntax of CONSTRUCT REDUCED
|
|
||
| **Problem 6-7.** | ||
| - Find all musicians born in 1960s, who were members of some grunge band that was based in Seattle. | ||
| ``` |
| @@ -0,0 +1,526 @@ | |||
| **The SPARQL Library of Buffalo** | |||
|
|
|||
There was a problem hiding this comment.
I think I have reviewed all the new katas you added and confirmed the levels for most of them. Please let me know if I missed something - my memory of what I reviewed a couple of days ago is quite bad.
| @@ -0,0 +1,526 @@ | |||
| **The SPARQL Library of Buffalo** | |||
|
|
|||
| [Codewars](https://www.codewars.com/dashboard) is a website designed to facilitate algorithmic training for various programming languages. Users supply problem statements and others provide coding solutions to those problems. For example, you might find a problem for Python such as: | |||
There was a problem hiding this comment.
Dear @jonathanvajda,
The new changes look good! The kata 7s look on par and the rest of the changes that were suggested are a solid improvement from the last iteration.
Well done!
Thanks for inviting me to review your project!
Best,
Jaron
I was missing type assertions for many variables. This is a problem that recurs throughout. Oops? More to correct, btw
See reviews from Giacomo and Jaron