Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define an Eclipse UI validator to prevent building a project with multiple 'oml.catalog.xml' files #264

Open
NicolasRouquette opened this issue Mar 8, 2018 · 0 comments

Comments

@NicolasRouquette
Copy link
Member

For the EMF-based OML API, OML defines an OASIS XML Catalog, oml.catalog.xml, for mapping OML IRIs to EMF Resource URIs (see EMF's URIConverter). With multiple oml.catalog.xml files, it is possible to break an important EMF invariant; specifically, that all EMF Resources in an EMF ResourceSet must have distinct URIs.

For example, consider an Eclipse project with the following folders and files:

./.project
./A
./A/oml.catalog.xml
./A/example.org/
./A/example.org/vocabulary.oml
./B
./B/oml.catalog.xml
./B/example.org/
./B/example.org/vocabulary.oml

where ./A/oml.catalog.xml and ./B/oml.catalog.xml have the same content:

<?xml version='1.0'?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
    <rewriteURI
            rewritePrefix="file:./"
            uriStartString="http://"/>
</catalog>

and where ./A/example.org/vocabulary.oml and ./B/example.org/vocabulary.oml have the same content:

open terminology <http://example.org/vocabulary> {
  // ... some OML terminology content ...
}

Outside of Eclipse, this situation is not a problem because OML APIs use a single catalog.

Inside of Eclipse, this situation can be problematic, particularly with the Eclipse UI where the nature of the project (in ./.project) includes 'Modeling' and 'Xtext'. When building this project, Eclipse will recognize the *.oml files and may load them in an EMF ResourceSet. If these files are loaded in the same ResourceSet, the invariant about EMF Resource URIs will be broken.

The effect of breaking this invariant manifests in strange errors like #261 and #262.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant