问题:
如何在 func stringOutput(input: String) -> String {
var result = ""
var lastCharacter: Character
var count = 0
var countDict: [String: Int] = [:]
for item in input {
countDict[item] as Character
}
return result
}
代码中将Schema.org property
类型嵌套在Object Type
内?
上下文:
我有一个网站,其中包含有关人物传记的网页。我有一个Schema.org Person对象类型的经过验证的JSON-LD
代码。
我想扩展代码以包括在某个角色之前和之后的人员。例如,如果该页面关于某个城市的市长,我想添加前任和后任市长。
我可以找到的最接近的属性是前任市长(link)的JSON-LD
和下任市长的follows
(link)。
问题:
对属性followee
的验证没有问题,但如果将follows
直接放在followee
类型下,则错误,因为它需要Person
类型。
Followaction
解决方法:
我试图嵌套代码,但无法成功完成。 例如:
The property @followee is not recognized by Google for an object of type Person.
我厌倦了其他几种变体,但都导致了错误。是否对代码进行了可行的更正,或者实现目标的替代方法?