[英]How to model a class that is a collection of individuals of another class in Protege
[英]How can I add anonymous individuals in Protege?
我想使用空白节点在 Protege 中添加一条语句。 例如,如果我将它表示为 Turtle RDF,它将类似于:
[
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 ,这是一个基于ONT-API的分支,可以通过 SPARQL 选项卡(通过INSERT
和BNODE()
)实现。 虽然 RDF-Protege 目前是一种发展潜力较弱的“宠物项目”,但我希望这个功能对某人有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.