// Copied from org.eclipse.ocl.examples.test.xtext.PivotDocumentationExamples.java // Create an EPackage.Registry for just the EXTLibraryPackage EPackage.Registry registry = new EPackageRegistryImpl(); registry.put(EXTLibraryPackage.eNS_URI, EXTLibraryPackage.eINSTANCE); // Create an OCL that creates a ResourceSet using the minimal EPackage.Registry OCL ocl = OCL.newInstance(registry); ResourceSet resourceSet = ocl.getResourceSet(); // get an OCL text file via some hypothetical API URI uri = getInputURI("/model/parsingDocumentsExample.ocl"); // parse the contents as an OCL document Resource asResource = ocl.parse(uri);