core_explore_periodic_table_app is a Django app.
INSTALLED_APPS = [
...
'core_explore_periodic_table_app',
]
re_path(r'^explore/periodic_table/', include("core_explore_periodic_table_app.urls")),
Configure the Search by periodic table app by adding search operators pointing to chemical elements in the CDCS data. Start by adding a search operator:
import requests
payload = {
"name": "chemical",
"xpath_list": [
"/experiment/experimentType/tracerDiffusivity/diffusingSpecies/element",
"/experiment/experimentType/tracerDiffusivity/material/Composition/constituents/constituent/element"
]
}
requests.post(
SERVER_URI + "/explore/keyword/rest/search_operators/", data=payload, auth=(USER, PASSWORD)
)
Then, tell the periodic table app to use one or many search operators by adding mappings:
import requests
payload = {
"search_operator": "5f49048f3b3689f92cb84f41"
}
requests.post(
SERVER_URI + "/explore/periodic_table/rest/search_operators_mapping/", data=payload, auth=(USER, PASSWORD)
)