eclipse / editdor

Eclipse ediTDor - A tool for simply designing W3C Thing Descriptions
https://eclipse.github.io/editdor/
38 stars 19 forks source link

Request new Title and ID in dialog to generate a TD out of a TM #76

Open Silvanoc opened 2 years ago

Silvanoc commented 2 years ago

Thing Descriptions being generated out of Thing Models are keeping the title and id of the model. But typically you'll want different values for both fields. It would be nice to have to optional text boxes to define them in the "Generated TD from TM" dialog.

sebastiankb commented 2 years ago

The best way for initiating this is to use the placeholder concept. See the example here:

image

If you click on "Convert to TD" it will ask you to assign specific title and id for the TD instance.

Silvanoc commented 2 years ago

But if your TM has both title and id (like in this example), then you'd have to replace them with PLACEHOLDERS on ediTDor. Therefore IMO that's only a workaround.

sebastiankb commented 2 years ago

Just to avoid misunderstanding: The placeholder concept is a TM feature and not a specific ediTDor feature. Please see here.

Silvanoc commented 2 years ago

Yes, I'm clear about that.

What I mean is that if my TM has title and id (what I would expect to clearly identify them) instead of placeholders, then those values need to be replaced with placeholders somewhere before letting ediTDor generate the TDs.

egekorkan commented 2 years ago

I think that we should not make such assumptions, especially about the title since it is not meant to be unique. All Siemens iQ500 Washing Machines can have the title Siemens iQ500 Washing Machine that is displayed on a UI. In this case, the title for the TD can be already defined in the TM and never changed.

id can be more up for discussion, i.e. whether it is allowed to conserve the id in TM->TD process. A more fundamental question is whether a TM should have an id. In the end, theoretically, id is for a Thing and not for a TD nor TM (https://w3c.github.io/wot-thing-description/#thing). In the TM stage, there should not even be an id unless there are placeholders, e.g. "id": "urn:dev:ops:32473-iq500wm-{{serial_number}}",.

In any case, I would propose to move this discussion to the TD spec since editdor is not doing something wrong according to the TD spec.

Silvanoc commented 2 years ago

@egekorkan you're right with the assumptions WRT title. I see following options that might be valid use-cases and comply with the specification and should be somehow realizable with ediTDor:

WRT the id, IMO TMs should definitively have their own ids different from those of the TDs. Having a TM id with a placeholder would help differentiating it from the instantiated TDs, but would be somehow weird. IMO the way IDs are being used example I've mentioned above makes much more sense. And that's something ediTDor doesn't support as of now.