ファセット
ロケーションまたは時間のファセットを概念に追加して、ルール内でこの概念をロケーションまたは時間として使用することができます。例えば、概念にロケーションのファセットを追加し、空間的推論に適用するルールでこの概念を使用することができます。
ルールでは、概念はファセットで定義されたタイプの役割を取ります。ユーザーは、このタイプに関連する演算子を使用できます。
ファセットを定義するには、次の構文を使用します。
<a concept> has <an attribute> used as the default <facet>.
イベントは、タイプ date and time の組み込みファセットを持ちます。ルールでは、イベントを直接参照することで、時間の演算子を使用できます。 例えば、'the flight event' is at the same time as the departure time of 'the flight' は、the timestamp of 'the flight event' is at the same time as the departure time of 'the flight' と同じです。
ロケーション・ファセットの例
次の例では、flight エンティティーで point タイプのファセットが定義されているため、このエンティティーはロケーション対応のオブジェクトです。
a flight has a position used as the default point.
ルールでは、以下のステートメントを記述することができます。 the position of the flight と明示的に指定せずに概念を参照することができます。 the position of 'the flight' と記述する代わりに、'the flight' とだけ記述します。
if
the distance between 'the flight' and the location of the arrival airport of 'the flight' in kilometers equals 0
then
print "Airplane at arrival airport"
flight エンティティーはロケーションとして解釈され、 このロケーション・タイプに固有の演算子をルールで使用することができます。
日付ファセットの例
次の例で、 flight は、タイプ duration のファセットが設定された planned duration を持ちます。
a flight has a planned duration used as the default duration.
'the flight' を duration として処理する次のルールを記述することができます。
when a flight delayed event occurs
if
'the flight' is longer than the duration of the last period of 'the flight'
then
print "Long flight expected" ;