Skip to main content



      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 08:56 Go to next message
Eclipse UserFriend
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 10:23 Go to previous message
Eclipse UserFriend
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...
Previous Topic:Instantiating and EMF object
Next Topic:[Edapt] Can't migrate model after referenced model is migrated?
Goto Forum:
  


Current Time: Wed Jun 25 01:58:25 EDT 2025

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

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

Back to the top