패싯
개념에 위치 및 시간 패싯을 추가하여 이 개념을 위치 또는 규칙의 시간으로 사용할 수 있습니다. 예를 들어 개념에 위치 패싯을 추가하고 공간 추론에 적용되는 규칙에서 이 개념을 사용할 수 있습니다.
규칙에서 개념은 패싯에 정의된 유형의 역할을 수행하고, 이 유형과 연관된 연산자를 사용할 수 있습니다.
패싯을 정의하려면 다음 구문을 사용하십시오.
<a concept> has <an attribute> used as the default <facet>.
이벤트에는 날짜 및 시간 유형의 내장 패싯이 있습니다. 규칙에서는 이벤트를 직접 참조하여 시간 연산자를 사용할 수 있습니다. 예를 들어, '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 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 엔티티는 위치로 해석되며, 규칙에서 이 위치 유형에 특정한 연산자를 사용할 수 있습니다.
날짜 패싯의 예
다음 예제에서 항공편은 duration 유형의 패싯이 있는 계획 기간을 가집니다.
a flight has a planned duration used as the default duration.
'the flight'가 기간으로 처리되는 다음 규칙을 쓸 수 있습니다.
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" ;