The Component Editions of Cranium and Synapse (the servers) enable software applications (the clients) to access and utilize some of the functions they contain. For example, some of these functions enable client applications to retrieve physical property data, estimate physical properties, generate xy and triangular graphs, retrieve reference inforamtion, generate citations, and retrieve molecular structure files.
The Component Editions use Microsoft's COM (Component Object Model) technology to provide access to five MKS Library Objects:
The following sections describe each of these library objects and their associated functions.
The application object is the top-level object containing several key functions for assigning source documents, setting output windows, and processing requests. The figure to the left shows code that creates an application object and calls its "Version" function. The result of executing this code is shown below.
The application object is the top-level object containing several key functions for assigning source documents, setting output windows, and processing requests. The figure to the left shows code that creates an application object and calls its "Version" function. The result of executing this code is shown below.
The application object is the top-level object containing several key functions for assigning source documents, setting output windows, and processing requests. The figure to the left shows code that creates an application object and calls its "Version" function. The result of executing this code is shown below.
The following list details the application object's commonly used functions:
The request object is used to specify details about the values you wish the application to retrieve or calculate. A request's type (assigned with the SetType function explained below) determines what type of operation the application will perform. The code to the left is a VBA subroutine that creates a request for the names of all the estimation techniques contained within the source knowledge base that begin with the characters "Tc". (Note that 'GetKBDocPath' is a user-defined function that returns the pathname of the source knowledge base.) The figure below shows the output generated by the subroutine.
The request object is used to specify details about the values you wish the application to retrieve or calculate. A request's type (assigned with the SetType function explained below) determines what type of operation the application will perform. The code to the left is a C++ function that creates a request for the names of all the estimation techniques contained within the source knowledge base that begin with the characters "Tc". (Note that 'GetKBDocPath' is a user-defined function that returns the pathname of the source knowledge base.) The figure below shows the output generated by the function.
The request object is used to specify details about the values you wish the application to retrieve or calculate. A request's type (assigned with the SetType function explained below) determines what type of operation the application will perform. The code to the left is a C# function that creates a request for the names of all the estimation techniques contained within the source knowledge base that begin with the characters "Tc". (Note that 'GetKBDocPath' is a user-defined function that returns the pathname of the source knowledge base.) The figure below shows the output generated by the function.
The following list details the request object's commonly used functions:
Every request object must have a "Type" attribute. (Assigned by using the object's SetType function.) The available Type values are listed below:
Each of these request types is explained and illustrated in the sections below.
The 'Hello' request is a simple request typically used to test connectivity with the Component Edition. The current date and time is formatted into a string and stored within a datum. The code to the right shows the creation of the application and a request of the Hello type. The output value is extracted from the first datum of the first property of the first entity of the request.
The 'Hello' request is a simple request typically used to test connectivity with the Component Edition. The current date and time is formatted into a string and stored within a datum. The code to the right shows the creation of the application and a request of the Hello type. The output value is extracted from the first datum of the first property of the first entity of the request.
The 'Hello' request is a simple request typically used to test connectivity with the Component Edition. The current date and time is formatted into a string and stored within a datum. The code to the right shows the creation of the application and a request of the Hello type. The output value is extracted from the first datum of the first property of the first entity of the request.
Every request must have a "Type" value. The 'Get Request Types' request returns all of the request types that can be currently processed by the Component Edition. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
Every request must have a "Type" value. The 'Get Request Types' request returns all of the request types that can be currently processed by the Component Edition. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
Every request must have a "Type" value. The 'Get Request Types' request returns all of the request types that can be currently processed by the Component Edition. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
Every input entity must have an "EntityType" value. The 'Get Entity Types' request returns all of the entity types that can be currently processed by the api. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
Every input entity must have an "EntityType" value. The 'Get Entity Types' request returns all of the entity types that can be currently processed by the api. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
Every input entity must have an "EntityType" value. The 'Get Entity Types' request returns all of the entity types that can be currently processed by the api. Note that the response returns data for the '#Virtual Property' of the '#Virtual Entity'. These are just placeholders used to maintain the uniformity of the MKS object structure.
To retrieve physical property data and estimates from the Component Edition, you must make a request containing an entity's identifier. The 'Get Entities' request retrieves the identifiers (names) of all entities in the assigned source document. The request retrieves only entity identifiers for a single entity type. You must specify this entity type using the request's AddArgument function. (The list of entity types can be obtained by processing the Get Entity Types request.)
To retrieve physical property data and estimates from the Component Edition, you must make a request containing an entity's identifier. The 'Get Entities' request retrieves the identifiers (names) of all entities in the assigned source document. The request retrieves only entity identifiers for a single entity type. You must specify this entity type using the request's AddArgument function. (The list of entity types can be obtained by processing the Get Entity Types request.)
To retrieve physical property data and estimates from the Component Edition, you must make a request containing an entity's identifier. The 'Get Entities' request retrieves the identifiers (names) of all entities in the assigned source document. The request retrieves only entity identifiers for a single entity type. You must specify this entity type using the request's AddArgument function. (The list of entity types can be obtained by processing the Get Entity Types request.)
To retrieve a chemical's data values, you must know the chemical's name. Unfortunately, chemicals often have more than one name. For example, 1-butanol is also often called n-butanol, n-butyl alcohol, or just butanol. Several attempts at creating unique names have been undertaken over the years by organizations such as Elsevier Publishing (beilstein numbers), the American Chemical Society (cas numbers), the European Union (ec numbers), and the Flavor Extract Manufacturers Association (fema numbers). Unfortunately, as this brief listing shows, there are many 'unique' names.
To address this issue of multiple identifiers, the api enables you to add qualifiers to the Get Entities request. These qualifiers are added as arguments of the request and thus take the form of an attribute-value pair.
The attributes that are allowed are listed here:
The value of the attribute-value pair is a string that may contain more or more 'pattern-matching' characters. These characters are:
These pattern-matching characters can be combined and used multiple times in a value. For example, the value "$hex?ne" will match cyclohexane, 2-methyl-1-hexene, 3-methylhexane, and several more chemicals.
You may use more than one pattern-matching attribute pair. For example you might combine the pair "Identifier": "$but$" with "Synonym": "$alcohol$" to retrieve a list of butyl alcohols.
The code shown to the right retrieves the identifiers of all chemicals that have a synonym which matches the value "MEK". Note it is possible that more than one chemical will have the same synonym.
The code shown to the right retrieves the identifiers of all chemicals that have a synonym which matches the value "MEK". Note it is possible that more than one chemical will have the same synonym.
The code shown to the right retrieves the identifiers of all chemicals that have a synonym which matches the value "MEK". Note it is possible that more than one chemical will have the same synonym.
The code shown to the right retrieves the identifiers of all chemicals that have a synonym that matches "$2060". (This pattern would match 3-Methylbutyl butyrate, which has the synonym "FEMA Number: 2060".)
The code shown to the right retrieves the identifiers of all chemicals that have a synonym that matches "$2060". (This pattern would match 3-Methylbutyl butyrate, which has the synonym "FEMA Number: 2060".)
The code shown to the right retrieves the identifiers of all chemicals that have a synonym that matches "$2060". (This pattern would match 3-Methylbutyl butyrate, which has the synonym "FEMA Number: 2060".)
The code to the right retrieves the identifier of chemicals whose chemical formula contains carbon, nitrogen, and oxygen, i.e., 'C$N$O$'. Note that pattern matching chemical formula is not the best method for finding matching chemical structures. That is because the pattern "C$" will match C8 as well as Ca, Cl, Co, or Cu.
The code to the right retrieves the identifier of chemicals whose chemical formula contains carbon, nitrogen, and oxygen, i.e., 'C$N$O$'. Note that pattern matching chemical formula is not the best method for finding matching chemical structures. That is because the pattern "C$" will match C8 as well as Ca, Cl, Co, or Cu.
The code to the right retrieves the identifier of chemicals whose chemical formula contains carbon, nitrogen, and oxygen, i.e., 'C$N$O$'. Note that pattern matching chemical formula is not the best method for finding matching chemical structures. That is because the pattern "C$" will match C8 as well as Ca, Cl, Co, or Cu.
More than one pattern-matching attribute-value pair can be added to a request. The example code to the right retrieves combines the pair "Identifier": "$but$" with the pair "Synonym": "$alcohol$" to retrieve a list of butyl alcohols.
More than one pattern-matching attribute-value pair can be added to a request. The example code to the right retrieves combines the pair "Identifier": "$but$" with the pair "Synonym": "$alcohol$" to retrieve a list of butyl alcohols.
More than one pattern-matching attribute-value pair can be added to a request. The example code to the right retrieves combines the pair "Identifier": "$but$" with the pair "Synonym": "$alcohol$" to retrieve a list of butyl alcohols.
The code to the left retrieves the names of all chemical properties that are of the 'Data' property type. Note that the request's AddAttribute function is used to specify the entity type and property type. A similar request would be used to retrieve the names of all chemical properties that are of the "Estimates" property type.
The code to the left retrieves the names of all chemical properties that are of the 'Data' property type. Note that the request's AddAttribute function is used to specify the entity type and property type. A similar request would be used to retrieve the names of all chemical properties that are of the "Estimates" property type.
The code to the right retrieves the names of all chemical properties that are of the 'Data' property type. Note that the request's AddAttribute function is used to specify the entity type and property type.
The code to the left retrieves the status values currently handled by the Component Edition.
The code to the left retrieves the status values currently handled by the Component Edition.
The code to the left retrieves the status values currently handled by the Component Edition.
The code to the left retrieves all units currently available for the Liquid Density property. (Note that although this request requires an entity and one or more properties, not all of the entity attribute or property attributes need to be specified.)
The code to the left retrieves all units currently available for the Liquid Density property. (Note that although this request requires an entity and one or more properties, not all of the entity attribute or property attributes need to be specified.)
The code to the left retrieves all units currently available for the Liquid Density property. (Note that although this request requires an entity and one or more properties, not all of the entity attribute or property attributes need to be specified.)
The 'Get Values' request is probably the most commonly used request type. To make this request, you must typically specify an entity's type, an entity's identifier, a property name, and a status value. To generate new estimates, you may also have to specify one or more datum values containing values for temperature, pressure, and composition.
Conceptually, you can think of a Get Values request as a form. You first add information you know on the form. You then submit the form to the Component Edition. The Component Edition returns the form to you with the missing information, or much of it, filled in.
The following examples demonstrate various Get Values requests.
The code to the left returns a data value and a newly estimated value for the boiling point of 1,2-Dichlorobenzene. Note that the only difference between the two property objects is their status value.
The code to the left returns a data value and a newly estimated value for the boiling point of 1,2-Dichlorobenzene. Note that the only difference between the two property objects is their status value.
The code to the left returns a data value and a newly estimated value for the boiling point of 1,2-Dichlorobenzene. Note that the only difference between the two property objects is their status value.
The code to the left creates a new mixture and estimates the activity coefficients of component 1 at several compositions. Note that you must specify the names of the new mixture's components as datum objects within a 'Components' property object.
The code to the left creates a new mixture and estimates the activity coefficients of component 1 at several compositions. Note that you must specify the names of the new mixture's components as datum objects within a 'Components' property object.
The code to the left creates a new mixture and estimates the activity coefficients of component 1 at several compositions. Note that you must specify the names of the new mixture's components as datum objects within a 'Components' property object.
The Component Edition can receive chemical structure information in SMILES notation or MolFile format. The code to the left estimates several properties for OC(=O)CCCCCCCCCCC, which is the chemical structure of lauric acid. Note that the chemical's structure is given in the request object as an 'Active' status value datum and the properties to be estimated have status values of 'New Estimate'. This instructs the Component Edition to 'cache' the input, active data. See caching data values below for more details on this capability.
The Component Edition can receive chemical structure information in SMILES notation or MolFile format. The code to the left estimates several properties for OC(=O)CCCCCCCCCCC, which is the chemical structure of lauric acid. Note that the chemical's structure is given in the request object as an 'Active' status value datum and the properties to be estimated have status values of 'New Estimate'. This instructs the Component Edition to 'cache' the input, active data. See caching data values below for more details on this capability.
The Component Edition can receive chemical structure information in SMILES notation or MolFile format. The code to the left estimates several properties for OC(=O)CCCCCCCCCCC, which is the chemical structure of lauric acid. Note that the chemical's structure is given in the request object as an 'Active' status value datum and the properties to be estimated have status values of 'New Estimate'. This instructs the Component Edition to 'cache' the input, active data. See caching data values below for more details on this capability.
For many requests you will need to specify some information about one or more entities. For example, to request a chemical's critical pressure data value, you must specify the chemical's identifier attribute. To request a mixture's estimated liquid density, you must specify the mixture's identifier and its list of components attributes. The entity object is used to specify such information.
Thus to retrieve data and estimates for these mixture physical properties, you must use this function to set the component's index. Note that the component index is 'zero-based', e.g., in a binary mixture the component indices are 0 and 1.
Only a few mixture properties are 'component dependent'. Thus, for most properties you will simply assign a value of 0.
The code to the left returns property data having various status values for Benzene. Note that although a constant property, like the critical temperature, will have only one 'active' value, it may have several 'passive' values.
The code to the left returns property data having various status values for Benzene. Note that although a constant property, like the critical temperature, will have only one 'active' value, it may have several 'passive' values.
The code to the left returns property data having various status values for Benzene. Note that although a constant property, like the critical temperature, will have only one 'active' value, it may have several 'passive' values.
The code to the left returns the critical temperature of Butyraldehyde: a literature value and estimates generated by an automatically selected technique and several manually selected techniques. (The automatic mode estimate is the property object without a manual technique entry.)
The code to the left returns the critical temperature of Butyraldehyde: a literature value and estimates generated by an automatically selected technique and several manually selected techniques. (The automatic mode estimate is the property object without a manual technique entry.)
The code to the left returns the critical temperature of Butyraldehyde: a literature value and estimates generated by an automatically selected technique and several manually selected techniques. (The automatic mode estimate is the property object without a manual technique entry.)
When the Component Edition processes a 'Get Values' request it conceptually processes the request twice. During the first processing, the Component Edition temporarily stores all Active data found in the request object into the source knowledge base. For example, if the request has Active boiling point data, these values will be temporarily stored, or cached, in the source knowledge base. During the second processing, all other data and estimated will be retrieved.
This two step processing enables you to add values to the knowledge base, albeit temporarily, which can then be used in all subsequent estimations. The examples below illustrate the advantage of this approach. They both estimate the vapor pressure at 85C of 2-Hexanol. The literature value for this property is 11.466 kPa.
The code to the left create two entities: A) entity A is assigned a value for its molecular structure using a SMILES string; B) entity B is assigned a value for its molecular structure using a SMILES string AND a literature value for its normal boiling point.
The vapor pressure at 85C is estimated for both entity A and entity B. The Ambrose + Walton Method is used for both estimations. This technique depends upon the normal boiling point. Thus, the boiling point for entity A is estimated while the boiling point for entity B is taken from the cached value.
The estimated vapor pressure for entity B, the chemical with the cached (known) boiling point, is much closer to the literature value. You can use data caching in this manner to take advantage of whatever data you have on your unknown chemicals and mixtures.
The code to the left create two entities: A) entity A is assigned a value for its molecular structure using a SMILES string; B) entity B is assigned a value for its molecular structure using a SMILES string AND a literature value for its normal boiling point.
The vapor pressure at 85C is estimated for both entity A and entity B. The Ambrose + Walton Method is used for both estimations. This technique depends upon the normal boiling point. Thus, the boiling point for entity A is estimated while the boiling point for entity B is taken from the cached value.
The estimated vapor pressure for entity B, the chemical with the cached (known) boiling point, is much closer to the literature value. You can use data caching in this manner to take advantage of whatever data you have on your unknown chemicals and mixtures.
The code to the left create two entities: A) entity A is assigned a value for its molecular structure using a SMILES string; B) entity B is assigned a value for its molecular structure using a SMILES string AND a literature value for its normal boiling point.
The vapor pressure at 85C is estimated for both entity A and entity B. The Ambrose + Walton Method is used for both estimations. This technique depends upon the normal boiling point. Thus, the boiling point for entity A is estimated while the boiling point for entity B is taken from the cached value.
The estimated vapor pressure for entity B, the chemical with the cached (known) boiling point, is much closer to the literature value. You can use data caching in this manner to take advantage of whatever data you have on your unknown chemicals and mixtures.
The code to the left creates a request that returns liquid density data for the mixture '1‑Butanol + 1‑Hexene'. Each returned datum contains a value, a temperature, a pressure, and compositions all in their original units.
The code then displays values for the first datum in original units and after being converted into different units.
The code to the left creates a request that returns liquid density data for the mixture '1‑Butanol + 1‑Hexene'. Each returned datum contains a value, a temperature, a pressure, and compositions all in their original units.
The code then displays values for the first datum in original units and after being converted into different units.
The code to the left creates a request that returns liquid density data for the mixture '1‑Butanol + 1‑Hexene'. Each returned datum contains a value, a temperature, a pressure, and compositions all in their original units.
The code then displays values for the first datum in original units and after being converted into different units.
Topic | Description |
---|---|
Getting Started using Cranium | provides a quick tour of Cranium's capabilities including physical property estimation and a discussion of structure editing. |
Getting Started using Synapse | provides a quick tour of Synapse's capabilities including examples of chemical product design. |