Abstract
FunnyQT is a Clojure library supplying a comprehensive set of model querying and transformation services to the user. These are provided as APIs and embedded DSLs. This paper introduces FunnyQT’s embedded graph pattern matching DSL which allows users to define patterns using a convenient textual notation that can be applied to graphs. The result of applying a pattern to a graph is the lazy sequence of all matches of the pattern in the graph. FunnyQT’s pattern matching DSL is quite expressive. It supports positive and negative application conditions, arbitrary constraints, patterns with alternatives, nested patterns, and more. In case a pattern is defined to be evaluated eagerly instead of lazily, the search induced by the pattern is automatically parallelized on multi-core machines for improved performance.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
A keyword is a symbolic identifier which always evaluates to itself. Keywords start with a colon, e.g. :this-is-a-keyword.
- 6.
The order of matches is deterministically defined by the pattern specification and the underlying modeling framework’s allInstances-operation.
- 7.
Edges with an identity which are typed and possibly attributed.
- 8.
This feature is known as amalgamation in some other approaches where there is a kernel rule and multi-rules matched in its context.
- 9.
In analogy to defpattern/letpattern/pattern, there are also macros letrule and rule for defining local and anonymous rules.
- 10.
This implies that a and oa are different, too, because of the composition semantics of the subs reference.
- 11.
doseq is a forall-loop, (:key map) looks up the value associated with :key in the map map, and add-adj!/remove-adj! add/remove elements to/from a given reference.
- 12.
- 13.
References
Arendt, T., Biermann, E., Jurack, S., Krause, C., Taentzer, G.: Henshin: advanced concepts and tools for in-place EMF model transformations. In: Petriu, D.C., Rouquette, N., Haugen, Ø. (eds.) MODELS 2010, Part I. LNCS, vol. 6394, pp. 121–135. Springer, Heidelberg (2010)
Cuadrado, J.S., Molina, J.G., Tortosa, M.M.: RubyTL: a practical, extensible transformation language. In: Rensink, A., Warmer, J. (eds.) ECMDA-FA 2006. LNCS, vol. 4066, pp. 158–172. Springer, Heidelberg (2006)
Eickhoff, C., George, T., Lindel, S., Zündorf, A.: The SDMLib solution to the MovieDB case for TTC2014. In: Rose, L.M., Krause, C., Horn, T. (eds.) Proceedings of the 7th Transformation Tool Contest part of the Software Technologies: Applications and Foundations (STAF 2014). CEUR Workshop Proceedings, vol. 1305. CEUR-WS.org (2014)
Fowler, M.: Domain Specific Languages, 1st edn. Addison-Wesley Professional, Boston (2010)
George, L., Wider, A., Scheidgen, M.: Type-safe model transformation languages as internal DSLs in scala. In: Hu, Z., de Lara, J. (eds.) ICMT 2012. LNCS, vol. 7307, pp. 160–175. Springer, Heidelberg (2012)
Ghamarian, A.H., de Mol, M., Rensink, A., Zambon, E., Zimakova, M.: Modelling and analysis using GROOVE. STTT 14(1), 15–40 (2012)
Hinkel, G., Happe, L.: Using component frameworks for model transformations by an internal DSL. In: Ciccozzi, F., Tivoli, M., Carlson, J. (eds.) Proceedings of the 1st International Workshop on Model-Driven Engineering for Component-Based Software Systems co-located with MODELS 2014. CEUR Workshop Proceedings, vol. 1281, pp. 6–15. CEUR-WS.org (2014)
Horn, T.: Model querying with FunnyQT (extended abstract). In: Duddy, K., Kappel, G. (eds.) ICMB 2013. LNCS, vol. 7909, pp. 56–57. Springer, Heidelberg (2013)
Jakumeit, E., Buchwald, S., Kroll, M.: GrGen.NET - The expressive, convenient and fast graph rewrite system. STTT 12(3–4), 263–271 (2010)
Jouault, F., Bézivin, J.: KM3: a DSL for metamodel specification. In: Gorrieri, R., Wehrheim, H. (eds.) FMOODS 2006. LNCS, vol. 4037, pp. 171–185. Springer, Heidelberg (2006)
Jouault, F., Kurtev, I.: Transforming models with ATL. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 128–138. Springer, Heidelberg (2006)
Kolovos, D., Rose, L., Paige, R.: The Epsilon Book, March 2013
Křikava, F., Collet, P., France, R.B.: SIGMA: scala internal domain-specific languages for model manipulations. In: Dingel, J., Schulte, W., Ramos, I., Abrahão, S., Insfran, E. (eds.) MODELS 2014. LNCS, vol. 8767, pp. 569–585. Springer, Heidelberg (2014)
Object Management Group: Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification, Version 1.1, January 2011
Object Management Group: Object Constraint Language - version 2.4, February 2014
Runge, O., Ermel, C., Taentzer, G.: AGG 2.0 – new features for specifying and analyzing algebraic graph transformations. In: Schürr, A., Varró, D., Varró, G. (eds.) AGTIVE 2011. LNCS, vol. 7233, pp. 81–88. Springer, Heidelberg (2012)
Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2 edn. Addison-Wesley Professional, Reading (2008)
Ujhelyi, Z., Bergmann, G., Hegedüs, Á., Horváth, Á., Izsó, B., Ráth, I., Szatmári, Z., Varró, D.: Emf-incquery: an integrated development environment for live model queries. Sci. Comput. Program. 98, 80–99 (2015)
Varró, D., Balogh, A.: The model transformation language of the VIATRA2 framework. Sci. Comput. Program. 68(3), 214–234 (2007)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Horn, T. (2015). Graph Pattern Matching as an Embedded Clojure DSL. In: Parisi-Presicce, F., Westfechtel, B. (eds) Graph Transformation. ICGT 2015. Lecture Notes in Computer Science(), vol 9151. Springer, Cham. https://doi.org/10.1007/978-3-319-21145-9_12
Download citation
DOI: https://doi.org/10.1007/978-3-319-21145-9_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-21144-2
Online ISBN: 978-3-319-21145-9
eBook Packages: Computer ScienceComputer Science (R0)