实体在实体中的排序 [英] Ordering of entities in an ontology

查看:88
本文介绍了实体在实体中的排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个系统,该系统在本体(通常的三元组存储)中建模某些域数据.

I have a system that models some domain data in an ontology, the usual sort of triplestore.

我一直在寻找一种表达复数和顺序的方法,但是没有通过Google找到任何东西.我的主要用例是,域中的一个实体可以是任务列表(例如,买杂货,做饭,吃饭等),但总的来说,我觉得能够加权"边缘可能是全面有用.

I've been looking around for a way to express plurality and ordering but haven't found anything via the googles. My main use case is something like one entity in the domain can be a list of tasks, (get groceries, cook meal, eat meal, something like that) but in general I feel like having the ability to 'weight' your edges might be useful across the board.

是否有接受的方法?刚去一家四方店?具有普通性和域实体边缘的中间项目(列表→ listitem)?从谓词到权重的谓词?

Is there an accepted way of doing this? Just go to a quadstore? Intermediary items (list → listitem) with edges to an ordinality and a domain entity? Predicates from predicates to Weights?

这是一个例子:

推荐答案

要表示类似图中所示的内容,通常会将其视为n元关系.您应该查看W3C工作说明在语义网上定义N元关系,但简短的版本是您有一个三元关系,并且您正在表达

To represent something like what you've shown in your figure, you'd typically treat it as an n-ary relation. You should have a look at the W3C working note Defining N-ary Relations on the Semantic Web, but the short version is that you've got a 3-ary relation, and you're expressing

hasTask(list,1,socks)
hasTask(list,2,shoes)
hasTask(list,3,leash)

对于其中的每一个,您都有一个资源,通常是一个空白节点,但是它也可以是URI,并且具有将其与各种组件(也许是类型)相关的属性:

For each one of those, you'd have a resource, usually a blank node, but it could be a URI, too, and have properties relating it to the various components, and perhaps a type:

_:rel1 rdf:type :taskItem ;
       :hasList :list ;
       :hasord  1;
       :hasTask :socks .
_:rel2 rdf:type :taskItem ;
       :hasList :list ;
       :hasord  2;
       :hasTask :shoes .
_:rel3 rdf:type :taskItem ;
       :hasList :list ;
       :hasord  3;
       :hasTask :leash .

当然,这里有一些可变性.列表可以与每个任务项相关联,而不是使关系化后的列表,编号和任务为属性值,

There's some variability here, of course. Rather than having the reified relation have the list, number, and task as property values, the list could be related to each task item:

:list :hasTaskItem [ rdf:type :taskItem ;
                     :hasord  1;
                     :hasTask :socks ] ,
                   [ rdf:type :taskItem ;
                     :hasord  2;
                     :hasTask :shoes ] ,
                   [ rdf:type :taskItem ;
                     :hasord  3;
                     :hasTask :leash ] .

基本思想是一样的.或者,您可以使用一个列表.在纯RDF中,您可以使用RDF列表并将数字保留为隐式,例如:

The basic idea is the same though. Alternatively, you could use a list. In pure RDF, you can use RDF lists and leave the numbers implicit, like:

:list :hasTasks ( :socks :shoes :leash ) .

那只是速记

:list :hasTasks [ rdf:first :socks ;
                  rdf:rest [ rdf:first :shoes ;
                             rdf:rest [ rdf:first :leash ;
                                        rdf:rest rdf:nil ]]].

在OWL中,不能使用rdf:first和rdf:rest,但是可以定义自己的类似属性并实现相同的结构.有一个在我的答案中指定列表类的示例ot 我可以为rdf:List成员指定范围吗?(其中有人想要列出所有其元素必须为特定类型的列表).如果您确实采用了这条路线,并且想要恢复列表中每个元素的位置,那么实际上可以使用RDF上的SPARQL查询来完成它,正如我在

In OWL, you can't use rdf:first and rdf:rest, but you can define your own analogous properties and implement the same structures. There's an example of specifying a list class in my answer ot Can I specify a range for rdf:List members? (where someone wanted a list all of whose elements had to be a certain type). If you do take this route, and you want to recover the position of each element in the list, you can actually do it using a SPARQL query over the RDF, as I've described in an answer to Is it possible to get the position of an element in an RDF Collection in SPARQL?.

这篇关于实体在实体中的排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