This content is also available at learn.palantir.com ↗ and is presented here for accessibility purposes.
You will need to explicitly import your object types into your code repository before you can write functions against them. In this tutorial, you’ll be writing functions exclusively on your flight alert object type. This task will walk you through the process of importing the object type into your project.
Click the Settings menu item along the top of your application screen. Hint: it may be grouped under the More ▾
dropdown item.
From the left-hand menu, click Ontology.
Type the name of your Flight Alert object (e.g., [yourName] Flight Alert
) into the Filter object types search bar in the Ontology Imports window.
When your object type comes up in the search, copy the API name in the middle column (e.g., yourNameFlightAlert
) to your clipboard.
Click the ➕
sign to the right of your API name to import your object type into your project.
Click the blue Save button in the bottom right of the window.
Later, you’ll be referencing the passengers, flight alert ⟷ flight and flight ⟷ delays types, so let’s add them to your project, too.
[Example Data] Flight
, and add it by clicking the ➕
button.Do the same for the links between [Example Data] Flight
and [Example Data] Delays
and between your flight alert object and [Example Data] Passenger
using the same steps as above, remembering to click Save on completion.
When the screen reloads, return to the Code tab and open the ../src/index.ts
file (i.e., not in the __tests__
folder).
In the import
statement on line 2, add in the API name you copied from the Ontology settings page into the empty curly braces. In this sample replace JmeierFlightAlert
with your API: import { JmeierFlightAlert } from "@foundry/ontology-api";
If you need any assistance with the tasks above, consult this short description of the Ontology type importing process. Note particularly that you can ctrl + select
on the @foundry/ontology-api
package name to learn what Ontology types are available in your repository. If you do not see your API name in the list, check that it was properly imported in the Settings > Ontology section of your repo. If it is still not showing up, restart Code Assist and/or refresh your browser.