Rename an attribute named oldAttrNameStr to newAttrNameStr belonging to the concept aConcept.
renameattr(aConcept, oldAttrNameStr, newAttrNameStr)
aConcept - type: con
oldAttrNameString - type: str
newAttrNameString - type: str
Nothing
Does not change values of existing attribute, just the name.
if(findconcept(findroot(),"apples"))
rmconcept(findconcept(findroot(),"apples"));
G("apples") = makeconcept(findroot(),"apples");
addstrval(G("apples"),"have","seeds");
renameconcept(G("apples"),"fruit");
"output.txt" << conceptname(G("apples")) << "\n";
renameattr(G("apples"),"have","are");
"output.txt" << attrname(findattr(G("apples"),"are")) << "\n";
"output.txt" << strval(G("apples"),"are") << "\n";
# rmconcept(G("apples"));
This code prints out:
fruit
are
seeds
attrchange, Knowledge Base Functions