{"action":"created","issue":{"url":"https://api.github.com/repos/ghillairet/emfjson/issues/46","labels_url":"https://api.github.com/repos/ghillairet/emfjson/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/ghillairet/emfjson/issues/46/comments","events_url":"https://api.github.com/repos/ghillairet/emfjson/issues/46/events","html_url":"https://github.com/ghillairet/emfjson/issues/46","id":55143915,"number":46,"title":"XMI:UID to JSON?","user":{"login":"jmarreroc","id":9864367,"avatar_url":"https://avatars.githubusercontent.com/u/9864367?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarreroc","html_url":"https://github.com/jmarreroc","followers_url":"https://api.github.com/users/jmarreroc/followers","following_url":"https://api.github.com/users/jmarreroc/following{/other_user}","gists_url":"https://api.github.com/users/jmarreroc/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarreroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarreroc/subscriptions","organizations_url":"https://api.github.com/users/jmarreroc/orgs","repos_url":"https://api.github.com/users/jmarreroc/repos","events_url":"https://api.github.com/users/jmarreroc/events{/privacy}","received_events_url":"https://api.github.com/users/jmarreroc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-22T11:45:33Z","updated_at":"2015-01-23T09:46:38Z","closed_at":null,"body":"Hi [ghillairet](https://github.com/ghillairet),\r\n\r\nFirst of all, thanks for your great work. I'm trying to persist in json format some models that i have in xmi format, so i basically put the contents of the XMI resource in your Json resource. And thats what its happening:\r\n\r\nfrom my XMI fragment:\r\n```\r\n<views xmi:id=\"_e7ueQZdiEeS7gJfuiwqSVw\"\r\n      name=\"Business Function\"\r\n      composedFrom=\"_9svCcJdkEeSMX_UyBNZKBw //@models.1\">\r\n    <governedBy\r\n        href=\"archimate.lib.ead#_5E8HAJdbEeSCOqTm_c7kWw\"/>\r\n</views>\r\n```\r\n__________________________________\r\nthis is the generated Json fragment:\r\n```\r\n\"views\" : [ {\r\n    \"name\" : \"Business Function\",\r\n    \"governedBy\" : {\r\n      \"$ref\" : \"platform:/plugin/mydomain.ead/examples/ead/archimate.lib.ead#_5E8HAJdbEeSCOqTm_c7kWw\",\r\n      \"eClass\" : \"http://mydomain.com/1.0/ead#//ArchitectureViewpoint\"\r\n    },\r\n    \"composedFrom\" : [ {\r\n      \"$ref\" : \"//@models.1\",\r\n      \"eClass\" : \"http://mydomain.com/1.0/ead#//ArchitectureModel\"\r\n    } ]\r\n  } ]\r\n```\r\nThen i can't access to the **xmi:id=\"_e7ueQZdiEeS7gJfuiwqSVw\"** property in the json format... and when i try to get the EObject with the urifragment **jsonResource.getEObject(\"_e7ueQZdiEeS7gJfuiwqSVw\")** i get null Object. Obviously when i try it with the xmiResource i can get the EObject correctly. I suspect that it happens because the property **xmi:id** is a particular functionallity of the xmi format wich EMF uses (in benefit) for locate and persist models. So, is there anyway to include the xmi:id property in my generated json? Am i missing something in the instantiation of the json Resource?\r\n\r\nThank you very much for your time and your work!\r\n\r\nKind regards.\r\n\r\n \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ghillairet/emfjson/issues/comments/71169700","html_url":"https://github.com/ghillairet/emfjson/issues/46#issuecomment-71169700","issue_url":"https://api.github.com/repos/ghillairet/emfjson/issues/46","id":71169700,"user":{"login":"ghillairet","id":148045,"avatar_url":"https://avatars.githubusercontent.com/u/148045?v=3","gravatar_id":"","url":"https://api.github.com/users/ghillairet","html_url":"https://github.com/ghillairet","followers_url":"https://api.github.com/users/ghillairet/followers","following_url":"https://api.github.com/users/ghillairet/following{/other_user}","gists_url":"https://api.github.com/users/ghillairet/gists{/gist_id}","starred_url":"https://api.github.com/users/ghillairet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghillairet/subscriptions","organizations_url":"https://api.github.com/users/ghillairet/orgs","repos_url":"https://api.github.com/users/ghillairet/repos","events_url":"https://api.github.com/users/ghillairet/events{/privacy}","received_events_url":"https://api.github.com/users/ghillairet/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T09:46:38Z","updated_at":"2015-01-23T09:46:38Z","body":"You can serialize the UUIDs with a JsonResource like you do with a XMIResource by overriding the method useUUIDs like this\r\n\r\n```java\r\nResourceSet resourceSet = new ResourceSetImpl();\r\nresourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(\"*\", new JsonResourceFactory() {\r\n    @Override\r\n    public Resource createResource(URI uri) {\r\n        JsonResource resource = new JsonResource(uri) {\r\n             protected boolean useUUIDs() {\r\n                  return true;\r\n             };\r\n         };\r\n         return resource;\r\n     }\r\n});\r\n```\r\n\r\nThat will add a _id field in the JSON output will the UUID value."}}