Interface Builtin

All Known Subinterfaces:
Aggregation, Connector, DirectFilterBuiltin, FilterBuiltin, FunctionalBuiltin, RelationalBuiltin
All Known Implementing Classes:
AbstractAggregation, AbstractConnector, Alarm, Assert, Assign, BooleanExpression, Builtins1, Builtins2, BuiltinsTest.SuperSimpleBuiltin, CachedConnector, ClassFunctionBuiltin, Code, CollatingCompose, ComparisonBuiltin, ComparisonBuiltin2, ComparisonBuiltinNew, Compose, Compose, Compose, ConcatMany, ConstraintException, ContainsSequence, ContainsSequence2, ContainsSimilar, Cosine2, Cosine3, Count, CountEventsInTime, CountUnique, CreateCircle, CreateCircleWithDistanceUnit, CreateJsonID, CreatePoint, CreatePolygon, CreatePolygon, CreatePolygon2, CreatePolygonFromPoints, Currency, Damerau, Day, Different, DirectBetween, DirectLess, DirectLessOrEqual, Enumerate, Equal, Equals, ExceptionBuiltin, False, FilterA, FilterB, FilterExpression, Formatter, FuzzySearch, GeoSearch, Hamming, In, Increment, Increment, IncrementalFactsBuiltin, INGBuiltin, InstanceFilterBuiltin, InstanceFunctionBuiltin, IsAlive, IsCalendar, IsDouble, IsEqual, IsEqualSet, IsFloat, IsJsonId, IsJsonTopId, IsList, IsNotEqual, IsNotFunctional2, IsNotFunctional3, IsNumber, IsReasoning, IsSet, IsString, IsString, IsSubset, IsType, Jaccard, JaroWinkler, JaroWinkler, JaroWinklerSimilarityBuiltin, JsonIdToString, Letters, Levenshtein, Levenshtein, ListenToPort, ListenToPortSingleValue, LongestCommonSubsequence, MatchBuiltin, MathExpression, Max, Mean, Mean, Min, MoneyTransfer, Month, NGram, NGram3, NGram4, NoneOf, Now, OldSimiliarityBuiltIn, OneOf, Optimal, OptimizedContainsSequence, ParsePoint, PerformanceTest0.ContainsSequence, PerformanceTest0.ContainsWord, PointX, PointY, Predicates, Print, PrintOut, PrintToFile, QGram3, QGram4, Query, RandomBoolean, RandomDuration, RandomEnumeration, RandomInteger, RaspiGpioOut, RaspiGpioOut, ReasonerConnector, ReasonerQuery, RegularExpression, RegularExpression, Retract, Seek, Seek3, Seek4, Seek5, SeekAnd, Select, SelectOne, SendMail, SendMail2, SensorBuiltin, SensorBuiltinSingleValue, Set, SimilarityBuiltin, SimilarityBuiltIn, Sorensondice, SQLiteConnector, Sqrt, Sqrt, StartsWithOneOf, StockPrice, String2Number, SubJsonId, Substitute, Sum, Sum, Sum, SWIFT32a, TestMultiRelational, TestMultiRelationalCached, Text, TextSearch2, TextSearch3, Ticks, Time2MilliSeconds, TimeRaster, ToCSV, ToJSON, Tolerance, ToString, ToType, True, Variance, WeatherBuiltin, WeatherForecast, Week, Window, Year

public interface Builtin
Interface for all built-ins Built-ins may be seen as relations which are computed
by an algorithm.
Author:
angele
  • Method Details

    • isEvaluable

      boolean isEvaluable(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException
      is builtin evaluable with a certain instantiation of variables
      Parameters:
      grounds - , which arguments are ground
      variableInstantiations - , which variables are instantiated
      args - , the arguments
      Returns:
      was it evaluable
      Throws:
      BuiltinException
    • init

      initialize the builtin
      Parameters:
      args - , the builtin arguments
      Throws:
      InterruptedException
      IOException
      SemReasonerException
    • evaluationFinished

      void evaluationFinished() throws BuiltinException, InterruptedException
      call back function. Is called when the whole evaluation has been finished
      Throws:
      BuiltinException
      InterruptedException
    • setSymbolTable

      void setSymbolTable(SymbolTable symbolTable)
      set the symbol table
      Parameters:
      symbolTable - , the symbol table
    • setProperties

      void setProperties(Properties prp)
      set the sytem properties
      Parameters:
      prp - , properties
    • getWeight

      long getWeight(BitSet grounds, BitSet variableInstantiations, Object[] args)
      the weight of the builtin. Determines when the builtin is executed in a rule
      Parameters:
      grounds - , ground arguments
      variableInstantiations - , instantiated variables
      args - , arguments of the builtin
      Returns:
      the weight of the builtin (influences the position in the rule)
    • objectGeneratingArguments

      BitSet objectGeneratingArguments(BitSet grounds, BitSet variableInstantiations, Object[] args) throws BuiltinException
      In which argument position are new objects created
      Parameters:
      grounds - , ground argument positions
      variableInstantiations - , instantiated variables
      args - , arguments of the literal
      Returns:
      each bit indicates the argument position where new objects are created
      Throws:
      BuiltinException
    • getName

      String getName()
      get the name of the builtin
      Returns:
      the name of the built-in
    • getArity

      int getArity()
      get the arity of the builtin
      Returns:
      the arity of the built-in
    • getType

      BuiltinType getType()
      get the type of the builtin
      Returns:
      the type of the built-in
    • isInternal

      boolean isInternal()
      is it a builtin for internal use only
      Returns:
    • getArgumentDescriptions

      String[] getArgumentDescriptions()
      get descriptions for the different arguments
      Returns:
      a description of the arguments of the built-in
    • getDescription

      String getDescription()
      get a description for the builtin
      Returns:
      a description of the built-in
    • readsSymbolTable

      boolean readsSymbolTable()
      does the builtin read the symbol table
      Returns:
      true if it reads the symbol table
    • writesSymbolTable

      boolean writesSymbolTable()
      does the builtin write into the symbol table
      Returns:
      true if it writes to the symbol table
    • cloneBuiltin

      Builtin cloneBuiltin()
      clone the builtin
      Returns:
      the cloned built-in
    • clear

      void clear()
      frees up allocated resources