我正在学习Terry Halpin的名为logical data modeling的教程(链接如下),但无法插入数据。https://www.brcommunity.com/articles.php?id=b760
代码如下:
addblock 'Country(c), hasCountryCode(c:cc) -> string(cc).
Language(l), hasLanguageName(l:ln) -> string(ln).
isLarge(c) -> Country(c).
officiallyUses(c, l) -> Country(c), Language(l).
isMultilingual(c) <- officiallyUses(c, l1), officiallyUses(c, l2), l1 != l2.'
exec'
+isLarge("AU"), +isLarge("CA"), +isLarge("FR"), +isLarge("US").
+officiallyUses("AU", "English"), +officiallyUses("CA", "English").
+officiallyUses("CA", "French"), +officiallyUses("FR", "French").
+officiallyUses("LU", "French"), +officiallyUses("LU", "German").
+officiallyUses("LU", "Luxembourgish").
+officiallyUses("US", "English"), +officiallyUses("VA", "Italian"). '错误消息:

有没有人能帮我理解一下哪里出了问题?
发布于 2017-08-24 20:21:51
当Terry编写该教程时,LogicBlox/datalog/LogiQL语言允许一些已被弃用的语法快捷方式。模式的第一个块在编写时是正常的。第二个execute断言块现在需要显式声明实体和引用模式谓词。下面是一个工作示例:
+Country(c),
+isLarge(c),
+hasCountryCode(c:"AU"),
+Language(l),
+hasLanguageName(l:"English"),
+officiallyUses(c, l).要断言+isLarge(c),还需要(或之前)断言实体及其引用模式+Country(c), +hasCountryCode(c:"AU").
同样的模式也适用于在断言+officiallyUses(c, l).时或之前断言语言实体
https://stackoverflow.com/questions/45856660
复制相似问题