Take the 2-minute tour ×

Assume that I have an Ecore-model containing a package and some classes that make reference to each other. If i create a "Dynamic Instance", Eclipse produces an XMI-file and I can instantiate some classes. Containment-relations are directly serialized to an XML-tree in the XMI (the children elements in the example). But if I instantiate references to elements that are already contained somewhere in the tree, the Editor writes Path-Expressions like in the following, for the currentChild attribute:

<parent currentChild="//@parent/@children.1">

As far as I know this is not XPath, because:

  1. The "childrens" are elements not attributes and have not to be referenced via "@"
  2. XPath uses the e.g., elem[1] and not elem.1 to get e.g., the second elem of a list

What is it and where can I find a information on it? I already tried to browse the EMF pages/specs but could not find it.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

It's an EMF Fragment Path. The Javadoc describes it like this:

String org.eclipse.emf.ecore.InternalEObject.eURIFragmentSegment(EStructuralFeature eFeature, EObject eObject) Returns the fragment segment that, when passed to eObjectForURIFragmentSegment, will resolve to the given object in this object's given feature.

The feature argument may be null in which case it will be deduced, if possible. The default result will be of the form:


The index is used only for many-valued features; it represents the position within the list.

Parameters: eFeature the feature relating the given object to this object, or null. eObject the object to be identified. Returns: the fragment segment that resolves to the given object in this object's given feature.

share|improve this answer
Thanks! That helps a lot. –  Juve Oct 2 '09 at 8:49
Here is a link to a related Javadoc: help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.emf.doc/… search for: eURIFragmentSegment –  Juve Oct 2 '09 at 8:52
add comment

Your Answer


