Skip to main content
Solved

Data models link to archives pdf


Pablo Palacios
Seasoned
Forum|alt.badge.img+3

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?

Best answer by Arild Eide

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

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img
  • Seasoned Practitioner
  • 28 replies
  • Answer
  • June 24, 2024

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

 


Pablo Palacios
Seasoned
Forum|alt.badge.img+3

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


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings