用Stardog推理器解决爱因斯坦的谜团?

时间:2015-06-29 12:53:28

标签: owl reasoning zebra-puzzle stardog

是否可以使用Einstein's riddle推理解决Stardog(又名Zebra拼图)?即以下查询不会产生预期结果einsteins_riddle_en:Old_Gold

stardog query myDatabase --reasoning "SELECT ?o WHERE {einsteins_riddle_en:Englishman einsteins_riddle_en:smokes ?o}"
+-------+
|   o   |
+-------+
+-------+

2 个答案:

答案 0 :(得分:1)

您可能需要将数据库配置为在执行推理时使用DL,默认值为SL,对应于ALHIO。

要配置stardog以使用DL,请将数据库选项reasoning.type设置为DL

答案 1 :(得分:0)

为了完整起见:按照迈克尔的建议,我最终得到了预期的推断结果

nano database.properties
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
reasoning.schema.graphs = default , http\://www.example.org/mySchema
reasoning.punning.enabled = false
reasoning.type=DL
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

stardog-admin db drop   -n myDB
stardog-admin db create -n myDB --config database.properties  einsteins_riddle.ttl 

stardog query myDB --reasoning "SELECT ?p ?o WHERE {einsteins_riddle_en:Englishman ?p ?o}"  
+------------------------------+------------------------------+
|              p               |              o               |
+------------------------------+------------------------------+
| rdf:type                     | owl:Thing                    |
| rdf:type                     | einsteins_riddle_en:Man      |
| einsteins_riddle_en:lives_in | einsteins_riddle_en:house-3  |
| einsteins_riddle_en:smokes   | einsteins_riddle_en:Old_Gold |
| einsteins_riddle_en:drinks   | einsteins_riddle_en:milk     |
| einsteins_riddle_en:owns     | einsteins_riddle_en:snails   |
+------------------------------+------------------------------+
Query returned 6 results in 00:00:10.482

非常感谢!