Skip to main content



      Home
Home » Eclipse Projects » Eclipse Hawk » How to convert GraphNodeWrapper to EObject
How to convert GraphNodeWrapper to EObject [message #1840908] Wed, 28 April 2021 11:49 Go to next message
Eclipse UserFriend
Hi

Given the following eol query:
Object res = queryEngine.query(indexer, "return Company.all;", null);

How can I convert the GraphNodeWrapper object into EObject. An example would be welcome.

Kind regards,
Re: How to convert GraphNodeWrapper to EObject [message #1840915 is a reply to message #1840908] Wed, 28 April 2021 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jo,

The EOLQueryEngine class is EMF-agnostic, as well as GraphNodeWrapper: you cannot directly turn GNWs into EObjects. Instead, you should use .localhawkmodel files to expose a Hawk graph as an EMF resource, if you are using a local Hawk running in the same JVM. If you are accessing a remote model through the Thrift API, you will need to use a .hawkmodel file instead. For details on how to create .localhawkmodel files, check this page:

https://www.eclipse.org/hawk/advanced-use/graph-as-emf/

I can set up an example if you provide more details of your use case. Are you using Hawk from a pure Java program, or from an Eclipse plugin?

Best,
Antonio
Re: How to convert GraphNodeWrapper to EObject [message #1840917 is a reply to message #1840915] Wed, 28 April 2021 15:01 Go to previous message
Eclipse UserFriend
thank you very much!
Your answer put me on track. Looking at the documentation and at the generated '.localhawmodel' helped to figure out how to setup the resource:

		LocalHawkResourceImpl resource = new LocalHawkResourceImpl(URI.createURI("models"), indexer, false, patterns, patterns);
		resource.basicSetResourceSet(rs, null);
		resource.load(Collections.EMPTY_MAP);
Previous Topic:Queries to get deleted elements
Next Topic:How to force hawk to follow package structure
Goto Forum:
  


Current Time: Sat Jul 12 04:54:44 EDT 2025

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

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

Back to the top