Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » What should I configure NSURI to be?
What should I configure NSURI to be? [message #1782673] Tue, 27 February 2018 17:41 Go to next message
Mike Cooper is currently offline Mike CooperFriend
Messages: 60
Registered: February 2011
Member
I've created several ecore models over the years but never really been clear what the "nsuri" value should be set to. I think it's suppose to be something unique to my org such as "http://www.acme.com" or "http://www.acme.com/myecore" but does the URI given have to be resolvable?

Does the URI need to return something specific? I don't really want to publish my ecore models to the internet. The ecore files refer only to themselves on the local filesystem.

Re: What should I configure NSURI to be? [message #1782675 is a reply to message #1782673] Tue, 27 February 2018 18:25 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

To avoid validation diagnostics, it must be non-null and a well-formed URI.

It should be unique since two 'different' models with the same nsURI may not be consistently different leading to the horrible X is not an X diagnostic.

You can choose any text, but to avoid a clash should your model every find itself in the same workspace as another similarly inspired name it is good practice to use your unique internet as part of the name, and since clashes with your colleagues are quite likely a distinctive project name too.

For stable released models, a year is quite a useful inclusion since you can change it when the model really evolves incompatibly.

Regards

Ed Willink
Re: What should I configure NSURI to be? [message #1782676 is a reply to message #1782675] Tue, 27 February 2018 18:39 Go to previous messageGo to next message
Mike Cooper is currently offline Mike CooperFriend
Messages: 60
Registered: February 2011
Member
Ed,

Thanks for that info! Very helpful.

One clarification: Does the URL have to be resolvable or return any data in any specific format? It sounds like it's really just used as a unique identifier and is not suppose to have any kind of data that is accessable.

Is it sufficient to use something like "http://www.acme.com/mymodel" where www.acme.com is resolvable but the actual URI returns 404 (Not Found)?

Re: What should I configure NSURI to be? [message #1782678 is a reply to message #1782676] Tue, 27 February 2018 19:02 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

No the UTL does not need to be resolveable. http://www.eclipse.org/emf/2002/Ecore is a 404.

I wouldn't recommend "mymodel" since it is very likely that you or your colleague might re-use that suffix. But you are free to dig a hole now; just don't be surprised if you fall into it next year.

Regards

Ed Willink
Previous Topic:XML2XML transformation
Next Topic:defining model scope for XMI loader
Goto Forum:
  


Current Time: Tue Apr 23 17:00:21 GMT 2024

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

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

Back to the top