是否有可能用Stardog推理机解决爱因斯坦的谜语(又名斑马谜题)?即以下查询不会产生预期的结果einsteins_riddle_en:Old_Gold
stardog query myDatabase --reasoning "SELECT ?o WHERE {einsteins_riddle_en:Englishman einsteins_riddle_en:smokes ?o}"
+-------+
| o |
+-------+
+-------+
是否有可能用Stardog推理机解决爱因斯坦的谜语(又名斑马谜题)?即以下查询不会产生预期的结果einsteins_riddle_en:Old_Gold
stardog query myDatabase --reasoning "SELECT ?o WHERE {einsteins_riddle_en:Englishman einsteins_riddle_en:smokes ?o}"
+-------+
| o |
+-------+
+-------+
在进行推理时,您可能需要将数据库配置为使用 DL,默认为 SL,对应于 ALHIO。
要将 stardog 配置为使用 DL,请将数据库选项设置reasoning.type
为DL
.
为了完整起见:按照迈克尔的建议,我最终得到了预期的推断结果
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
非常感谢!