简体   繁体   English

隐式具体化的简单格式

[英]Simple Format for Implicit Reification

Is there any RDF serialization format (like Notation 3 ) that supports implicit reification for easily representing statements about statements? 是否有任何RDF序列化格式(如表示法3 )支持隐式具体化以轻松表示有关语句的语句?

For example, say I have the statement "Mary bought a house", which I would represent in N3 like: 例如,假设我有“玛丽买了房子”这句话,我将在N3代表:

:Mary :bought-a :house .

Now say I wanted to add meta-statements about this statement, such as "I heard this from Rob." 现在说我想添加关于这个陈述的元陈述,例如“我从Rob那里听到了这个”。

Intuitively, I'd like to be able to represent this by writing something like: 直观地说,我希望能够通过写下以下内容来表示:

:Mary :bought-a :house .
    :heard-by :me .
    :heard-from :Rob .

However, I think the way this would "officially" be represented in N3 would be something like: 但是,我认为这将在N3中“正式”表示的方式如下:

[ a rei:Statement;
  rei:subject [rei:uri :Mary];
  rei:predicate [rei:uri :bought-a];
  rei:object [rei:value :house]
] [
    :heard-by :me;
    :heard-from :Rob;
] .

which is obviously a bit more complicated and harder to read. 这显然有点复杂,难以阅读。 It gets even more complicated if I need to make statements about statements about statements. 如果我需要声明有关语句的语句,它会变得更加复杂。 eg "I heard this from Rob, while Rob was walking down the street". 例如“我从罗布那里听到这个,而罗布正走在街上”。

What would be the correct and simplest way to represent this in an RDF serialization format? 在RDF序列化格式中表示这一点的正确和最简单的方法是什么?

I would try to avoid implicit reification if possible, for a number of reasons but more specifically because: 如果可能的话,我会尽量避免隐式具体化,原因有很多,但更具体地说是因为:

  • accessing the data is harder, 访问数据更难,
  • the size of the dataset increases drastically as every triple becomes 4 triples, 随着每个三元组变为4个三元组,数据集的大小急剧增加,
  • SPARQL queries that work on a non-reified dataset will not work on a reified one, 处理非实际数据集的SPARQL查询将不适用于具体化的数据集,
  • reasoners will mess up things or will not work. reasoners将陷入困境或无法工作。

After having coded myself a number of Semantic Web applications, the very few times that I have used implicit reification I have regretted. 在为自己编写了许多语义Web应用程序之后,我使用隐式具体化的次数很少,我后悔了。

In your case I would try to model it with explicit reification by using a Blank Node as intermediate joint point for heard-by and heard-from predicates. 在你的情况我会尝试用它与明确的具体化模型Blank Node作为中间连接点heard-byheard-from谓词。 Something like (in RDF/Turtle): 像(在RDF / Turtle中):

@prefix : <http://somedata.org/id/> .
:Mary :bought-a [ 
     a :House;
    :heard-by :me;
    :heard-from :Rob ] .

In plain RDF/ntriples this is is the same as (transformed with rapper ): 在普通的RDF / ntriples中,这与(用说唱歌手转换)相同:

<http://somedata.org/id/Mary> <http://somedata.org/id/bought-a> _:genid1 .
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://somedata.org/id/House> .
_:genid1 <http://somedata.org/id/heard-by> <http://somedata.org/id/me> .
_:genid1 <http://somedata.org/id/heard-from> <http://somedata.org/id/Rob> .

As you can see Mary bought something of rdf:type House , and you heard it from Rob and Yourself . 正如你所看到Mary买了一些rdf:type House ,你from RobYourself那里听到了。

I find this solution cleaner and less costly than implicit reification. 我觉得这个解决方案更清洁,成本低于隐式具体化。 I hope this helps. 我希望这有帮助。

I would use named graphs and wouldn't be scared to put a single statement in a graph. 我会使用命名图,不会害怕在图中放一个语句。 You could put the original statement in a graph and then the meta-statements would be about that graph rather than the statement within. 您可以将原始语句放在图形中,然后元语句将是关于该图形而不是其中的语句。 Those can be put into one or more other graphs and then if you need some crazy meta-meta-statements then you can deal with it in the same way as the original meta-statement by referencing the graphs that contain the meta-statements. 这些可以放入一个或多个其他图形中,然后如果您需要一些疯狂的元元声明,那么您可以通过引用包含元语句的图形以与原始元语句相同的方式处理它。

When reasoning or using the graphs later, you may need to "collapse" all of your leaf/non-meta graphs into a single graph. 在稍后推理或使用图表时,您可能需要将所有叶子/非元图形“折叠”为单个图形。 This is also a good way to reason about meta-data in order to discover which graphs to "collapse" into your trusted statements to do actual reasoning over. 这也是推理元数据的好方法,以便发现哪些图形“崩溃”到您的可信任语句中以进行实际推理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM