DOCUMENTATION

  • AIMMS optimization tooling introduction
    • AIMMS Developer & Deployment Platform
    • Comparison with other tools
    • Technical Specifications
    • Solvers
      • Solvers availability
      • Advanced Algorithms for Mathematical Programs
      • AIMMS Outer Approximation (AOA)
      • BARON
      • CBC
      • CONOPT
      • COPT
      • CP Optimizer
      • CPLEX
      • Gurobi
      • IPOPT
      • Knitro
      • MINOS
      • Octeract
      • ODH-CPLEX
      • PATH
      • SNOPT
    • Mathematical Programming
      • Mathematical Programming
      • Linear Programming
      • Mixed Integer Programming
      • Nonlinear Programming
      • Mixed Integer Nonlinear Programming
      • Constraint Programming
      • Other Mathematical Programming Types
  • Function Reference
  • User's Guide
  • Language Reference
  • Modeling Guide
  • webui
  • PRO Platform
    • Introduction to the AIMMS PRO Platform
    • Installation
      • System Requirements
      • Installation and Configuration of the License Server
      • General Architecture
      • Installation of AIMMS PRO on Windows
    • The AIMMS PRO Configurator
      • Configuring the configurator
      • Various sections of the configurator
      • Setting up an AIMMS PRO Cluster
      • Server-side Logging
    • Server Administration
      • AIMMS Application Management
      • AIMMS Version Management
      • User Management
      • Monitoring
      • Configuration
        • AD Settings
        • Retention Settings
        • Portal Customization
        • Tunnels
        • Queue Priorities
        • Log Management
        • Active Data Sessions
        • Seats Management
      • Linking Environments to Active Directory Domains
        • Link to Active Directory for AD Member Servers
        • Link to Active Directory for Non-AD Member Servers
      • SAML Support
      • Tunneling support
      • Commonly Encountered Errors
      • Miscellaneous
    • AIMMS PRO End-User Portal
    • MFA for AIMMS PRO Portal
    • Project Setup
      • Adding PRO Libraries to your Project
      • Basic AIMMS PRO Workflow
      • Conversion Guidelines
      • AIMMS PRO and Data Management
      • Advanced AIMMS PRO Workflows
        • Determining the Application State to Transfer
        • Advanced Usage of pro::DelegateToServer
        • Communication Between client-side and Server-side Sessions
        • Using Messages in Your PRO Applications
        • The PRO Progress Window
        • Using Solver leases instead of DelegateToServer
      • Debugging PRO-enabled Projects
    • AIMMS PRO Java/C# API
  • Cloud Platform
    • Introduction to AIMMS Cloud Platform
    • General Architecture
    • System Requirements
    • Server Administration
      • AIMMS Application Management
      • Activate AIMMS Version
      • User Management
      • Configuration
        • AD Settings
        • Retention Settings
        • Portal Customization
        • Tunnels
        • Queue Priorities
        • AIMMS Cloud Database and VPN Configuration
        • Active Data Sessions
        • Seats Management
      • Linking Environments to Active Directory Domains
        • Link to Active Directory for AD Member Servers
        • Link to Active Directory for Non-AD Member Servers
      • SAML Support
      • Tunneling support
      • Commonly Encountered Errors
      • Miscellaneous
    • AIMMS PRO End-User Portal
    • MFA for AIMMS PRO Portal
    • Project Setup
      • Adding PRO Libraries to your Project
      • Basic AIMMS PRO Workflow
      • Conversion Guidelines
      • AIMMS PRO and Data Management
      • Advanced AIMMS PRO Workflows
        • Determining the Application State to Transfer
        • Advanced Usage of pro::DelegateToServer
        • Communication Between client-side and Server-side Sessions
        • Using Messages in Your PRO Applications
        • The PRO Progress Window
        • Using Solver leases instead of DelegateToServer
      • Debugging PRO-enabled Projects
    • Gurobi Support on AIMMS Cloud Platform
    • Getting the latest AIMMS Releases on AIMMS Cloud Platform
    • AIMMS PRO REST API
    • Launching Python, R and other services
    • Running Tasks
    • Privacy Statement
    • Managing Sessions
  • Data integration with AIMMS
  • Library Repository
    • Getting Started with AIMMS Library Repositories
    • AIMMSXL Library
      • Using the AIMMSXL Library
      • Example
      • AIMMSXL Documentation
      • AIMMSXL Library Release Notes
    • CDM Library
      • Introduction
      • Installing AIMMS CDM
      • Configuring your model for CDM
      • Dealing with external and derived data
      • Day-to-day CDM operations
      • Callbacks and hooks provided by CDM
      • CDM Authentication and Authorization
      • CDM implementation details
      • Low-level CDM API
      • CDM Library Release Notes
    • Data Exchange Library
      • Using the Data Exchange library for communicating data
      • Data Exchange Mappings
      • Standard Data Exchange formats
      • Application Database
      • Consuming REST APIs
      • Generating API client code from an OpenAPI specification
      • Providing REST APIs
      • Azure Data Lake Storage
      • Data warehouses
      • Methods provided by the Data Exchange library
      • DEX Troubleshooting
      • DataExchange Library Release Notes
    • DataLink Library
      • What is DataLink?
      • The Data Map
      • Read and Write
      • Source Information
      • Data Map Automation
      • Tips and Tricks
      • Providers
      • Examples
      • DataLink Library Release Notes
    • Email Client Library
      • Introduction
      • Email Client API
      • EmailClient Library Release Notes
    • Forecasting Library
      • Introduction
      • Notational Conventions
        • Simple Linear Regression
        • Time Series Forecasting
      • Functions
        • forecasting::ExponentialSmoothing
        • forecasting::ExponentialSmoothingTune
        • forecasting::ExponentialSmoothingTrend
        • forecasting::ExponentialSmoothingTrendTune
        • forecasting::ExponentialSmoothingTrendSeasonality
        • forecasting::ExponentialSmoothingTrendSeasonalityTune
        • forecasting::MovingAverage
        • forecasting::WeightedMovingAverage
        • forecasting::SimpleLinearRegression
    • GuardServerSession Library
      • Introduction
      • Error and Profiling Results as Data
      • The GSS End User interface for end-users
      • The GSS User Interface for specialists
      • The action log
      • Investigate state solver session
      • Integrate GuardServerSession library with your AIMMS Application
      • Install GSS interface for end-users
      • Install UI of GuardServerSession Library
      • Install UI Request manager
      • Install UI Inspect Running Solver Sessions
      • GuardServerSession Library Release Notes
    • HTTP Client Library
      • Introduction
      • What is HTTP?
      • Using the HTTP Client
      • HTTP Client API
      • HTTPClient Library Release Notes
    • RLink Library
      • Setting up RLink
      • Using RLink
      • Iris Example
      • RLink Library Release Notes
    • Snowflake Library
      • Introduction
      • Snowflake API
      • Snowflake Library Release Notes
    • Unit Test Library
      • Creating unit test suites
      • Running test suites
      • Automated testing
      • AIMMSUnitTest Library Release Notes
      • New Features and Bug Fixes
  • Aimms Network License Server
    • Introduction
    • Linux Setup
    • AIMMS Network License Server Release Notes
  • AIMMS Information Security
  • AIMMS Release Notes
  • AIMMS PRO Release Notes
  • AIMMS Product Lifecycle
