Discussion:
[orientdb] Getting in and out edges values of a vertex class
Waseem
2018-08-01 15:54:29 UTC
Permalink
I have a vertex class Transformer and would like to retrieve its records
from orientDB using pyorient.
I am doing the following;

transformers = client.command("SELECT * FROM Transformer")
print(transformers[0])

but it outputs the below, which shows that it has properties (e.g. name,
origin_node, etc.). The properties could easily be retrieved by transformers[0].name.
However, I would like to retrieve other OrientBinaryObjects as well. Which
might have further edges between other classes. Any idea how to do that in
pyrorient? I came to know that in java this could be done
by record.getVertex (), but any idea how I can do in pyorient? I may have
to check whether the record is vertex or edge and then using
record.getVertex or edge, but I dont know how to do this in pyorient?

{'@Transformer':{'name': 'transformer_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'}
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...