简体   繁体   English

使用 Protege 在 OWL 中分配序列

[英]Assigning sequence in OWL using Protege

I have this axiom in my ontology我的本体中有这个公理

:drug :givenAs (({dose1}) or ({dose2}) or ({dose3}))
 and (not ({dose4}))

The syntax isn't correct as per Turtle, but I hope you get the point.根据 Turtle 的语法不正确,但我希望你明白这一点。

I'd like to assert that dose1 is followed by dose2 followed by dose3.我想断言,dose1 之后是dose2,然后是dose3。

I checked out Modelling sequence order in OWL-DL ontology but it doesn't exactly solve my case.我检查了OWL-DL 本体中的建模序列顺序,但它并没有完全解决我的情况。 That is because I'm dealing with individuals only, not classes in this case.那是因为在这种情况下我只处理个人,而不是类。

What is an elegant way to assert the sequence?断言序列的优雅方式是什么?

The axiom is for identifying errors in data records.该公理用于识别数据记录中的错误。 For instance, I'd like the ontology to point out an error if there's :drug :givenAs :dose2 .例如,如果存在:drug :givenAs :dose2 . ,我希望本体指出错误:drug :givenAs :dose2 . without :drug :givenAs :dose1 .没有:drug :givenAs :dose1 .

UPDATE 1更新 1

I tried the hasNext property as suggested.我按照建议尝试了hasNext属性。 I can link the individuals using the property.我可以链接使用该属性的个人。 However, I'm not sure this applies to my context:但是,我不确定这是否适用于我的上下文:

Class: SequenceItem
    EquivalentTo: 
        hasNext only SequenceItem

I do not have a class and want to avoid it if appropriate.我没有课程,如果合适,我想避免它。 How do I still assign sequence?我仍然如何分配序列?

UPDATE 2更新 2

I added the class axiom as mentioned.我添加了前面提到的类公理。 The reasoners find no error.推理者没有发现错误。 However, they also do not identify erroneous records where dose2 precedes dose1.然而,他们也没有识别剂量 2 在剂量 1 之前的错误记录。 I asserted that the class Dose is equivalent to:我断言Dose类相当于:

Dose
and hasNext only Dose

The issue, I think, is I don't assert anywhere that no dose2 is possible before dose1 and no dose3 is possible before dose2 and so forth.我认为,问题是我没有在任何地方断言在剂量 1 之前不可能有剂量 2,在剂量 2 之前不可能有剂量 3,等等。

The addition of a hasNext property ala Modelling sequence order in OWL-DL ontology would work just as well. 在 OWL-DL 本体中添加hasNext属性 ala Modeling sequence order也能正常工作。 Just assert the hasNext on the individuals (see last para).只需在个人上声明hasNext (见最后一段)。

Another way to specify ordering is through an RDF list, ie (:dose1 ;dose2 :dose3) .另一种指定排序的方法是通过 RDF 列表,即(:dose1 ;dose2 :dose3) The list is an ordered enumerated list and you can use rdf:first/rdf:rest to query elements in order.该列表是一个有序的枚举列表,您可以使用 rdf:first/rdf:rest 按顺序查询元素。

The last idea is to specify an ordering property.最后一个想法是指定一个排序属性。 Similar to the hasList solution, a sequenceNum property could be added an attached to the dose objects, eg:hasList解决方案类似,可以将sequenceNum属性添加到剂量对象上,例如:

:dose1 :sequenceNum 1 .
:dose1 :sequenceNum 2 .
:dose1 :sequenceNum 3 .

Then use the numbering to specify which occurs before the other.然后使用编号来指定哪个出现在另一个之前。

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

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