Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

September 5, 2011

Ontopia now supports numbers in tolog

Filed under: Ontopia,tolog — Patrick Durusau @ 7:28 pm

Ontopia now supports numbers in tolog

Peter-Paul Kruijsen announces support for numbers in tolog:

Over the past years Ontopia was not able to work with numbers. Sorting e.g. a list of occurrence values could result in ‘123’, ’45’, ‘6’, ’78’. For one of our customers, we needed an implementation that would sort these as ‘6’, ’45’, ’78’, ‘123’, as well as an implementation for adding, subtracting, multiplying and diving numbers.

I have just committed NumbersModule to Ontopia [1]. It will be available in the upcoming 5.2.0 release. With this addition, tolog queries can now work with numbers. It supports these predicates:

  • value(string, result): Parses a string (e.g. an occurrence value) into a number. Pattern and locale are optional, e.g. to parse ‘€ 5.026,34’ for us Europeans
  • format(number, result): Formats a number into a string. Pattern and locale are optional, e.g. to format a number as ‘42.6 %’.
  • absolute(result, number): Calculates the absolute value of a number.
  • add(result, number, number): Adds numbers. Providing more than 2 input values is allowed.
  • subtract(result, number, number): Subtracts numbers. Providing more than 2 input values is allowed.
  • multiply(result, number, number): Multiplies numbers. Providing more than 2 input values is allowed.
  • divide(result, number, number): Divides numbers. Providing more than 2 input values is allowed.
  • min(result, number, number): Calculates the minimum value. Providing more than 2 input values is allowed.
  • max(result, number, number): Calculates the maximum value. Providing more than 2 input values is allowed.

….

[1]: http://code.google.com/p/ontopia/source/detail?r=2182

See the post for full details.

Thanks Peter-Paul!

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress