MELTS web services
As an alternative to installing MELTS, or to use MELTS in another programming environment, you can use the MELTS web services. You execute a remote procedure call that uses a REST-compatible web service protocol to communicate with a server at OFM Research.
You can access the MELTS web services from any client that can issue and retrieve a POST http request to the server. Such clients include web browsers, Microsoft Excel (using VBA), Python scripts, R functions, and others. You also need an Internet connection. For general information on web services, refer to the Wikipedia article.
There are three MELTS web services:
- MELTS WS Compute - Runs a standard MELTS calculation
- MELTS WS Oxides - Returns a list of oxides for MELTS
- MELTS WS Phases - Returns a list of phases for MELTS
MELTS WS Compute
The MELTS WS Compute web service executes a standard MELTS calculation by sending input in the form of a string or XML document constructed to comply with a schema that defines a valid XML document structure. The output is an XML string.
Input
You call the MELTS WS Compute web service at the URL
http://thermofit.ofm-research.org:8080/multiMELTSWSBxApp/Compute
Send a POST request of contentType equal to text/xml, dataType equal to xml, and with the XML input string associated with a form variable called data.
The input can specify which calibrated version of MELTS to use (i.e., rhyolite-MELTS 1.0.2, 1.1.x, or 1.2.x, or pMELTS). See the schema documentation.
The web service remembers the state of the calculation as long as cookies are enabled on the client side and repeated calls to the service do not specify an "initialize" block in the input XML. Each call to the web service that contains an <initialize/> tag will reinitialize the server state, discarding results of previous calculations.
Output
The output from the web service is in an XML string, structured according to the schema. If you prefer to work with output in JSON format, you can use a Javascript function to convert the XML to JSON (as shown in the example referenced below), or you can make the conversion in whatever language or platform you use to access the web service, such as Python or R.
MELTS WS Oxides
The MELTS WS Oxides web service issues a simple call that requires no additional input. By default, it returns a list of oxides for rhyolite-MELTS version 1.0.2. This service can also accept a value for the POST parameter modelSelection that is identical to the one described within the <initialize> block of the Input schema, which will retrieve an oxide list for alternate calibrations of MELTS.
MELTS WS Phases
Like MELTS WS Oxides, the MELTS WS Phases web service issues a simple call that requires no additional input. By default, it returns a list of phases for rhyolite-MELTS version 1.0.2. This service can also accept a value for the POST parameter modelSelection that is identical to the one described within the <initialize> block of the Input schema, which will retrieve a phase list for alternate calibrations of MELTS.