如何通过ontext在GraphDB中成功上传饼图文件

时间:2019-03-11 05:13:13

标签: hidden-field graphdb

我有一个饼图文件,用于在GraphDB ontext中进行推理。我正确编写了规则集。在上传文件时似乎没问题。但是,在创建存储库时,它会显示“无效的规则集文件”。请上传有效的“”,我认为问题与文件中存在的隐藏字符有关。如果出现这样的字符怎么走。我的文件内容是:

Prefices
{
rdf : http://www.w3.org/1999/02/22-rdf-syntax-ns#
owl : http://www.w3.org/2002/07/owl#
abc : http://www.xyzabc.com/schema/abcentity#
}

Axioms
{
<abc:isLocatedIn> <rdf:type> <owl:ObjectProperty>
}

Rules
{

Id: isLocatedInHierarchy

a <abc:isLocatedIn> b [Constraint a != b]
b <abc:isLocatedIn> c [Constraint b != c]

a <abc:isLocatedIn> c [Constraint a != c]        

}

2 个答案:

答案 0 :(得分:1)

  

文件中存在隐藏字符

您是指Unicode BOM标记吗?得到一个可以保存而没有这种标记的编辑器(强烈建议使用Akelpad:http://akelpad.sourceforge.net/),或者仅保存为ASCII。

顺便说一句,用每个属性规则编写PIE文件不是一个好主意。相反,对可传递属性使用通用规则,然后在本体中声明abc:isLocatedIn可传递。包含该规则的最便宜的内置变量是rdfsPlus-optimized。如果选择它,那么您将添加到本体中

abc:isLocatedIn a owl:TransitiveProperty.

但是,最好保留一个“阶梯”属性abc:isLocatedIn,然后在其上保留一个传递属性,例如abc:isLocatedTransitive

abc:isLocatedTransitive a owl:TransitiveProperty.
abc:isLocatedIn rdfs:subPropertyOf abc:isLocatedTransitive.

最后,有一种更有效的方法来计算传递闭包,请参见http://rawgit2.com/VladimirAlexiev/my/master/pubs/extending-owl2/index.html#sec-3-1

abc:isLocatedTransitive ptop:transitiveOver abc:isLocatedIn.
abc:isLocatedIn rdfs:subPropertyOf abc:isLocatedTransitive.

答案 1 :(得分:0)

我还能够成功上传您的.pie文件。可能问题与计算机的语言环境或环境中的某些问题有关。如果您使用Windows,则Notepad ++似乎是一个合理的选择。我想有一个选项可以查看所有隐藏的字符,但我从未使用过。如果您使用的是Linux,则有很多选择,甚至包括vim或nano这样的选项也可以。