cambialens / lens-api-doc

10 stars 6 forks source link

Query to get the list of article which are submitted #9

Closed KristChronos closed 5 years ago

KristChronos commented 5 years ago

Hello, Thank all for helping me pull the info, But I want to add another query where I want to pull all the articles which are still pending to be accepted. Like there are still in progress and awaiting for the next step. I tried to filter out using date created but most of them already has date published. so any clue how I can add another filter. and just a heads up: I have a range filter {"range": {"year_published": {"gte": "2018","lte": "2019"}} and I want to get all the articles from 2018 whether its published or not..

AaronBallagh commented 5 years ago

Hi @KristChronos
Currently we do not explicitly harvest pre-print publication records though we inevitable get them through our data sources. While we do not have a specific field for publication status, we do have date fields that would help to determine the publication status of a scholarly work in our data sources, but we do not yet expose these through the API. Please let me know if you are interested in knowing what fields might be available to help you with this sort of query. Cheers, Aaron

KristChronos commented 5 years ago

Hi @AaronBallagh, Thank you for the insight. I tried to using Date_published and date_created, apparently, date_published and date_created doesn't coincidence with each other. and Year_published is not much help either. the date_published and year_published are completely different from each other. And also, the total amount I get from the Lens and from the api are completely different. on the webpage, it says 4838 and in the api, its 5066 with the same search field. Am I missing something?

AaronBallagh commented 5 years ago

Hi @KristChronos That is correct, the date_published and the date created may not coincide as the date created is the date the Lens record was created and is not associated with the publication of the scholarly work. To help me debug your query though, so you can replicate the numbers on the website, would you mind sending me the URL for your search which returned 4838 results? Cheers, Aaron

KristChronos commented 5 years ago

Hello @AaronBallagh , Here is the link https://www.lens.org/lens/scholar/search/results?q=&page=0&limit=10&orderBy=%2Bscore&filterMap=%7B%22funding.organisation.keyword%22:%7B%22Bill%20and%20Melinda%20Gates%20FoundationBill%20and%20Melinda%20Gates%20Foundation%22:true,%22Bill%20and%20Melinda%20Gates%20Foundation%22:true,%22Bill%20%26%20Melinda%20Gates%20Foundation%22:true,%22Bill%20%26%20Melinda%20Gates%20FoundationBill%20%26%20Melinda%20Gates%20Foundation%22:true,%22Bill%20and%20Melinda%20Gates%20Institute%20for%20Population%20and%20Reproductive%20Health%22:true,%22Bill%20and%20Melinda%20Gates%20Foundation%20(US)%22:true,%22Bill%20and%20Melinda%20Gates%20Foundation%20(Bill%20%26amp;%20Melinda%20Gates%20Foundation)%22:true,%22Bill%20and%20Melinda%20Gates%20FoundationBill%20and%20Melinda%20Gates%20Foundation%20(BMGF)%22:true,%22Bill%20%26amp;%20Melinda%20Gates%20Foundation%22:true,%22BMGF%22:true,%22BMGF%20GC%2012%22:true,%22BMGF%20GC%206-74%22:true%7D,%22publication_type%22:%7B%22journal%20article%22:true%7D%7D&dateFilterField=year_published&previewType=SCHOLAR_ANALYSIS&preview=true&regexEnabled=false&useAuthorId=false. Is there any way, that I can pull the publication Status of those articles? like as in which stage they are in?

AaronBallagh commented 5 years ago

Hi @KristChronos

Thanks for sending that URL, we have validated the results and we have identified a minor issue that is causing the discrepancy between the website and the API. This will be resolved in an update next week so the API will give the same results as the UI for your query.

In terms of the publication status, we do not currently provide a publication status field and so you are not able to pull that information at the moment sorry. Please let me know via the support desk (support@lens.org) if you are interested in knowing what fields might be available to help identify the publication status.

Cheers, Aaron

rosharma9 commented 5 years ago

Hi @KristChronos , We have pushed to the fix and it's live now. Here is the query for your use case. Please give it a go.

{
    "query": {
        "bool": {
            "must": [
                    {"bool":{
                        "should":[
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates FoundationBill and Melinda Gates Foundation"}},
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates Foundation"}},
                            {"match_phrase": {"funding.organisation": "Bill & Melinda Gates Foundation"}},
                            {"match_phrase": {"funding.organisation": "Bill & Melinda Gates FoundationBill & Melinda Gates Foundation"}},
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates Institute for Population and Reproductive Health"}},
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates Foundation (US)"}},
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates Foundation (Bill & Melinda Gates Foundation)"}},
                            {"match_phrase": {"funding.organisation": "Bill and Melinda Gates FoundationBill and Melinda Gates Foundation (BMGF)"}},
                            {"match_phrase": {"funding.organisation": "Bill & Melinda Gates Foundation"}},
                            {"match_phrase": {"funding.organisation": "BMGF"}},
                            {"match_phrase": {"funding.organisation": "BMGF GC 12"}},
                            {"match_phrase": {"funding.organisation": "BMGF GC 6-74"}}
                        ]
                    }
                },
                {"match": {"publication_type": "journal article"}}
            ]
        }
    },
    "include":["lens_id", "title"]
}

Cheers, Roshan