Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Path through an EMF graph(Is there something similar to XPath for EMF?)
Path through an EMF graph [message #1774187] Wed, 11 October 2017 12:56 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 16
Registered: May 2014
Junior Member
All,

I need an EMF equivalent to XPath. i.e. A string that points to a value inside an EMF object graph. I need to--starting with an EObject, EAttribute, or EReference; which might be well nested--get the string I mentioned (a path reaching up container by container to the top, containing object) and vice versa. i.e. Starting with the string, navigating down to a object and updating an attribute(s).

Clearly, I can roll my own, but I would prefer to use something more standardized if such a thing exists.

Is there any such thing?

I realize one can always go from EMF to XML then hit it with XPath, but that's jumping through too many hoops.

Thanks
Re: Path through an EMF graph [message #1774307 is a reply to message #1774187] Thu, 12 October 2017 14:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
There are org.eclipse.emf.ecore.InternalEObject.eURIFragmentSegment(EStructuralFeature, EObject) and org.eclipse.emf.ecore.InternalEObject.eObjectForURIFragmentSegment(String) for creating path segments and traversing path segments, so an extension of that idea would allow the final segment to refer to an attribute's value and return it...

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Instantiating and EMF object
Next Topic:[Edapt] Can't migrate model after referenced model is migrated?
Goto Forum:
  


Current Time: Thu Apr 25 02:02:17 GMT 2024

Powered by FUDForum. Page generated in 0.02856 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top