Writing a query with no parameters

All connectors contain at least one service that retrieves information from an external source. By starting with a service that runs a simple query, you can focus on aspects such as the REST endpoint implementations and data structures that are common to all services.

As you create a connector to an external source, writing a query that does not require parameters makes early testing and development easier. Not only does it simplify the connector, but also it simplifies running the query from the client.

No fixed set of steps for retrieving data from external data sources exists, but some of your choices can make later tasks easier. Whatever the source, your initial aim is to generate a small set of representative data.
  • If the source allows it, begin by writing a tightly bound query. Or, if your source comprises one or more text files, try to abbreviate them.
    At the start of the process, large volumes of data can be distracting.
  • If you can, make the query retrieve data for entities and links.
    Creating the data structures that represent linked entities is an important part of connector development.
  • Try to generate a data set that has most of the types that the external source contains.
    No matter how complex your queries eventually become, the code to process data into the right shape for i2® Analyze is unlikely to change.

When you implement an acquire endpoint, you can call the query that you developed here directly from that code. Alternatively, during development, you might decide to run the query now, and save the results in a file.