Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To "<em>fill in the ontology dictionary with only the key names</em>" :</p> <pre><code>ontology = {}.fromkeys('abcd',{}) </code></pre> <p>or</p> <pre><code>ontology = dict( (k,{}) for k in 'abcd') </code></pre> <p>Then you will fill <strong>{}</strong> of each item of <strong>ontology</strong> with the items <strong>'a':[...]</strong> , <strong>'b':[...]</strong> , <strong>'c':[...]</strong></p> <p>.</p> <p>But I don't see the interest of writing the value <strong>ontology['a']['a']</strong> as a list containing one unique element that is a dictionary with one unique item having always the same key <strong>'y'</strong></p> <p>Instead of writing this value <strong>'a':[{'y': {'type': 'DSE','name':'JHG'}}]</strong> , for example, you could write it <strong>'a':('DSE','JHG')</strong> . Knowing that first element of the couple <strong>('DSE','JHG')</strong> is a type and the second is a name.</p> <p>You could also write <strong>'z':('QSZA','IUYOIU')</strong> , knowing that first== a type and second== a name.</p> <p>So ontology would be:</p> <pre><code>{'a': {'a':('DSE','JHG') , 'x':[...] , 'z':('QSZA','IUYOIU')} , 'b': {'b':('dfg','tfy') , 'x':[...] , 'z':('ynyu','zertzt')} , 'c': {'c':('noq','jek') , 'x':[...] , 'z':('frEZ','jkyukA')} , 'd': {'d':('bqi','bif') , 'x':[...] , 'z':('kiy',';jheTri')} } </code></pre> <p>And it could even be simplified still more:</p> <pre><code>{'a': (('a', 'DSE','JHG') , [...] , ('QSZA','IUYOIU')) , 'b': (('b', 'dfg','tfy') , [...] , ('ynyu','zertzt')) , 'c': (('c', 'noq','jek') , [...] , ('frEZ','jkyukA')) , 'd': (('d', 'bqi','bif') , [...] , ('kiy',';jheTri')) } </code></pre> <p>First element of a value of ontology would always be of style ('a', type, name) , the second always a list of style 'x' , and the third always a couple (type, name) of style 'z'</p> <p>The elements ('a', type, name) , [...] , (type, name) would be accessed through positions 0, 1, 2 instead of keys 'a'+'y', 'x', 'z'</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload