Archi Forum

Archi => Archi Development => Topic started by: wombach on July 07, 2020, 10:54:27 AM

Title: metadata in Archi files
Post by: wombach on July 07, 2020, 10:54:27 AM
Hi,

I want to add my own metadata into an Archi file. So far I was putting the information in properties, but users may mess up the information. I also tried to add additional metadata in my own namespace into the Archi XML file, but when the model has been opened and saved again, my metadata is gone.
Is there a place in the Archi XML file, where I can place metadata, which is preserved when saving the model again?

Thanks in advance.
Title: Re: metadata in Archi files
Post by: Phil Beauvoir on July 07, 2020, 11:24:24 AM
> I also tried to add additional metadata in my own namespace into the Archi XML file, but when the model has been opened and saved again, my metadata is gone.

This is expected behaviour as Archi doesn't know anything about how to handle it.

Is there a place in the Archi XML file, where I can place metadata, which is preserved when saving the model again?

You have to use the "Features" API. If you are manually adding this into an *.archimate file it would be like this:

<feature name="name" value=value"/>
Title: Re: metadata in Archi files
Post by: Jean-Baptiste Sarrodie on July 07, 2020, 19:57:34 PM
Hi,

In the future, jArchi will allow you to store and edit "features" (similar to properties but hidden from the UI). When done, you'll be able to create a simple script to store your metatdata this way.

Regards,

JB
Title: Re: metadata in Archi files
Post by: Phil Beauvoir on July 07, 2020, 20:00:22 PM
Quote from: Jean-Baptiste Sarrodie on July 07, 2020, 19:57:34 PM
Hi,

In the future, jArchi will allow you to store and edit "features" (similar to properties but hidden from the UI). When done, you'll be able to create a simple script to store your metatdata this way.

Regards,

JB

Indeed. The "Features" API has not yet been implemented in jArchi. It's on the roadmap - https://www.archimatetool.com/roadmap - but right now I have too much on my plate to attend to it immediately.  ;)
Title: Re: metadata in Archi files
Post by: rchevallier on October 23, 2020, 09:06:49 AM
Are features only available to visual objects or also to archimate elements ?
Title: Re: metadata in Archi files
Post by: Phil Beauvoir on October 23, 2020, 09:08:49 AM
Quote from: rchevallier on October 23, 2020, 09:06:49 AM
Are features only available to visual objects or also to archimate elements ?

- Model
- Concepts
- Folders
- Diagram Objects
Title: Re: metadata in Archi files
Post by: rchevallier on October 23, 2020, 09:13:57 AM
Great, I'll wait then for jarchi support (not planning to create a plugin, it seems too complicated for someone not familiar with Eclipse)
Title: Re: metadata in Archi files
Post by: Alberto on October 23, 2020, 18:20:38 PM
Are Features part of the Archimate exchange file format standard? I'm assuming yes since XML is mentioned.

I also see Features on the coArchi roadmap.  This makes me wonder if this could be used in substitution of the ReadMe.md that is generally used with Git.
Title: Re: metadata in Archi files
Post by: Phil Beauvoir on October 23, 2020, 18:49:43 PM
Quote from: Alberto on October 23, 2020, 18:20:38 PM
Are Features part of the Archimate exchange file format standard? I'm assuming yes since XML is mentioned.

I also see Features on the coArchi roadmap.  This makes me wonder if this could be used in substitution of the ReadMe.md that is generally used with Git.

No. A "feature" is simply an internal dictionary entry (key/value pair) like a Property.

Before now, every time we added an internal attribute to a model element (for example, colour, opacity, size, whatever) we would have to add a new attribute to the Eclipse Modelling Framework (EMF) eCore Model and regenerate the Java code. This also meant that a newer model could not be opened in an older version of Archi.

A "feature" stores these internal attributes in a generalised way. They should only be exposed in the UI at the appropriate place, and not like a Properties table. For example the outline opacity of a diagram element is stored in a feature like this:

  <feature name="lineAlpha" value="23"/>

and appears in the UI as a number widget (0-255).

As I said, these "features" are for internal use and should be exposed somehow to the user through the UI. Exposing it in the UI means that the user can remove it (by setting it to its default value) otherwise it will stay there forever.

A "feature" should not be used for storing arbitrary data unless the user or the plug-in can remove it.

This has nothing to do with the ArchiMate exchange file format. Take the example above. Internally we store outline opacity in a feature, but when we export to the exchange format it is stored in a dedicated part of the XML format (I think it is "alpha"). So, totally different things.

Phil