Convert Entity Property to String

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am doing some work with my own EntityStores as well as the built in Wolfram Entities. After pulling a subset of data, I am wanting to structure it as a dataset and to do so I need to be able to extract the property names to use as keys in an association thread.



It easy to get the Properties, but as you can see, the result comes out structured like an Entity.



Properties



I tried using TextString but essentially got the input form:



TextString



If I were dealing with the Entities themselves, I could use simply use ["Name:]



Name



I can do a work around with StringSplit, but that seems like a very round about way to do things.



StringSplit[#, "[", ","] & /@ 
TextString /@ EntityProperties["Aircraft"][[All, 2]] // Flatten


Is there a solution that I am missing that doesn't require such Wolfram Gymnastics?










share|improve this question

















  • 2




    Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
    – Kuba♦
    2 hours ago











  • Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
    – kickert
    2 hours ago







  • 2




    Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
    – Kuba♦
    1 hour ago















up vote
1
down vote

favorite












I am doing some work with my own EntityStores as well as the built in Wolfram Entities. After pulling a subset of data, I am wanting to structure it as a dataset and to do so I need to be able to extract the property names to use as keys in an association thread.



It easy to get the Properties, but as you can see, the result comes out structured like an Entity.



Properties



I tried using TextString but essentially got the input form:



TextString



If I were dealing with the Entities themselves, I could use simply use ["Name:]



Name



I can do a work around with StringSplit, but that seems like a very round about way to do things.



StringSplit[#, "[", ","] & /@ 
TextString /@ EntityProperties["Aircraft"][[All, 2]] // Flatten


Is there a solution that I am missing that doesn't require such Wolfram Gymnastics?










share|improve this question

















  • 2




    Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
    – Kuba♦
    2 hours ago











  • Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
    – kickert
    2 hours ago







  • 2




    Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
    – Kuba♦
    1 hour ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am doing some work with my own EntityStores as well as the built in Wolfram Entities. After pulling a subset of data, I am wanting to structure it as a dataset and to do so I need to be able to extract the property names to use as keys in an association thread.



It easy to get the Properties, but as you can see, the result comes out structured like an Entity.



Properties



I tried using TextString but essentially got the input form:



TextString



If I were dealing with the Entities themselves, I could use simply use ["Name:]



Name



I can do a work around with StringSplit, but that seems like a very round about way to do things.



StringSplit[#, "[", ","] & /@ 
TextString /@ EntityProperties["Aircraft"][[All, 2]] // Flatten


Is there a solution that I am missing that doesn't require such Wolfram Gymnastics?










share|improve this question













I am doing some work with my own EntityStores as well as the built in Wolfram Entities. After pulling a subset of data, I am wanting to structure it as a dataset and to do so I need to be able to extract the property names to use as keys in an association thread.



It easy to get the Properties, but as you can see, the result comes out structured like an Entity.



Properties



I tried using TextString but essentially got the input form:



TextString



If I were dealing with the Entities themselves, I could use simply use ["Name:]



Name



I can do a work around with StringSplit, but that seems like a very round about way to do things.



StringSplit[#, "[", ","] & /@ 
TextString /@ EntityProperties["Aircraft"][[All, 2]] // Flatten


Is there a solution that I am missing that doesn't require such Wolfram Gymnastics?







entity






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









kickert

53715




53715







  • 2




    Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
    – Kuba♦
    2 hours ago











  • Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
    – kickert
    2 hours ago







  • 2




    Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
    – Kuba♦
    1 hour ago













  • 2




    Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
    – Kuba♦
    2 hours ago











  • Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
    – kickert
    2 hours ago







  • 2




    Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
    – Kuba♦
    1 hour ago








2




2




Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
– Kuba♦
2 hours ago





Doesn't already EntityProperties["Aircraft"][[All , 2]] give you what you want?
– Kuba♦
2 hours ago













Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
– kickert
2 hours ago





Wow... it does... I had no idea you could select a part of the variables of a function. Essentially that code would be: EntityProperty["Aircraft","Ceiling"][[2]] which in fact returns "Ceiling". I had only seen Part used with lists and not with functions. Thanks for the simple solution!
– kickert
2 hours ago





2




2




Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
– Kuba♦
1 hour ago





Unless an expression is atomic (AtomQ), you can manipulate it like a List can be manipulated.
– Kuba♦
1 hour ago











1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










You could use EntityValue instead:



EntityValue["Aircraft","PropertyCanonicalNames"]



"Ceiling", "Crew", "CruiseSpeed", "DesignedBy", "EmptyWeightPerBooster",
"Height", "Image", "Introduced", "Length", "LoadedWeight", "MaidenFlight",
"Manufacturer", "MaxSpeed", "MaxWeight", "Name", "NumberBuilt", "PowerPlant",
"PowerPlantCount", "Range", "RateOfClimb", "Status", "Type", "WingArea",
"WingLoading", "Wingspan"




Another possibility is to use the function CanonicalName:



CanonicalName /@ EntityProperties["Aircraft"]


Also, for built-in entity types, you could use the subproperty "Dataset" to create a dataset:



EntityValue[
EntityClass["Aircraft", "Harlow"],
"Ceiling", "Height", "Length",
"Dataset"
]


enter image description here






share|improve this answer






















  • Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
    – kickert
    2 hours ago










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182117%2fconvert-entity-property-to-string%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










You could use EntityValue instead:



EntityValue["Aircraft","PropertyCanonicalNames"]



"Ceiling", "Crew", "CruiseSpeed", "DesignedBy", "EmptyWeightPerBooster",
"Height", "Image", "Introduced", "Length", "LoadedWeight", "MaidenFlight",
"Manufacturer", "MaxSpeed", "MaxWeight", "Name", "NumberBuilt", "PowerPlant",
"PowerPlantCount", "Range", "RateOfClimb", "Status", "Type", "WingArea",
"WingLoading", "Wingspan"




Another possibility is to use the function CanonicalName:



CanonicalName /@ EntityProperties["Aircraft"]


Also, for built-in entity types, you could use the subproperty "Dataset" to create a dataset:



EntityValue[
EntityClass["Aircraft", "Harlow"],
"Ceiling", "Height", "Length",
"Dataset"
]


enter image description here






share|improve this answer






















  • Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
    – kickert
    2 hours ago














up vote
5
down vote



accepted










You could use EntityValue instead:



EntityValue["Aircraft","PropertyCanonicalNames"]



"Ceiling", "Crew", "CruiseSpeed", "DesignedBy", "EmptyWeightPerBooster",
"Height", "Image", "Introduced", "Length", "LoadedWeight", "MaidenFlight",
"Manufacturer", "MaxSpeed", "MaxWeight", "Name", "NumberBuilt", "PowerPlant",
"PowerPlantCount", "Range", "RateOfClimb", "Status", "Type", "WingArea",
"WingLoading", "Wingspan"




Another possibility is to use the function CanonicalName:



CanonicalName /@ EntityProperties["Aircraft"]


Also, for built-in entity types, you could use the subproperty "Dataset" to create a dataset:



EntityValue[
EntityClass["Aircraft", "Harlow"],
"Ceiling", "Height", "Length",
"Dataset"
]


enter image description here






share|improve this answer






















  • Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
    – kickert
    2 hours ago












up vote
5
down vote



accepted







up vote
5
down vote



accepted






You could use EntityValue instead:



EntityValue["Aircraft","PropertyCanonicalNames"]



"Ceiling", "Crew", "CruiseSpeed", "DesignedBy", "EmptyWeightPerBooster",
"Height", "Image", "Introduced", "Length", "LoadedWeight", "MaidenFlight",
"Manufacturer", "MaxSpeed", "MaxWeight", "Name", "NumberBuilt", "PowerPlant",
"PowerPlantCount", "Range", "RateOfClimb", "Status", "Type", "WingArea",
"WingLoading", "Wingspan"




Another possibility is to use the function CanonicalName:



CanonicalName /@ EntityProperties["Aircraft"]


Also, for built-in entity types, you could use the subproperty "Dataset" to create a dataset:



EntityValue[
EntityClass["Aircraft", "Harlow"],
"Ceiling", "Height", "Length",
"Dataset"
]


enter image description here






share|improve this answer














You could use EntityValue instead:



EntityValue["Aircraft","PropertyCanonicalNames"]



"Ceiling", "Crew", "CruiseSpeed", "DesignedBy", "EmptyWeightPerBooster",
"Height", "Image", "Introduced", "Length", "LoadedWeight", "MaidenFlight",
"Manufacturer", "MaxSpeed", "MaxWeight", "Name", "NumberBuilt", "PowerPlant",
"PowerPlantCount", "Range", "RateOfClimb", "Status", "Type", "WingArea",
"WingLoading", "Wingspan"




Another possibility is to use the function CanonicalName:



CanonicalName /@ EntityProperties["Aircraft"]


Also, for built-in entity types, you could use the subproperty "Dataset" to create a dataset:



EntityValue[
EntityClass["Aircraft", "Harlow"],
"Ceiling", "Height", "Length",
"Dataset"
]


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 29 mins ago

























answered 2 hours ago









Carl Woll

57.3k273149




57.3k273149











  • Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
    – kickert
    2 hours ago
















  • Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
    – kickert
    2 hours ago















Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
– kickert
2 hours ago




Excellent. That works great. I was afraid it wouldn't work with my own EntityStores since they include very limited properties, but everything translates nicely.
– kickert
2 hours ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182117%2fconvert-entity-property-to-string%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

Confectionery