Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EMF Search"

(Eclipse Search Ecore Integration)
(Ecore Textual Search)
Line 78: Line 78:
  
 
==== Ecore Textual Search ====
 
==== Ecore Textual Search ====
 +
  
 
Ecore Textual Search Page is composed of two parts : query & participants.
 
Ecore Textual Search Page is composed of two parts : query & participants.
 +
  
 
* Query : Textual expression edit area with normal, case sentitive & regex support
 
* Query : Textual expression edit area with normal, case sentitive & regex support
 
* Participants : All Ecore meta elements possibly particpating to Ecore Textual query
 
* Participants : All Ecore meta elements possibly particpating to Ecore Textual query
 +
  
  
Line 98: Line 101:
 
Ecore Results page collects and display matches for Ecore queries. An header label summarize the  
 
Ecore Results page collects and display matches for Ecore queries. An header label summarize the  
 
query configuration in terms of expression, participants and scope.
 
query configuration in terms of expression, participants and scope.
 +
  
 
Matches are display in black, hierarchical intermediary results are colored in gray and get  
 
Matches are display in black, hierarchical intermediary results are colored in gray and get  

Revision as of 18:19, 4 February 2008

Project website at Eclipse [1]

Concept

EMF Search will provide the fundamental infrastructure and components for search queries on EMF based models. A particular focus is made on integration with the Eclipse Core Search API for end user tight integration.

EMF Search is an Ecore meta-model based extensible search engine which purpose is to provide users query launching services against Ecore based models.

Meta-model based search is basically being able to take advantage of a meta-model structure to run generic search queries onto it. This means that a meta-model structure, defining a minimal modeling "organizaton", contains information enough to get operations applied to it, and by extension having same operations applied to any inheriting model compliant with this meta-model structure. Ecore based search is in fact a particular case of meta-model based treatment, a typical approach also known as Model Driven Architecture.

In other words, this allows to develop meta-model based generic algorithms, valid across any user defined model extending elements & structure of a given meta-model. Such method are usually employed as part of a code generation development process also known as Model Driven Development, allowing developers to code things once, setting up templates based code generation getting its data from the particular valuation of an instance of a given meta-model (eg: An actual user defined model or domain model populated with pertinent data).

Terminology

For model search explanatory purposes, we need to introduce some terminology. First at all, lets keep in mind a model search query always need to deal with entities such as a scope of model resource(s)/element(s) onto which a search query will apply, a set of participant meta-elements which the search query will consider, and finally a search query, textual, scriptical,programatic which an associated model search engine will evaluate against a scope and participants. This evaluation obviously having the role to produce Model Search Results.

[EMF Model Search Query Entites Overview]

This brief explanation just made main concepts appearing : Model Search Scope, Model Search Participants, Model Search Query, Model Search Engine, Model Search Results.

   * Model Search Engine:
   EMF Search has extension point allowing user to contribute custom model search engines
   (see org.eclipse.emf.search.modelSearchEngine extension point definition).
   A model search engine has responsability, given a model resource scope,
   to evaluate a model search query applying only on a set of selected meta-elements (called meta-elements participants).
   * Model Search Query
   EMF Search offers extensible model search queries mechanism.
   Users can contribute model search queries potentially combined with any numbers of diferent elements particpants.
   (eg. given the fact different user defined elements extends Ecore meta-elements). As a result, users can register to
   org.eclipse.emf.search.modelSearchID extension their own model search queries (plus the way to handle it from UI point of view)
   and the, associating it to an existing model search engine.
   * Model Search Particiants
   EMF Search offers extensible model search participants elements mechanism.
   Users can contribute model search participants potentially combined with any numbers of diferent model search queries.
   As a result, users can register to org.eclipse.emf.search.modelSearchParticipantTab extension their own
   model search participant elements (plus the way to handle it from UI point of view) and, associating it to an existing model search engine.
   * Model Search Scope
   Model Search Scope stands for a set of ecore resources to be considerer by the search query. 
   We can make a comparison with platform search concepts from the scope point of view. 
   As in the text search or java search, user can search into the whole workspace or reduce its scope to selected resources, 
   selected projects or even given working set.
   * Model Search Result
   Query evaluation produces matches, being collected in a result object or each resource evaluated.
   Matches can be considered as reult entries of top level reult object. 
   These matches are considered as Model Search Result and will populate the Eclipse Search View.

Eclipse Search Integration

Eclipse Search Ecore Integration

Ecore Search Page have two main query kinds : Textual & OCL

  • Textual queries
    • normal (?, * available)
    • case sensitive
    • regex (Java regular expression based)


Textual queries are very similar to JDT, PDE or File ones. Query evaluation is done against meta elemnt names as users can see in Ecore editors. Thanks to the fact Most Ecore elements are inheriting from ENamedElement, exposing a usefull getName:String method, it is possible evaluate regex pattern against them.


  • OCL queries

OCL queries for Ecore are simple OCL invariants evaluations, these queries are ran against a particular meta element. OCL contextual edition is allowed according to a meta element user selection. Thus, users wanting to evaluate invariant expression against an EClass would have to set the OCL Expression wigdet context set to 'EClass' before being able to edit the invariant body.


As a result an OCL query expression body can take advantage of syntax coloring & contextual completion proposal.


Ecore Textual Search

Ecore Textual Search Page is composed of two parts : query & participants.


  • Query : Textual expression edit area with normal, case sentitive & regex support
  • Participants : All Ecore meta elements possibly particpating to Ecore Textual query


The figure below depict a user textual query aginst selected particpant meta elements.

Here, the user want find all EClass elements with name matching "Movie*" regex. Note that the search scope can be chosen between Workspace, Selected, Resource, Working Set.


EcoreTextualSearchPage.png


Ecore Results page collects and display matches for Ecore queries. An header label summarize the query configuration in terms of expression, participants and scope.


Matches are display in black, hierarchical intermediary results are colored in gray and get number of match occurences their sub tree owns.


EcoreTextualResultPage.png

Ecore OCL Search

EcoreOCLSearchPage.png

EcoreOCLResultPage.png


EMF Search Replace

EcoreRegexReplace1.png

EcoreRegexReplace2.png

UML2 Eclipse Searc Integration

UML2TextualSearchPage.png

UML2TextualResultPage.png


CodeGen Search Integration

GenModelTextualSearchPage.png

GenModelTextualResultPage.png

File:GenModelTextualResultPageToJavaCodeNavigation.png

GenModelTextualResultPageToEcoreElementNavigation.png

Back to the top