Annotations

Annotations are special facts that allow to inject specific behaviors into Vadalog programs. They can be stand-alone, rule level or fact level.

Stand-alone annotations adopt the following syntax: @annotationName(p1, …​, pn).

Rule-level annotations adopt the following syntax: @annotationName(p1, …​, pn) a(X) :- b(X,Y),c(Y).

Multiple rule-level annotations are also supported: @annotationName1(p1, …​, pm) @annotationName2(p1, …​, pn) a(X) :- b(X,Y),c(Y).

The fact-level annotations adopt the following syntax: @annotationName(p1, …​, pn) myFact(1,2,"a").

Multiple fact-level annotations are also supported: @annotationName(p1, …​, pn) @annotationName2(p1, …​, pm) myFact(1,2,"a").

They are all prefixed and whitespace-separated (comma "," denotes conjunction and should not be used here).

In all the syntaxes above, annotationName indicates the specific annotation and each of them accepts a specific list of parameters. In the following sections we present the supported annotations.

Complete Annotation List

Table 1. General annotations

@bind

specifies the data source to bind for input/output Bindings

@delete

specifies what data to deletes from the data source Bindings

@executionMode

when @executionMode("distributed"), changes the execution modality to Distributed and Parallel (DP) Reasoning (@executionMode("streaming") for streaming, the default)

@include

includes a module

@input

specifies the input predicates

@implement

includes external implementation

@library

library import

@mapping

maps the data source to predicate terms and vice versa Bindings

@module

declares of a module

@output

specifies the output predicates

@post

post-processing annotation

@qbind

specifies the query to bind for input/output Bindings

@relaxedSafety

relaxed safety

@saveChaseGraph

saves the chase graph; see Chase Graph File Creation

@update

specifies how to update the data source Bindings

Table 2. Temporal annotations

@config

To configure merge strategies and merge node placement strategy

@temporalMapping

The mapping annotation for temporal interval elements from / to a source

@temporalMappings

A single mapping annotation for all elements of a temporal interval (left boundary bracket, left endpoint, right endpoint, right boundary bracket )

@temporalType

To define the data type for temporal data (Integer, Double, Date…​)

@timeGranularity

To define the time granularity (days, months, hours…​) for the program

@temporal

To define the temporal window for reasoning

@temporalAtom

To define the time granularity (days, months, hours…​) for the program