AIMMS Documentation
AIMMS Logo
  • Documentation »
  • Library Repository »
  • DataLink Library »
  • What is DataLink?
  • Edit on Github
Help & feedback

Table Of Contents
  • What is DataLink?
    • The problem with tables
    • The DataLink solution
    • Installation and setup

What is DataLink?

DataLink is a data importer/exporter library for AIMMS that assumes that the data in the source is organized into tables. With this library we want the AIMMS developer to be able to read and write data from different types of sources using the same approach. This can be difficult because the tables do not contain enough information to be read into AIMMS identifiers.

The problem with tables

A table is a collection of data organized in columns. All columns have a name, which are specified in the header (as convention we will always show header values in bold).

The FirstnameLastname table

firstname

lastname

age

Alice

Smith

40

Bob

Johnson

20

When we look at the “structure” of this table we see that we have 3 columns named firstname, lastname and age. The first two columns have string values and the last column has a numeric value. We can make another table with two string columns and one numerical column.

The NameCity table

fullname

city

age

Alice Smith

Paris

40

Bob Johnson

London

20

Besides the column names there are no differences between these two tables except for the data. But looking at the data and interpreting its meaning, we could see that there is still a difference. In the FirstnameLastname table we need both firstname and lastname otherwise the age would not have any meaning. The age tells us something about a person that is identified in the table with two “keys”, the first name and last name. The NameCity table only needs one key, the full name, and the table gives us two pieces of information related to the corresponding person.

AIMMS being a modeling language, this is exactly the kind of information that is important. In our AIMMS model we do need identifiers that take into account the relations between the columns of the table. We could have in AIMMS the sets S_Firstname with index I_Firstname and S_Lastname with index I_Lastname. Also we could have a parameter P_Age(I_Firstname,I_Lastname). Then we could do the reading, and reading the first table would be doing in AIMMS something like:

