G-Node / G-Node/python-odml

Convenience functions to access and use terminologies

Aperta
#131 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
terminology v1.4
Lingua principale
Python
Stelle
25
Fork
30
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Access and using terminologies (e.g., g-node terminologies) are cumbersome at the moment (cf. example in #74).

It would be nice to have convenience functions in the terminology class for this, e.g.:
```
import odml.terminology as term

# fetches the g-node terminology, alternatively a local uri or another external url can be stated
term.fetch_terminology("G-Node")

# to find a possible terminology equivalent for a given object (returns clone of terminology entry)
term.get_terminology_equivalent(object) # object could be a section or a property object
# currently possible is only:
object.get_terminology_equivalent()

# to use a terminology as a building block for building a tree
sec_obj = odml.Section("Subject")

# case 1: I do not know exactly what terminology entry I want (e.g. for property)
new_sec = term.get_terminology(name="Age") # fetches property in terminology with name age
sec_obj.append(new_sec[2])

# case 2: I know exactly what terminology entry I want (e.g. for section)
sec_obj = term.get_terminology(url="http://portal.g-node.org/odml/terminologies/v1.0/subject/subject.xml", children=False)
```

In v1.4 the url-identifier could be also replaced with the uuids.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.