跳转至

Interfaces(接口(Interfaces))

An interface is an Ontology type that describes the shape of an object type and its capabilities. Interfaces allow for consistent modeling of and interaction with object types that share a common shape. For example, a Facility interface may include Facility Name and Location properties. Facility could be implemented by object types such as Airport, Manufacturing Plant, or Maintenance Hangar, which could each contain additional type-specific properties.

An example of a <code>Facility</code> interface.

By using the Facility interface, workflows can interact with Airport, Manufacturing Plant, and Maintenance Hangar object types, either in aggregate or independently, without needing to know specific details about those object types. Additionally, if new object types that implement the Facility interface are introduced, the workflow will be immediately compatible with the new object types without additional refactors.

Review the current levels of support to learn more about where you can use interfaces in the platform.

Interface features

An interface is composed of interface properties, link type constraints, action type constraints, and metadata about the interface. Interface properties can be defined locally on the interface (recommended) or using shared properties. An interface can be implemented by multiple object types.

Much like interfaces in programming languages, you can extend an interface to create a child interface that inherits the properties of the original interface, then add new, more specific properties to the child interface. Object types can then implement the interface to indicate that they conform to the interface definition. Object types can implement multiple interfaces, for use in different workflows. Interfaces can also extend multiple other interfaces, including interfaces that themselves extend other interfaces, resulting in properties that are inherited through layers of interfaces.

Differences between interfaces and object types

There are both functional and stylistic differences between interfaces and object types within the Ontology.

Object types are concrete; they have schemas defined by shared or local properties, are backed by datasets containing property values, and can be instantiated as objects.

By contrast, interfaces are abstract; they have schemas defined by interface properties, are not backed by datasets, and cannot be instantiated directly but must be instantiated as a specific object type.

Stylistically, interfaces are visually distinguished from object types in the platform by having dashed lines around their icons.

Example interface icon

Interface permissions

Interfaces are permissioned through Ontology roles.

Current levels of support

As support for interface Ontology types expands, availability will vary across the Palantir platform.

Interfaces are currently supported in the following applications and services:

Interfaces are partially supported in the following applications and services:

  • Actions: Define actions to create, modify, delete, or link objects implementing an interface. Interface action type constraints are in beta and can be used to define expected action capabilities across object types implementing an interface.
  • Object Set Service: Search and sort objects by interfaces. Support for aggregating by interfaces is in development. Support for interface link types is in development.
  • Ontology SDK: Use interfaces as an API layer for interacting with implementing object types. Support varies by language; TypeScript is currently supported and support for Java and Python is in development.

Interfaces are under active development, but not yet supported in the following:

Get started with interfaces

To add interfaces to your Ontology, you can create new interfaces or extend existing ones. Once you have an interface, you can then implement that interface with an object type of the appropriate shape or edit it to better fit your Organization as your Ontology evolves.


中文翻译


接口(Interfaces)

接口是一种本体(Ontology)类型,用于描述对象类型(object type)的结构及其能力。接口允许对具有共同结构的对象类型进行一致的建模和交互。例如,一个设施(Facility)接口可能包含设施名称(Facility Name)位置(Location)属性。设施接口可由机场(Airport)制造工厂(Manufacturing Plant)维修机库(Maintenance Hangar)等对象类型实现,这些对象类型各自还可包含额外的类型专属属性。

<code>设施</code>接口示例

通过使用设施接口,工作流可以聚合或独立地与机场制造工厂维修机库对象类型交互,而无需了解这些对象类型的具体细节。此外,如果引入了实现设施接口的新对象类型,工作流将立即兼容这些新类型,无需额外重构。

请查看当前支持级别,了解在平台中何处可以使用接口。

接口特性

接口由接口属性(interface properties)、链接类型约束(link type constraints)操作类型约束(action type constraints)以及关于接口的元数据(metadata)组成。接口属性可以在接口上本地定义(推荐),或使用共享属性(shared properties)定义。一个接口可由多个对象类型实现。

与编程语言中的接口类似,您可以扩展接口(extend an interface)以创建子接口,该子接口继承原始接口的属性,然后向子接口添加新的、更具体的属性。对象类型随后可以实现接口(implement the interface),表明它们符合接口定义。对象类型可以实现多个接口,用于不同的工作流。接口也可以扩展多个其他接口,包括那些本身扩展了其他接口的接口,从而产生通过多层接口继承的属性。

接口与对象类型的区别

在本体中,接口与对象类型之间存在功能性和风格上的差异。

对象类型是具体的;它们具有由共享或本地属性定义的架构,由包含属性值的数据集(datasets)支持,并且可以实例化为对象。

相比之下,接口是抽象的;它们具有由接口属性定义的架构,不由数据集支持,不能直接实例化,而必须实例化为特定的对象类型。

在风格上,平台中接口的图标周围带有虚线边框,从而与对象类型在视觉上区分开来。

接口图标示例

接口权限

接口通过本体角色(Ontology roles)进行权限管理。

当前支持级别

随着对接口本体类型支持的扩展,其在 Palantir 平台中的可用性将有所不同。

接口目前在以下应用程序和服务中得到支持:

接口在以下应用程序和服务中得到部分支持:

  • 操作(Actions): 定义操作以创建、修改、删除或链接实现接口的对象。接口操作类型约束处于测试阶段,可用于定义实现接口的对象类型之间的预期操作能力。
  • 对象集服务(Object Set Service): 按接口搜索和排序对象。按接口聚合的支持正在开发中。接口链接类型的支持正在开发中。
  • 本体 SDK(Ontology SDK): 将接口用作与实现对象类型交互的 API 层。支持因语言而异;目前支持 TypeScript,Java 和 Python 的支持正在开发中。

接口正在积极开发中,但以下功能尚不支持:

开始使用接口

要向本体添加接口,您可以创建新接口或扩展现有接口。拥有接口后,您可以使用适当结构的对象类型实现该接口,或编辑接口以更好地适应您的组织,随着本体的演变而调整。