Closed NeilCollinsMS closed 3 weeks ago
I think you are getting the syntax wrong. After the cell magic, you can't enter Python code, just Dimensions Search Language statements. EG this works
%%dsldf
search publications
where
(
(research_orgs.id = "grid.10837.3d" and research_orgs.id = "grid.4991.5")
)
and (
year = 2020
or year = 2021
)
return publications[id+authors+year+research_orgs]
See the results in my notebook:
Documentation link: https://api-lab.dimensions.ai/cookbooks/1-getting-started/3-Working-with-dataframes.html#The-Dimcli-Python-library:-Working-with-Pandas-Dataframes
Using complex search queries yields the 'DSL to dataframe magic methods work only with
search
queries' error despite being applied to a stored search query. An example can be found below:%%dsldf
query = """search publications where ( (research_orgs.id = "grid.######.1" and research_orgs.id = "grid.######.6") ) and ( year = 2020 or year = 2021 ) return [id+authors+year+research_orgs]""" res = dsl.query(query)
Adjustments have been made to query fields, but do not yield any fixes. Is it possible that this method only works on term searching?