ucd-library / aggie-experts

Publicly reported feedback and issues for Aggie Experts
https://ucd-library.github.io/aggie-experts/
MIT License
1 stars 2 forks source link

Initial Search API #191

Closed qjhart closed 1 year ago

qjhart commented 1 year ago

The query interface will start with these components:

/api/search?q=[query term]&page=[page number default 1]&size=[page size default 10]

only q is required.

The response includes : total,params,hits. Each hit contains and _inner_hits with the matching nodes.

https://sandbox.experts.library.ucdavis.edu/api/search?q=evapotranspiration&page=2&size=2

{
    "hits": [
        {
            "@id": "person/1669b06de2610b1526fff828b1d1c5b2",
            "@type": "Expert",
            "_inner_hits": [
                {
                    "@type": "Authored",
                    "author": [
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#1",
                            "family": "Young",
                            "given": "Chuck",
                            "rank": 1
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#2",
                            "family": "Wallender",
                            "given": "Wesley",
                            "rank": 2
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#3",
                            "family": "Schoups",
                            "given": "Gerrit",
                            "rank": 3
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#4",
                            "family": "Fogg",
                            "given": "Graham",
                            "rank": 4
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#5",
                            "family": "Hanson",
                            "given": "Blaine",
                            "rank": 5
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#6",
                            "family": "Harter",
                            "given": "Thomas",
                            "rank": 6
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#7",
                            "family": "Hopmans",
                            "given": "Jan",
                            "rank": 7
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#8",
                            "family": "Howitt",
                            "given": "Richard",
                            "rank": 8
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#9",
                            "family": "Hsiao",
                            "given": "Ted",
                            "rank": 9
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#10",
                            "family": "Panday",
                            "given": "Sorab",
                            "rank": 10
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#11",
                            "family": "Tanji",
                            "given": "Ken",
                            "rank": 11
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#12",
                            "family": "Ustin",
                            "given": "Susan",
                            "rank": 12
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2364400#13",
                            "family": "Ward",
                            "given": "Kristen",
                            "rank": 13
                        }
                    ],
                    "container-title": "Irrigation and Drainage Systems",
                    "issued": "2007-05",
                    "title": "Modeling shallow water table evaporation in irrigated regions",
                    "type": "article-journal"
                },
                {
                    "@type": "Authored",
                    "author": [
                        {
                            "@id": "ark:/87287/d7mh2m/publication/1368735#1",
                            "family": "Islam",
                            "given": "Nazrul",
                            "rank": 1
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/1368735#2",
                            "family": "Wallender",
                            "given": "Wesley W",
                            "rank": 2
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/1368735#3",
                            "family": "Mitchell",
                            "given": "Jeffrey",
                            "rank": 3
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/1368735#4",
                            "family": "Wicks",
                            "given": "Santhi",
                            "rank": 4
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/1368735#5",
                            "family": "Howitt",
                            "given": "Richard E",
                            "rank": 5
                        }
                    ],
                    "container-title": "Agricultural Water Management",
                    "issued": "2006-04",
                    "title": "A comprehensive experimental study with mathematical modeling to investigate the affects of cropping practices on water balance variables",
                    "type": "article-journal"
                }
            ],
            "contactInfo": {
                "hasEmail": "email:howitt@primal.ucdavis.edu",
                "hasName": {
                    "@id": "person/1669b06de2610b1526fff828b1d1c5b2#name",
                    "@type": "Name",
                    "family": "Howitt",
                    "given": "Richard"
                },
                "hasOrganizationalUnit": {
                    "@id": "dept/odr/7862",
                    "name": "Ag & Resource Econ"
                },
                "hasTitle": {
                    "@id": "person/1669b06de2610b1526fff828b1d1c5b2#vcard-odr-1-title",
                    "@type": "Title",
                    "name": "Professor Emeritus"
                },
                "hasURL": [
                    {
                        "@id": "person/1669b06de2610b1526fff828b1d1c5b2#vcard-odr-1-url",
                        "@type": "URL",
                        "ucdlib:urlType": {
                            "@id": "ucdlib:URLType_other"
                        },
                        "url": "http://are.ucdavis.edu"
                    }
                ]
            },
            "name": "Howitt, Richard § Professor Emeritus · Ag & Resource Econ"
        },
        {
            "@id": "person/e7a97b96825843a801bde9ff2275ab72",
            "@type": "Expert",
            "_inner_hits": [
                {
                    "@type": "Authored",
                    "author": [
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#1",
                            "family": "Tomaszkiewicz",
                            "given": "M",
                            "rank": 1
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#2",
                            "family": "Najm",
                            "given": "M Abou",
                            "rank": 2
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#3",
                            "family": "Beysens",
                            "given": "D",
                            "rank": 3
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#4",
                            "family": "Alameddine",
                            "given": "I",
                            "rank": 4
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#5",
                            "family": "Zeid",
                            "given": "E Bou",
                            "rank": 5
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360628#6",
                            "family": "El-Fadel",
                            "given": "M",
                            "rank": 6
                        }
                    ],
                    "container-title": "The Science of The Total Environment",
                    "issued": "2016-10",
                    "title": "Projected climate change impacts upon dew yield in the Mediterranean basin",
                    "type": "article-journal"
                },
                {
                    "@type": "Authored",
                    "author": [
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360619#1",
                            "family": "Tomaszkiewicz",
                            "given": "M",
                            "rank": 1
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360619#2",
                            "family": "Najm",
                            "given": "M Abou",
                            "rank": 2
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360619#3",
                            "family": "Zurayk",
                            "given": "R",
                            "rank": 3
                        },
                        {
                            "@id": "ark:/87287/d7mh2m/publication/2360619#4",
                            "family": "El-Fadel",
                            "given": "M",
                            "rank": 4
                        }
                    ],
                    "container-title": "Agricultural and Forest Meteorology",
                    "issued": "2017-01",
                    "title": "Dew as an adaptation measure to meet water demand in agriculture and reforestation",
                    "type": "article-journal"
                }
            ],
            "contactInfo": {
                "hasEmail": "email:mabounajm@ucdavis.edu",
                "hasName": {
                    "@id": "person/e7a97b96825843a801bde9ff2275ab72#name",
                    "@type": "Name",
                    "family": "Abou Najm",
                    "given": "Majdi"
                },
                "hasOrganizationalUnit": {
                    "@id": "dept/pps/030190",
                    "name": "LAND AIR & WATER RESOURCES"
                },
                "hasTitle": {
                    "@id": "title/pps/003070",
                    "name": "ASSOC AGRON AES-AY"
                }
            },
            "name": "Abou Najm, Majdi § ASSOC AGRON AES-AY · LAND AIR & WATER RESOURCES"
        }
    ],
    "params": {
        "from": 2,
        "page": "2",
        "q": "evapotranspiration",
        "size": "2"
    },
    "total": 6
}
qjhart commented 1 year ago

@UcDust I've put this into Q/A for you to review, and let me know if you can complete the search pages, and the CSV download #190 with this information.

UcDust commented 1 year ago

@qjhart In name, can Role, Department be separated by comma instead of dot as it currently is?

UcDust commented 1 year ago

@qjhart Also some of the roles/departments come back as Undefined . Undefined, could that be fixed?

qjhart commented 1 year ago

Aggie Experts Linked data has been updated to include a schema.name property for every vcard. This combines name, title and department if they all exist.

On import into Aggie Experts, the best contact's schema:name is promoted to the document level.