Skip to main content

Graph Pattern Matching as an Embedded Clojure DSL

  • Conference paper
  • First Online:
Graph Transformation (ICGT 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9151))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://eclipse.org/Xtext/.

  2. 2.

    http://funnyqt.org.

  3. 3.

    http://clojure.org.

  4. 4.

    http://jgralab.uni-koblenz.de.

  5. 5.

    A keyword is a symbolic identifier which always evaluates to itself. Keywords start with a colon, e.g. :this-is-a-keyword.

  6. 6.

    The order of matches is deterministically defined by the pattern specification and the underlying modeling framework’s allInstances-operation.

  7. 7.

    Edges with an identity which are typed and possibly attributed.

  8. 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. 9.

    In analogy to defpattern/letpattern/pattern, there are also macros letrule and rule for defining local and anonymous rules.

  10. 10.

    This implies that a and oa are different, too, because of the composition semantics of the subs reference.

  11. 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. 12.

    http://www.martinfowler.com/bliki/FluentInterface.html.

  13. 13.

    https://github.com/jgralab/funnyqt-henshin.

References

  1. 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)

    Chapter  Google Scholar 

  2. 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)

    Chapter  Google Scholar 

  3. 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)

    Google Scholar 

  4. Fowler, M.: Domain Specific Languages, 1st edn. Addison-Wesley Professional, Boston (2010)

    Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. Ghamarian, A.H., de Mol, M., Rensink, A., Zambon, E., Zimakova, M.: Modelling and analysis using GROOVE. STTT 14(1), 15–40 (2012)

    Article  Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Chapter  Google Scholar 

  9. Jakumeit, E., Buchwald, S., Kroll, M.: GrGen.NET - The expressive, convenient and fast graph rewrite system. STTT 12(3–4), 263–271 (2010)

    Article  Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. Jouault, F., Kurtev, I.: Transforming models with ATL. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 128–138. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  12. Kolovos, D., Rose, L., Paige, R.: The Epsilon Book, March 2013

    Google Scholar 

  13. 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)

    Google Scholar 

  14. Object Management Group: Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification, Version 1.1, January 2011

    Google Scholar 

  15. Object Management Group: Object Constraint Language - version 2.4, February 2014

    Google Scholar 

  16. 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)

    Chapter  Google Scholar 

  17. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2 edn. Addison-Wesley Professional, Reading (2008)

    Google Scholar 

  18. 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)

    Article  Google Scholar 

  19. Varró, D., Balogh, A.: The model transformation language of the VIATRA2 framework. Sci. Comput. Program. 68(3), 214–234 (2007)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tassilo Horn .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics