我应该亚级RDF:重新化语句吗?
我想做一个“关于语句的语句”,例如我有userx members of groupy
,并想对此进行声明(例如,他们于5月11日加入)。
因此,我有类似的东西:
statementX a rdf:statement
statementX subject userX
statementX predicate memberOf
statementX object groupY
statementX since "2022-05-11T11:32:52"^^xsd:dateTime
我的问题是,是否值得子分类rdf:语句
? Say 用户groupstatement RDF:subclassof rdf:语句
,然后statementx a userGroupStatement
。
这是有道理的吗,这是人们做的事情吗?还是人们只是使用rdf:语句
,还是创建自己的加入类?利弊是什么?
在我的想法中,至少可以让我建模某种类型的语句具有某些属性,例如,userGroupStatement
具有'afa farter'属性(domain usergroupStatement
,范围XSD:DateTime
)。但是,我可以看到它无济于事,因为userGroupStatement
的主题/谓词/对象仍然可以是任何Resource> Resource
。还是出于建模目的,我应该只制作一个新的语句链接对象,而忘记了RDF:完全说明?
I want to make a reified 'statement about a statement', say I have userX memberOf groupY
and want to make a statement about that (say, that they joined on May 11).
So, I have something like:
statementX a rdf:statement
statementX subject userX
statementX predicate memberOf
statementX object groupY
statementX since "2022-05-11T11:32:52"^^xsd:dateTime
My question is, is it worthwhile subclassing rdf:statement
? Say UserGroupStatement rdf:subClassOf rdf:statement
, then statementX a UserGroupStatement
.
Does that make sense, is it something people do? Or do people just use rdf:statement
, or create their own joining classes? What would be the pros and cons?
In my thinking, it would at least allow me to model that a certain type of statement has certain properties, e.g. that a UserGroupStatement
has a 'since' property (domain UserGroupStatement
, range xsd:datetime
). But then I can see that it doesn't help me specify anything else, because the subject/predicate/object of the UserGroupStatement
could still be any Resource
. Or for modelling purposes should I just make a new statement-like linking object, and forget about rdf:statement altogether?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果适合您的用例,则可以子类
rdf:语句
,但要小心资本s,因为uris对案例敏感。然后,您可以使用OWL进一步限制该子类上的属性,但这只会帮助您进行推理。我假设您想验证数据,因为用例 shacl 更适合。
shacl示例
输出
将示例保存为
test.ttl
,install pyshaclpyshacl test.ttl
,您将获得以下内容:If it suits your use case, you can subclass
rdf:Statement
but be careful about the capital S, as URIs are case sensitive.You could then use OWL to restrict the properties on that subclass further but that would help you only with inference. I assume you want to validate your data, for that use case SHACL or ShEx are better suited.
SHACL Example
Output
Save the example as
test.ttl
, install pySHACL and runpyshacl test.ttl
and you will get the following: