1
$\begingroup$

Given:

data1 = {
   {URL["https://lex.uz/en/docs/3815506"], "On Plant Protection", 
    "PD 34", {"Plant quarantine", "Plant health", 
     "Soil health"}}, {URL["https://lex.uz/en/docs/6906672"], 
    "On Land Reform", 
    "Law 56", {"Land tenure", "Soil health", "Land lease"}}
         };
ds1 = Query[All, {"Links" -> All}]@
   Dataset[AssociationThread[{"Links", "Titles", "Number", 
         "Keywords"} -> #] & /@ data1];
expand1 = 
 ds1[Query[All, 
    row |-> Map[<|"Keywords" -> #, "Number" -> row["Number"], 
        "Titles" -> row["Titles"], "Links" -> row["Links"]|> &, 
      row["Keywords"]]]][Flatten]

I select keywords using:

selectKeywordPartial[dataset_, keyword_] := 
 Select[dataset, StringContainsQ[#Keywords, keyword] &]
selectKeywordPartial[expand1, {"Tenure", "Soil"}]

This selection based on keywords are Case sensitive and I do not want a case sensitive selection. How can I select keywords and associated rows using Case insensitive option?

In web search, I only get titles with hyperlinks. Is there an automatic method to extract the URL links attached to the titles and present them as a dataset with titles and URL links separately, like in the above example?

$\endgroup$
3
  • 1
    $\begingroup$ For case insensitive search the IgnoreCase Option can be used StringContainsQ[#Keywords, keyword, IgnoreCase -> True] $\endgroup$
    – vindobona
    Commented Oct 16 at 11:28
  • 1
    $\begingroup$ @vindobona: Thanks for the tip. For my second question, I found the link mathematica.stackexchange.com/a/216179/60365 answering my question. Earlier I could not reach this answer. $\endgroup$ Commented Oct 16 at 12:37
  • $\begingroup$ @vindobona: This link does not really explain what I want to achieve. So my second question still remains to be a question to answer. $\endgroup$ Commented Oct 16 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.