The Expression Ontology
type: Ontology
version IRI: https://ontology.flandersmake.be/expression/ontology/1.0.1
abstract: An Expression is a resource that associates a value to a list of operand values. Complex expressions specify an operator and a list of operand terms. For a complex expression defined by an operator and a list of terms, the value associated with the expression is obtained by 1) evaluating the value associated with the operands to every term and 2) by applying the operator to the set of values obtained this way.
description: The Expression Ontology allows to describe numerical expressions in rdf. The following concepts are formalized: - **Operator** - is a predicate, associating a value to a list of values, the operands - **Built-in** - is an Operator provided by the rule language (e.g. `math:sum`) - **Expression**: - is a resource, identified by an IRI - is an Operator like other built-in's - is specified with the Expression ontology - by an Operator and an ExpressionTerms - so only with statements, without new rule - **ExpressionTerms**: - provides a list of Terms for the Expression - defining the set of operands provided to the Operator - **Terms**: - is a list of Terms - **Term** - a Term of an Expression specifies an operand for the Operator of the Expression - the following Term types are provided - literals - implicitly for Datatype - explicitly with **RawValue** - parameters of the Expression - subexpressions ```mermaid classDiagram class Operator class Expression Operator <|-- Expression class BuiltIn:::owl class List:::owl class Datatype:::owl Operator <|-- BuiltIn Expression --> "1" ExpressionTerms : terms ExpressionTerms <|-- Terms List <|-- Terms ExpressionTerms <-- AllParams: type Terms --> "0..*" Term : member class Term { +Number eval(operands) } Term <-- Param0: type Term <-- Param1: type class Param { +Integer param } class RawValue { rawValue } Expression --> "1" Operator : operator Term <|-- Param Term <|-- RawValue Term <|-- Datatype Term <|-- Expression classDef default fill:#f96,color:black classDef owl fill:#e9edc9,color:black ```
created: 2025-10-10
issued: 2025-10-10
modified: 2026-03-18
preferred namespace prefix: expr
preferred namespace uri: https://ontology.flandersmake.be/expression/ontology#
comment: An ontology for numerical expressions
version info: 1.0.1
introduction: The Expression ontology is a vocabulary for describing symbolic expressions, composed of operators, operands, parameters. An expression can be evaluated to a value, when all its parameters have received a value. The Expression ontology allows to define new functions, without the usage of rules. Such expression will then be usable with any rule language, provided that the semantics of the expression ontology is implemented in the targeted rule language.

operator
type: ObjectProperty
domain: Expression
range: Operator
comment: The operator of the expression

subTerms
type: ObjectProperty
domain: Expression
range: Terms
comment: Any list of subterms of the Expression (from an arbitrary Term to then end), empty list included

terms
type: ObjectProperty
sub property of: subTerms
domain: Expression
range: ExpressionTerms
comment: Provides Terms to the Expression (functional)

Expression
type: Class
subclass of: Operator
subclass of: Operand
comment: An Expression is an Operator, specified by an (other) Operator and a set of Terms, that produce a value for a set of operands by first evaluating every term and second by applying the (other) operator. An Expression is a also a Term, so can be reused in a outter Expression

Operator
type: Class
comment: An Operator is a predicate stating that the object value is the result of applying the operator to the subject list of operands

Param
type: Class
subclass of: Operand
comment: A Param is a Term that returns the value of some operand

RawValue
type: Class
subclass of: Operand
comment: A RawValue is a Term that returns the raw value associated to it

Operand
type: Class
comment: A term in an Expression, that will be first evaluated, and whose result will be passed to the Operator

Terms
type: Class
subclass of: List
subclass of: ExpressionTerms
comment: A list of Terms

allParams
type: NamedIndividual
type: ExpressionTerms
comment: Evaluates to the list of Params