from TRIAD.CacheTriad import TriadFramework
triad=TriadFramework('_SYSTEM', 'SYS', 1)
resdf = triad.get(what='Data Resources', con=0, itm=0)
resdf
| Text, | TXT |(Short passages of text in any language)
| Word, | WRD |(Words or small phrases up to 128 characters long)
| Real, | REA |(Number)
| Integer, | INT |(Number)
| TimeStamp, | TS |(Date and Time)
| Code, | COD |(Any non-readable string up to 128 characters long)
| URL, PATH, | LNK |(URL address, or PATH up to 2048 characters long)
| Binary, | RAW |(Binary sequence up '1048487' bytes in size)
| Categorical, | ENUM |(Enumerated string up to 128 characters long)
ldf = triad.get(what='Data Resources', sys=1024, con=20)
ldf.iloc[1:]
rdf = triad.get(what='DME', sys=1111, con=20)
rdf.iloc[1:]
graph=triad.set_mapping(left_df=ldf.iloc[1:], right_df=rdf.iloc[1:], left_heading='Columns', right_heading='Attributes')
graph.set_dpi(65) ; graph.draw()
matching_pairs = [
('catsid_col', 'supID'),
('catpid_col', 'prtID'),
('catcost_col', 'catPrice'),
('catqnt_col', 'catTotal'),
('catdate_col', 'catDate'),
('catchk_col', 'catCheck'),
('pid_col', 'prtID'),
('pname_col', 'prtName'),
('pcolor_col', 'prtColor'),
('pweight_col', 'prtWeight'),
('punit_col', 'prtUnit'),
('sid_col', 'supID'),
('sname_col', 'supName'),
('saddress_col', 'supAddress'),
('scity_col', 'supCity'),
('scountry_col', 'supCountry'),
('sstatus_col', 'supStatus') ]
triad.add(what='Mapping Data Resource', label_pairs=matching_pairs, pydot_graph=graph)
graph.draw()
ldf = triad.get(what='Data Resources', sys=1024, con=10)
rdf = triad.get(what='DME', sys=1111, con=10)
graph=triad.set_mapping(left_df=ldf.iloc[1:], right_df=rdf.iloc[1:], left_heading='Tables', right_heading='Entities')
graph.draw()
matching_pairs = [('Catalogue.tsv', 'Catalog'), ('Suppliers.tsv', 'Supplier'), ('Parts.tsv', 'Part')]
triad.add(what='Mapping Data Resource', label_pairs=matching_pairs, pydot_graph=graph)
graph.draw()
triad.get(what='Data Resources', sys=1024)