Skip to main content

hello:
I want to associate files uploaded to CDF type pdf for example to my model, following this scheme:

type Documentation {
name: String
# This is a CDF built in type
file: File
# this is the INVERSE relationship of the Pump.documentation
# Pump.documentation <-> Documentation.relatedPumps
relatedPumps: [Pump] @relation(
direction: INWARDS,
type: { externalId: "Pump.documentation", space: "Space_PabloPalacios" }
)
}

but when I select the uploaded file it only shows me jpg, any ideas?

Hi Pablo

The file reference is the externalId of a file in CDF, regardless of type. Can you verify that the file you are trying to associate indeed has externalId set?

 

If that is the case and you still have problem, might use the Python SDK to create an instance of Document that points to the file like this:

client.data_modeling.instances.apply(NodeApply(space="Space_PabloPalacios", external_id="doc001", sources==NodeOrEdgeData(ViewId(space="Space_PabloPalacios", external_id="Documentation", version=VIEW_VERSION ), properties={"file": "File001"})])

 

Hope this helps.

 

Arild Eide

 


Yes, I was indeed missing the externalID in the file, thank you.


Reply