S_Firstname += {'Alice'};     ! make sure that 'Alice' is in the set S_Firstname
S_Lastname += {'Smith'};      ! make sure that 'Smith' is in the set S_Lastname
P_Age('Alice','Smith') := 40; ! Assign value 40 to P_Age for 'Alice' and 'Smith'

Here we assign the values Alice and Smith to their sets, but technically we only have to add them if they are not in that set yet. When we are sure we can do the assignment to P_Age.

If we look at the second table we see that it defines only one set and two parameters. Reading the first row is similar of doing:

S_Fullname             += {'Alice Smith'}; ! the set
SP_City('Alice Smith') := "Paris";         ! a string parameter
P_Age2('Alice Smith')  := 40;              ! a parameter

Understanding the structure in the source is not enough for importing and exporting data. We also have to understand the identifiers in the model. Then we can map the columns in the table to the identifiers in the model for reading and writing the data.

The DataLink solution

The solution is to split the task of importing and exporting data into two separate libraries. One library, DataLink, deals with the identifier structure in AIMMS. There is only one DataLink library. The second library, the Provider, deals with the specific type of the data source. For each type of source there is a different provider library.

../_images/datalinksolution.png

An overview of the DataLink solution with left the AIMMS model containing identifiers. Next to it the DataLink library containing the data maps (explained later). Then we see different types of Provider libraries. Depending on the type of provider we see that we can choose different data sources.

We have to make three choices:

Choose a source (1)

The source is data stored on the local machine in a particular format.

Choose a data map (2)

All the data maps in DataLink have names, and we choose a data map by its name.

Choose a provider (3)

This is a library (from the library repository) that “understands” the particular format of the data source.

For reading and writing we always make these three choices and the number between brackets indicate the argument of function dl::DataRead and dl::DataRead. The first two arguments are strings (name of the source and name of the data map), and the third argument is a dl::ReadWriteAttributes that allows us to specify extra argument for reading and writing. It has one mandatory field, the ‘DataProvider’, which must be set to select the provider.

dl::DataRead(
     "InputFile.xlsx",       ! Choose a source (1)
     "TheDataMap",           ! Choose a data map (2)
     ReadWriteAttributes     ! Choose a provider (3)
 );

The ReadWriteAttributes could be defined as:

StringParameter ReadWriteAttributes {
    IndexDomain: dl::rwattr;
    Definition: data{'DataProvider': xlsprov::DataLink };
}

Here we use xlsprov::DataLink as value, where “xlsprov” is the prefix of the XLSProvider library. DataLink needs to know where the executable code of the provider (i.e. the dll file on Windows) is located. To simplify this, all providers make sure that upon initialization a string parameter called DataLink is set with the correct location needed by DataLink. This means that we can choose the provider by using this string parameter of the provider as value for ‘DataProvider’.

Installation and setup

The DataLink and provider libraries are made available in through the AIMMS library repository, and can be installed and added to a model using File > Library Manager… . Then click the button “Add Library from Repository…”. Now we see the Library Repository Browser window. Here we can click on available libraries and read in right pane the details of that library.

You need at least two libraries:

  1. A provider that can handle the type of source you want to read or write. (The details pane in the Library Repository Browser has a “Depends On” property, that tells which version of DataLink it is compatible with)

  2. DataLink (must be compatible with all providers)

Tip

Always choose the provider first! If we choose the provider, the library manager is smart enough to figure out that it needs to install the DataLink library as well. It will automatic install DataLink with the right version (from the “Depends On” field for the provider in the Library Repository Browser).

It is possible to deal with different types of data sources in the same model. This is just a matter of adding the providers for each type that is needed. However, a model can have only one DataLink (version) installed, and so all added providers must depend on that very same DataLink version.

Warning

If you select an extra provider you MUST select a provider that is compatible with the DataLink library already installed. The library manager is not smart enough to figure out what to do when different providers require different versions of DataLink.

Last updated: Nov 25, 2022

Help & Feedback

Docs

Edit this page to fix an error or add an improvement in a pull request
Create an issue to suggest an improvement to this page

Product

Create a topic if there's something you don't like about this feature
Propose functionality by submitting a feature request

Support

Not what you where looking for? Search the docs

Remember we also have Community support

Still having trouble ? Reach out to us


Next Previous

AIMMS
AIMMS COMMUNITY
AIMMS DOCS
DISCLAIMER
PRIVACY STATEMENT
© 1989 - 2025 AIMMS B.V.