Skip to content

Preface

apath1 is a language for processing hierarchical structures (for now json). It follows the principles of xpath/xslt and aims at having one language for

  • Selection
  • Construction & Transformation
  • Constraints

Simple selections as well as complex and re-usable expressions can be defined. Variables enable the reuse of existing values, whereas so-called step functions support reuse of expressions and the building of custom language elements.

The concrete and abstract syntax are well-defined, using Parsing Expression Grammars and Algebraic Data Types, respectively. Implementation is based on compilation (for now to JavaScript) instead of interpretation (of the abstract syntax tree), that ensures performant execution and can be adapted to support other target languages. Specification and development are in progress, so every feature described here will be implemented step by step.2

Those who want to start playing right away can visit the workbench.

Remark on Constraints

In addition to the functionality of a selection and transformation language, it is planned to offer language elements for logical constraints.

Logical constraints will enable consistency checks for objects as well as rule definitions for derived values.

Remark on Formalism

For now, due to the fact that apath is foremost targeted at practitioners, an formalization is pending. Nevertheless, a formalization with denotational semantics will be given in future that is primarily oriented towards

enhanced by predicate logic based formalization of constraints. For the time being, a semi-formal description can be found in the evaluation section.


  1. Although the name suggests a path language, it is designed for complex transformations oriented towards xslt and general term transformations as well as logical constraints. ↩

  2. A first version of apath - with similar syntax - was created in April 2016, targeted at java (with AST interpretation) and used in real-life projects. Considerations for improvement and extensions led to the present version. ↩