I was building custom artifacts, but how can I imp...
# all-things-deployment
a
I was building custom artifacts, but how can I import and use existing linkedin objects in my model. ~/projects/linkedin/metadata-models-custom$ ../gradlew -Prest.model.compatibility=ignore -PprojVersion=0.0.14 install - I see an error: "CorpuserUrn" or "com.linkedin.common.CorpuserUrn" cannot be resolved. 20,20: Type not found: CorpuserUrn "CorpuserUrn" or "com.linkedin.common.CorpuserUrn" cannot be resolved. 26,18: Type not found: CorpuserUrn "CorpuserUrn" or "com.linkedin.common.CorpuserUrn" cannot be resolved. 32,25: Type not found: CorpuserUrn "CorpuserUrn" or "com.linkedin.common.CorpuserUrn" cannot be resolved. 38,22: Type not found: CorpuserUrn at com.linkedin.data.schema.generator.AbstractGenerator.parseSources(AbstractGenerator.java:157) at com.linkedin.data.avro.generator.AvroSchemaGenerator.generate(AvroSchemaGenerator.java:191) at com.linkedin.data.avro.generator.AvroSchemaGenerator.run(AvroSchemaGenerator.java:165) at com.linkedin.data.avro.generator.AvroSchemaGenerator.main(AvroSchemaGenerator.java:123)
I used: import com.linkedin.common.CorpuserUrn in my PDL file
// Uncomment these if you want to depend on models defined in core datahub
think i found the solution 🙂
👍 1
e
Can you just import com.linkedin.common.Urn ?
We have stopped using entity specific urns in the pdl models
plus1 1
a
May I ask why you stopped? I was able to compile once I uncommented the lines in the gradle file, but why should I change from CorpuserUrn to just Urn?
e
For newer entities, we have stopped defining entity specific urns. instead we have key aspects which are encoded into urns.
b
Yep this is correct. This was to lower the barrier to adding new Entity Types. Previously, you had to handcode URN classes on the classpath. Now we use the general purpose "urn" class
a
So if I'm creating an aspect, where I want a property to be restricted to the corpUser type, how can I do that if I only specify generic Urn?
@Relationship = { "name": "OwnedBy", "entityTypes": [ "corpUser", "corpGroup" ] } owner: Urn
i think i see
Is there a way with auto rendering to make user fields links to the user?
I added a Roles aspect, and made some properties
but the value is just a string and not a link to my corpUser page in the catalog
e
@green-football-43791 do we dynamically add urns as links to the entity?
g
@early-lamp-41924 not at the moment
b
That would be great!! It's definitely possible to detect and render resource link like this..