metadata in Archi files

Started by wombach, July 07, 2020, 09:54:27 AM

Previous topic - Next topic

wombach

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.

Phil Beauvoir

July 07, 2020, 10:24:24 AM #1 Last Edit: July 07, 2020, 11:15:45 AM by Phil Beauvoir
> 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"/>
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Jean-Baptiste Sarrodie

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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Phil Beauvoir

Quote from: Jean-Baptiste Sarrodie on July 07, 2020, 18: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.  ;)
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

rchevallier

Are features only available to visual objects or also to archimate elements ?

Phil Beauvoir

Quote from: rchevallier on October 23, 2020, 08:06:49 AM
Are features only available to visual objects or also to archimate elements ?

- Model
- Concepts
- Folders
- Diagram Objects
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

rchevallier

Great, I'll wait then for jarchi support (not planning to create a plugin, it seems too complicated for someone not familiar with Eclipse)

Alberto

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.

Phil Beauvoir

Quote from: Alberto on October 23, 2020, 17: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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate