我想使用空白节点在 Protege 中添加一条语句。例如,如果我将其表示为 Turtle RDF,则它将是 something like :
[
rdf:type rdf:Statement ; #this anonymous resource is a Statement...
rdf:subject ex:Paul ; #...with subject Paul
rdf:predicate ex:running ; #...predicate running
rdf:object "10miles" ; #...and object "10miles"
ex:hasPeriodStart "2018-04-09T10:00:00"^^xsd:dateTime ;
ex:hasPeriodEnd "2018-04-09T12:00:00"^^xsd:dateTime ;
].
有没有办法在 Protege 中做类似的事情(无需创建具有 IRI 的命名个体)?
最佳答案
Protege 不支持空白节点。实现类似目标的一种方法是为空白节点分配临时/单独的命名空间。我会给你一个例子来说明我的意思。假设我有以下海龟语法(我保留了前缀以保持简短),
:jane :firstname "Jane";
:lastname "Doe";
:contactInfo [:phonenumber "011 739 4751";
:email "janedoe@examples.com"] .
然后
[:phonenumber "011 739 4751";
:email "janedoe@examples.com"]
是一个空白节点。这可以使用空白节点 _:janeContactInfo
重写,如下所示:
:jane :firstname "Jane";
:lastname "Doe";
: contactInfo _:janeContactInfo .
_:janeContactInfo :phonenumber "011 739 4751";
:email "janedoe@examples.com" .
这可以用曼彻斯特语法(这是 Protege 中使用的语法)表示为:
ObjectProperty: contactInfo
DataProperty: firstname
DataProperty: lastname
DataProperty: phonenumber
DataProperty: email
Individual: jane
Facts:
ex:firstname, "Jane",
ex:lastname, "Doe",
ex:contactInfo, _janeContactInfo
Individual: _janeContactInfo
Facts:
ex:phonenumber, "011 739 4751"
ex:email, "janedoe@examples.com"
如果需要,您可以将 janeContactInfo
个体放置在临时/单独的命名空间中。
关于rdf - 如何在 Protege 中添加匿名个人?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58979778/