spec: is identify_by inherited through extends?

Aperta
#692 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
json, markdown, python

Direzione di ricerca

Read ontology/ontology.md (especially “Identifiers” and the derived-subtype example), core-spec/spec.md, and ontology/ontology.json to decide how the rule should be expressed consistently. The issue recommends documenting that identify_by is not inherited and adding a validation warning, but these changes involve specification and implementation work; done means the inheritance rule and example are clear and the warning covers the described case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs-triage

ontology/ontology.md ("Identifiers") says identify_by "allows modelers to list the names of relationships that form the preferred identifier of a concept". Nothing in ontology.md, core-spec/spec.md, or ontology/ontology.json says whether a concept that extends another inherits the parent's identify_by, or must declare its own.

The reference implementation (now in apache/ossie-converters, ontology/src/ossie_ontology/converter/spec_to_ossie/converter.py, _populate_ontology) resolves the question one way without documenting it: it builds identify_by only from the concept's own identify_by list. A subtype that declares none — as Customer did in the first revision of #310 — resolves to an empty identifier even though it extends a concept with a preferred identifier and every one of its objects is identifiable by it.

Note the asymmetry: lookup_concept_relationship does walk extends when resolving a relationship name, so identify_by: [ nr ] on the subtype resolves to BusinessPartner.nr. The lookup inherits; the identifier list does not.

First raised by @jbonofre in the #310 review.

Proposal
  1. Document the rule. Recommended: identify_by is not inherited and must be declared on every entity type that is meant to be referenced. This matches the engine's behaviour today, and avoids ambiguity when a concept has more than one parent in extends.
  2. Add a validation warning when an entity type with a non-empty extends declares no identify_by and none of its parents' identifiers is restated — the silent empty identifier is what made #310's defect invisible until the engine ran.
  3. Update the Employee-style derived-subtype example in ontology.md to show the explicit declaration.
Lingua principale
Python
Stelle
2.7k
Fork
353
Merge medio
3g 19h
PR unite (30g)
86

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/ossie

Tutte le issue di apache/ossie

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.