Author Topic: metadata in Archi files  (Read 923 times)

wombach

  • Newbie
  • *
  • Posts: 8
metadata in Archi files
« 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.

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1639
  • Code Punk
    • Archi
Re: metadata in Archi files
« Reply #1 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"/>
« Last Edit: July 07, 2020, 12:15:45 PM by Phil Beauvoir »
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: metadata in Archi files
« Reply #2 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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1639
  • Code Punk
    • Archi
Re: metadata in Archi files
« Reply #3 on: July 07, 2020, 20:00:22 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

  • Active Member
  • ***
  • Posts: 79
Re: metadata in Archi files
« Reply #4 on: October 23, 2020, 09:06:49 AM »
Are features only available to visual objects or also to archimate elements ?

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1639
  • Code Punk
    • Archi
Re: metadata in Archi files
« Reply #5 on: October 23, 2020, 09:08: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

  • Active Member
  • ***
  • Posts: 79
Re: metadata in Archi files
« Reply #6 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)

Alberto

  • Active Member
  • ***
  • Posts: 66
  • Twitter: @albertodmendoza
Re: metadata in Archi files
« Reply #7 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.

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1639
  • Code Punk
    • Archi
Re: metadata in Archi files
« Reply #8 on: October 23, 2020, 18:49:43 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