Skip to main content
Solved

Data models link to archives pdf

  • 13 June 2024
  • 2 replies
  • 26 views

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?

2 replies

Userlevel 3
Badge

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

 

Userlevel 2
Badge +2

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

Reply