| list_related_resources | R Documentation |
With a given HP, find all the connected components.
list_related_resources( db.con = NA, d = NA, field = NA, id = NA, relationshiptype = "PX_is_related_to", disconn = TRUE, verbose = TRUE )
db.con |
a 'dbConnect' connection to the database. |
d |
a hash() object (a Python-like dictionary). |
field |
the field name that will be created in the 'd' hash() object. |
id |
the ID of an HP, either an UUID or an EAMENA ID. By default, NA. |
relationshiptype |
the type of relation existing betwen an HP and a BC. By default, the CIDOC-CRM 'PX_is_related_to'. |
disconn |
if TRUE (by defalut), will disconnect from the DB. |
verbose |
if TRUE (by default), print messages. |
A dataframe with the IDs and UUIDs of HP and CC
d <- hash::hash()
my_con <- RPostgres::dbConnect(drv = RPostgres::Postgres(),
user = 'xxx',
password = 'xxx',
dbname = 'eamena',
host = 'ec2-54-155-109-226.eu-west-1.compute.amazonaws.com',
port = 5432)
df <- list_related_resources(db.con = my_con,
d = d,
id = "EAMENA-0164943")
df
## hp.id hp.uuid cc.id cc.uuid
## 1 EAMENA-0164943 d4feb830-10c7-4d80-a19e-e608f424be4c COMPONENT-0000141 90400bb6-ff54-4afd-8183-65c67fa97448
## 2 EAMENA-0164943 d4feb830-10c7-4d80-a19e-e608f424be4c COMPONENT-0000143 0dab164a-6d3a-443c-954a-50d93efbff35