Unit

Palantir Defense Ontology

[Palantir Defense Ontology] Represents the entity that owns and is responsible for materiel and the relationship between organizations and their chain of command. An object type that implements this interface would be, for example, a Unit.

Properties

Unit Id
string

[Palantir Defense Ontology] String used to uniquely identify a unit.

Unit Name
string

[Palantir Defense Ontology] Captures the name of a unit.

Unit Type Id
string

[Palantir Defense Ontology] Uniquely identifies a unit type.

Source System Ids
list<item>

[Palantir Defense Ontology] A list of source system ids from which a data point derives

Service
string

[Palantir Defense Ontology] Identifies the military branch of a friendly or enemy unit.

Echelon
string
optional

[Palantir Defense Ontology] Identifies the echelon of a unit, such as BRIGADE or CORPS.

SIDC
string
optional

[Palantir Defense Ontology] A Symbol Identification Code is an alphanumeric identifier that uniquely identifies and displays a military symbol. Its format depends on the standard used, such as MIL-STD 2525C or MIL-STD 2525D.

Unit Affiliation
string
optional

[Palantir Defense Ontology] Describes the affiliation of the unit such as HOSTILE or FRIENDLY

[DEPRECATED] Country
string
optional

[DEPRECATED] [Palantir Defense Ontology] Use Allegiance instead. Country name displayed as a string.

Unit Allegiance
string
optional

[Palantir Defense Ontology] Captures the country of allegiance for the unit.

One To Many
optional

[Palantir Defense Ontology] Units have a many-to-many relationship to other units, represented by a link to a unitHierarchyLink object.

One To One
optional

[Palantir Defense Ontology] A unit can have one unit type.

Unit to Source System Metadata
One To Many
optional

[Palantir Defense Ontology] A unit can be derived from multiple source systems.

[DEPRECATED] Unit plans
One To Many
optional

[Palantir Defense Ontology] The plans that a unit is responsible for.

[DEPRECATED] Unit tasks
One To Many
optional

[Palantir Defense Ontology] That tasks a unit is assigned to.

One To Many
optional

[Palantir Defense Ontology] Links a unit to its many materiel requirements.

One To Many
optional

[Palantir Defense Ontology] Links a unit to its many materiel change events.

One To Many
optional

[Palantir Defense Ontology] Links a unit to its many materiel status events.

One To Many
optional

[Palantir Defense Ontology] Links a unit to the equipment it owns.

One To Many
optional

[Palantir Defense Ontology] Links a unit to the supply locations it manages.

Code snippets

TypeScript

Load all Unit

Copied!
1 2 3 4 5 6 7 8 9 10 11 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; import type { Osdk } from "@osdk/client"; const interfaces: Osdk<com.palantir.defense.ontology.Unit>[] = []; for await(const int of client(com.palantir.defense.ontology.Unit).asyncIter()) { interfaces.push(int); } const interface1 = interfaces[0];

Load Unit metadata

Copied!
1 2 3 4 5 6 7 8 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; const interfaceTypeMetadata = await client.fetchMetadata(com.palantir.defense.ontology.Unit); const implementingObjectTypes = interfaceTypeMetadata.implementedBy; const interfaceRid = interfaceTypeMetadata.rid;

Filtering

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; import { isOk, type Osdk, type PageResult, type Result } from "@osdk/client"; const page: Result<PageResult<Osdk<com.palantir.defense.ontology.Unit>>> = await client(com.palantir.defense.ontology.Unit) .where({ $and:[ { $not: { someProperty: { $isNull: true }}}, { someProperty: { $eq: "foo" }} ] }) .fetchPageWithErrors({ $pageSize: 30 }); if (isOk(page)) { const interfaces = page.value.data; const interface1 = interfaces[0]; }

Subscribe to object sets

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; // A map of primary keys to objects loaded through the SDK const objects: { [key: string]: com.palantir.defense.ontology.Unit.OsdkInstance } = ... const subscription = client(com.palantir.defense.ontology.Unit).subscribe( { onChange(update) { if (update.state === "ADDED_OR_UPDATED") { // An object has received an update or an object was added to the object set const currentObject = objects[update.object.$primaryKey]; if (currentObject !== undefined) { currentObject["<propertyName>"] = update.object["<propertyName>"] ?? currentObject["<propertyName>"]; } } else if (update.state === "REMOVED") { // The object was removed from the object set, which could mean it was deleted or no longer meets the filter criteria delete objects[update.object.$primaryKey]; } }, onSuccessfulSubscription() { // The subscription was successful and you can expect to receive updates }, onError(err) { // There was an error with the subscription and you will not receive any more updates console.error(err); }, onOutOfDate() { // We could not keep track of all changes. Please reload the objects in your set. }, }, { properties: [ "com.palantir.defense.ontology.unitId", "com.palantir.defense.ontology.unitName", "com.palantir.defense.ontology.unitTypeId", "com.palantir.defense.ontology.sourceSystemIds", "com.palantir.defense.ontology.service", "com.palantir.defense.ontology.echelon", "com.palantir.defense.ontology.sidc", "com.palantir.defense.ontology.unitAffiliation", "com.palantir.defense.ontology.country", "com.palantir.defense.ontology.unitAllegiance", ]} ); subscription.unsubscribe();

Load ordered Unit

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; import { isOk, type Osdk, type PageResult, type Result } from "@osdk/client"; const page: Result<PageResult<Osdk<com.palantir.defense.ontology.Unit>>> = await client(com.palantir.defense.ontology.Unit) .fetchPageWithErrors({ $orderBy: {"someProperty": "asc"}, $pageSize: 30 }); if (isOk(page)) { const interfaces = page.value.data; const interface1 = interfaces[0]; }

Load pages of Unit

Copied!
1 2 3 4 5 6 7 8 9 10 11 import { com.palantir.defense.ontology.Unit } from "@osdk/defense-ontology"; // Edit this import if your client location differs import { client } from "./client"; import { type Osdk, type PageResult, type Result } from "@osdk/client"; const response: Result<PageResult<Osdk<com.palantir.defense.ontology.Unit>>> = await client(com.palantir.defense.ontology.Unit).fetchPageWithErrors({ $pageSize: 30 }); // To fetch a page without a result wrapper, use fetchPage instead const responseNoErrorWrapper: PageResult<Osdk<com.palantir.defense.ontology.Unit>> = await client(com.palantir.defense.ontology.Unit).fetchPage({ $pageSize: 30 });