title: How to validate an Object Diagram (aka "Instance Diagram") against a Meta Model?
body: <p>I have to develop an API that take as an input a Meta Model (class diagram) and his instance (object diagram) but I don't know how to do it in a programaticly way.</p>
  
  <p>I made some research and I found that I can play with EMF API but I'm not sure how to do it and how to insert my diagram before the validation.</p>
  
  <p>I'm a beginner and lost between all the document that are present on the internet, so excuse me if my subject aren't clear</p>
  
  <p>I just need some orientation, advise to understand what I have to do.</p>
  
  <p><strong>EDIT</strong>:
  The subject is to validate an instance against his metamodel that are created with <a href="http://www.nomagic.com/products/magicdraw.html" rel="nofollow">Magic Draw</a>. So I have to export the file (ecore? XMI? I don't know who's the best) then create a Java API that parse these two file (I need to figure out how to inject/import them also) and return a boolean value about the validation. This is for the first step, after that I think I'll add OCL constraint to validate the instance, but for now I need to focus on a simple validation. How can I do that with EMF or other tool if required</p>