簡體   English   中英

獲取發火的OrientDb中的頂點或邊記錄?

[英]Getting vertex or edges records in pyrorient OrientDb?

我有一個頂點類Transformer,我想檢索它的記錄。 我正在做以下事情;

ABC = client.query("SELECT * FROM ABC")
print(ABC[0])

但是,此輸出;

{'@ABC':{'name': 'ABC_MVLV', 'origin_node': 'node_MV', 'destination_node': 'node_LV_1', 'rdfs_label': '', 'rdfs_comment': '', 'out_has_nominal_power': <pyorient.otypes.OrientBinaryObject object at 0x116ea5668>, 'out_has_primary_rated_voltage': <pyorient.otypes.OrientBinaryObject object at 0x116ea55f8>, 'out_has_secondary_maximum_current': <pyorient.otypes.OrientBinaryObject object at 0x116ea5cf8>, 'out_has_resistance': <pyorient.otypes.OrientBinaryObject object at 0x116ea5cc0>, 'out_has_reactance': <pyorient.otypes.OrientBinaryObject object at 0x116ea5e48>, 'out_has_conductance': <pyorient.otypes.OrientBinaryObject object at 0x116ea54a8>, 'out_has_susceptance': <pyorient.otypes.OrientBinaryObject object at 0x116ea54e0>, 'out_has_primary_maximum_current': <pyorient.otypes.OrientBinaryObject object at 0x116ea5d30>, 'out_has_ratio': <pyorient.otypes.OrientBinaryObject object at 0x116ea5160>, 'out_has_secondary_rated_voltage': <pyorient.otypes.OrientBinaryObject object at 0x116ea5e80>, 'out_has_maximum_apparent_power': <pyorient.otypes.OrientBinaryObject object at 0x116ea56a0>, 'in_has_transformers': <pyorient.otypes.OrientBinaryObject object at 0x116ea51d0>},'version':13,'rid':'#485:0'}

因為此類具有一些屬性,例如名稱,origin_node,可以通過ABC[0].name檢索,但是我也想檢索其他記錄,這可能是其他類之間的邊緣。 我知道在Java中可以檢查它是頂點還是邊,然后使用record.getvertex()或get edge進行檢索。 我該怎么做?

PyOrient中沒有特定的命令來檢索某些字段,例如ABC [0] .name,因為它們全部由SQL查詢處理。 您應該在這里查看它們:

OrientDB | SQL函數

OrientDB | PyOrient命令

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM