蛋白质推论 [英] Inferencing in protege

查看:70
本文介绍了蛋白质推论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的本体,如下所示

I have a simple ontology as follows

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY assignment "http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#" >
]>

<rdf:RDF xmlns="http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#"
 xml:base="http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 xmlns:assignment="http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#"
 xmlns:owl="http://www.w3.org/2002/07/owl#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment"/>

<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
 -->

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#channel_of -->
<owl:ObjectProperty rdf:about="&assignment;channel_of">
    <rdfs:domain rdf:resource="&assignment;Channels"/>
    <rdfs:range rdf:resource="&assignment;Television"/>
    <owl:inverseOf rdf:resource="&assignment;has_channels"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#has_channels -->
<owl:ObjectProperty rdf:about="&assignment;has_channels">
    <rdfs:range rdf:resource="&assignment;Channels"/>
    <rdfs:domain rdf:resource="&assignment;Television"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#has_inet_connection -->
<owl:ObjectProperty rdf:about="&assignment;has_inet_connection">
    <rdfs:range rdf:resource="&assignment;InternetConnection"/>
    <rdfs:domain rdf:resource="&assignment;Person"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#has_television -->
<owl:ObjectProperty rdf:about="&assignment;has_television">
    <rdfs:domain rdf:resource="&assignment;Person"/>
    <rdfs:range rdf:resource="&assignment;Television"/>
    <owl:inverseOf rdf:resource="&assignment;ownes_by"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#internet_connection_owned_by -->
<owl:ObjectProperty rdf:about="&assignment;internet_connection_owned_by">
    <rdfs:domain rdf:resource="&assignment;InternetConnection"/>
    <rdfs:range rdf:resource="&assignment;Person"/>
    <owl:inverseOf rdf:resource="&assignment;has_inet_connection"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#ownes_by -->
<owl:ObjectProperty rdf:about="&assignment;ownes_by">
    <rdfs:range rdf:resource="&assignment;Person"/>
    <rdfs:domain rdf:resource="&assignment;Television"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#watched_by -->
<owl:ObjectProperty rdf:about="&assignment;watched_by">
    <rdfs:domain rdf:resource="&assignment;Channels"/>
    <rdfs:range rdf:resource="&assignment;Person"/>
    <owl:inverseOf rdf:resource="&assignment;watches"/>
</owl:ObjectProperty>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#watches -->
<owl:ObjectProperty rdf:about="&assignment;watches">
    <rdfs:range rdf:resource="&assignment;Channels"/>
    <rdfs:domain rdf:resource="&assignment;Person"/>
</owl:ObjectProperty>

<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Data properties
//
///////////////////////////////////////////////////////////////////////////////////////
 -->

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#yh -->
<owl:DatatypeProperty rdf:about="&assignment;yh"/>

<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
 -->

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Advanced -->
<owl:Class rdf:about="&assignment;Advanced">
    <rdfs:subClassOf rdf:resource="&assignment;Coloured"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&assignment;ownes_by"/>
            <owl:allValuesFrom rdf:resource="&assignment;Rich"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Antena -->
<owl:Class rdf:about="&assignment;Antena">
    <rdfs:subClassOf rdf:resource="&assignment;Channels"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#BlackAndWhite -->
<owl:Class rdf:about="&assignment;BlackAndWhite">
    <rdfs:subClassOf rdf:resource="&assignment;Television"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#CRT -->
<owl:Class rdf:about="&assignment;CRT">
    <rdfs:subClassOf rdf:resource="&assignment;Coloured"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&assignment;ownes_by"/>
            <owl:allValuesFrom rdf:resource="&assignment;Mid"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Channels -->
<owl:Class rdf:about="&assignment;Channels"/>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Coloured -->
<owl:Class rdf:about="&assignment;Coloured">
    <rdfs:subClassOf rdf:resource="&assignment;Television"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#High -->
<owl:Class rdf:about="&assignment;High">
    <rdfs:subClassOf rdf:resource="&assignment;InternetConnection"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Internet -->
<owl:Class rdf:about="&assignment;Internet">
    <rdfs:subClassOf rdf:resource="&assignment;Channels"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&assignment;channel_of"/>
            <owl:allValuesFrom rdf:resource="&assignment;Advanced"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#InternetConnection -->
<owl:Class rdf:about="&assignment;InternetConnection"/>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#LCD -->
<owl:Class rdf:about="&assignment;LCD">
    <rdfs:subClassOf rdf:resource="&assignment;Coloured"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&assignment;ownes_by"/>
            <owl:someValuesFrom rdf:resource="&assignment;Rich"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#LED -->
<owl:Class rdf:about="&assignment;LED">
    <rdfs:subClassOf rdf:resource="&assignment;Coloured"/>
    <rdfs:subClassOf>
        <owl:Restriction>
            <owl:onProperty rdf:resource="&assignment;ownes_by"/>
            <owl:someValuesFrom rdf:resource="&assignment;Rich"/>
        </owl:Restriction>
    </rdfs:subClassOf>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Medium -->
<owl:Class rdf:about="&assignment;Medium">
    <rdfs:subClassOf rdf:resource="&assignment;InternetConnection"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Mid -->
<owl:Class rdf:about="&assignment;Mid">
    <rdfs:subClassOf rdf:resource="&assignment;Person"/>
    <owl:disjointWith rdf:resource="&assignment;Rich"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Person -->
<owl:Class rdf:about="&assignment;Person"/>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Rich -->
<owl:Class rdf:about="&assignment;Rich">
    <rdfs:subClassOf rdf:resource="&assignment;Person"/>
</owl:Class>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Television -->
<owl:Class rdf:about="&assignment;Television"/>

<!-- 
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
 -->

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#John -->
<owl:NamedIndividual rdf:about="&assignment;John"/>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#SLTA -->
<owl:NamedIndividual rdf:about="&assignment;SLTA">
    <rdf:type rdf:resource="&assignment;Advanced"/>
</owl:NamedIndividual>

<!-- http://www.semanticweb.org/shadowman/ontologies/2013/5/assignment#Youtube -->
<owl:NamedIndividual rdf:about="&assignment;Youtube">
    <rdf:type rdf:resource="&assignment;Internet"/>
    <watched_by rdf:resource="&assignment;John"/>
</owl:NamedIndividual>
</rdf:RDF>
<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->

现在,我要推断该人John是有钱人.我尝试了各种限制,但只有我得到了约翰是一个人".

Now, I am going to infer that person John is a Rich Person. I tried various restrictions, but only I am getting that 'John is a person'.

我最初的本体论思想是,如果某人从自己的电视上观看互联网频道,那么他拥有一台高级电视,而AdvancedTV只是owned_by有钱人.

My initial ontology idea is this, if person watches an Internet channel from his TV, then he has an advanced TV, advancedTV s are ONLY owned_by Rich people.

在我们的实例中,John观看YouTube,YouTube是一个互联网频道,因此互联网频道仅在高级电视中可用,而高级电视仅由富人拥有,因此John应该是富人.但是如前所述,我不断得到约翰是一个人

Now in our Instance, John watches YouTube, YouTube is an internet channel, so internet channels only available in advanced TV, and advanced TV s are owned only by rich, therefore John should be rich. But as stated earlier, I keep getting that John is a person

推荐答案

我不认为您可以单独使用OWL在当前的类层次结构中表达这一点.如果我理解正确,那么您已经有了公理

I do not think that you can express this in your current class hierarchy using OWL alone. If I understand correctly, you already have the axioms

John watches YouTube
YouTube a InternetChannel
InternetChannel availableOn only AdvancedTV
AdvancedTV inverse owns only RichPerson

,但无法推断出中间推断John a (owns some AdvancedTV),该推断可以让您得出结论John a RichPerson.

but cannot infer the intermediate inference John a (owns some AdvancedTV) that would let you conclude that John a RichPerson.

如果您有其他公理如果某人P观看了某个频道C,那么P拥有一些电视T,并且T上有C,"那么推理将如下所示:由于John观看了YouTube,因此John将会拥有一些可以使用YouTube的电视.由于YouTube是互联网频道,因此电视必须是高级电视.由于约翰将拥有一台高级电视,因此他将是一个有钱人."

If you had the additional axiom "if some person P watches some channel C, then P owns some television T and C is available on T," then the reasoning would work as follows: "Since John watches YouTube, John would have to own some television on which YouTube is available. Since YouTube is an internet channel, the television would have to be an advanced television. Since John would then own an advanced television, he would be a rich person."

但是,我认为公理不能用OWL表示.描述逻辑(OWL是其中的一个)是一阶逻辑的子集,并且只能表达仅使用两个变量的一阶语句.上面的公理似乎需要三个:

However, I do not think that that axiom can be expressed in OWL. Descriptions logics (of which OWL is one) are a subset of first-order logic, and can only express first-order sentences that use only two variables. The axiom above seems to require three:

  • ∀ p,c:手表(p,c)→ (∃ t:拥有(p,t)∧ availableOn(c,t))

我无法以仅使用两个变量的方式来重写它,因此我认为它不能用OWL表示.这意味着您将需要更改本体中的某些内容才能完成这项工作.在我看来,有几种选择:

I have not been able to rewrite that in such a way that it uses only two variables, so I do not think that it can be expressed in OWL. That means that you will need to change something in your ontology to make this work. As I see it, there are a few options:

  • 您可以转变频道类的层次结构,并介绍一些代表频道类型的人.
  • 您可以使用三位关系 watchesOn 来关联一个人,他们观看的频道,以及他们在其上观看频道的电视.
  • You could turn your channel class hierarchy and introduce some individuals to represent channel types.
  • Instead of using a watches relationship that only related persons and channels, you could use a three place relation watchesOn that relates a person, the channel that they watch, and the television on which they watch the channel.

第一个选项的实现可能会更快一些,但是我认为第二个选项从长远来看会更灵活一些,可以更好地表示手头的信息,并且可以使整体表示更简洁.

The first option might be a bit quicker to implement, but I think that the second option is a bit more flexible in the long run, better represents the information at hand, and makes for a cleaner overall representation.

如果您将渠道子类层次结构更改为渠道类型的集合,例如,您说的是YouTube hasChannelType Internet而不是YouTube a InternetChannel,那么您说的是类似

If you changed the channel subclass hierarchy into a collection of channel types, e.g., instead of YouTube a InternetChannel, you were to say YouTube hasChannelType Internet, then you say things like

watches some (hasChannelType value Internet) SubClassOf owns some AdvancedTV

表示如果某人观看具有频道类型互联网的内容,则说明某人拥有一台高级电视."由于John观看YouTube,并且YouTube具有频道类型的Internet,因此John拥有一台高级电视.由于高级电视仅由有钱人所有,因此约翰一定是有钱人.

which says that "if someone watches something that has channel type internet, then that someone owns an advanced television." Since John watches YouTube, and YouTube has channel type Internet, then John owns an advanced television. Since advanced televisions are owned only by rich people, John must be a rich person.

该公理是通用类公理.它的左侧没有简单的类名,而是一个类表达式.这些问题并不经常出现,但正如中所讨论的那样:过于复杂:通用概念包含,它们有时非常有用.
该文章还提供了在Protégé中创建它们的示例.要在Protégé中输入通用类公理,请转到 Active Ontology 标签,然后在其中找到通用类公理标签.然后,您可以逐字输入公理,它应如下所示:

That axiom is a general class axiom. It does not have a simple class name on the left hand side, but rather a class expression. These do not come up all that often, but as discussed in Being complex on the left-hand-side: General Concept Inclusion, they are very useful on occasion.
That article provides an example of creating them in Protégé, as well. To enter a general class axiom in Protégé, go to the Active Ontology tab, and find the General class axioms tab within it. Then you can enter the axiom verbatim, and it should look like this:

或者,您可以将三元关系 watchesOn 替换为二元关系 watches ,该关系将使人与他们所观看的频道和电视相关联他们看.这具有很好的优点,即在一个人拥有多台电视的情况下,某些电视仍然可以是原始电视,而其他电视则是高级电视. (第一个解决方案只是说,如果某人观看互联网频道,那么他们将拥有一台高级电视,但是并不能捕捉到该人使用该电视观看互联网频道的事实.)替换二元关系 watchs(Person,Channel)和第三级 watchesOn(Person,Channel,Television),我们遵循W3C工作组说明

Alternatively, you can replace the binary relation watches with a 3-place relation watchesOn which would associate a person with with the channel that they watch and the television on which they watch it. This has the nice advantage that in the case where an individual owns multiple televisions, some can still be primitive while others are advanced. (The first solution just says that if someone watches an internet channel, then they own an advanced television, but it doesn't capture the fact that the person uses that television to watch the internet channel.) To replace the binary relation watches(Person,Channel) with the tertiary watchesOn(Person,Channel,Television) we follow the approach given in the W3C Working Group Note, Defining N-ary Relations on the Semantic Web. We introduce a class (not a property) watchesOn, each of whose instances represents an occurrence of the watchesOn relationship, and three properties, hasWatcher, hasWatchedChannel, hasWatchedTelevision which relate instance of watchesOn with the person, channel, and television, respectively, that are involved in the relationship. Instances of watchesOn will often be blank nodes. For instance, watchesOn(John,YouTube,JohnsTelevision) can be represented in RDF as:

[] a :watchesOn ;
   :hasWatcher :John ;
   :hasWatchedChannel :YouTube ;
   :hasWatchedTelevision :JohnsTelevision .

通过这种表示,我们可以陈述许多有用的事实.例如,假设某人在电视上观看某物,那么他们拥有该电视,我们断言:

With this kind of representation, we can state lots of useful facts. For instance, to say that if a person watches something on a television, then they own that television, we assert:

inverse(hasWatcher) o hasWatchedTelevision SubPropertyOf owns

这就像在说

hasWatcher(?w,?person)∧ hasWatchedTelevision(?w,?television)→拥有(?person,?television).

hasWatcher(?w,?person) ∧ hasWatchedTelevision(?w,?television) → owns(?person,?television) .

您也可以说观看互联网频道的电视是高级电视.像第一个解决方案一样,这需要通用的类公理,但是在这种情况下,它是:

You can also say that televisions on which internet channels are watched are advanced televisions. This requires a general class axiom, as in the first solution, but in this case, it is:

inverse (hasWatchedTelevision) some (hasWatchedChannel some InternetChannel) SubClassOf AdvancedTV

这就像说

hasWatchedTelevision(?w,?television)∧ hasWatchedChannel(?w,?channel)∧ InternetChannel(?channel)→ AdvancedTV(?电视).

hasWatchedTelevision(?w,?television) ∧ hasWatchedChannel(?w,?channel) ∧ InternetChannel(?channel) → AdvancedTV(?television) .

有了这两个公理,我们就可以推断出John owns JohnsTelevisionJohnsTelevision a AdvancedTV.如果再添加一个阶级公理,即如果一个人拥有一台高级电视,那么他们就是有钱人,即

With both of those axioms in place, we can infer that John owns JohnsTelevision and that JohnsTelevision a AdvancedTV. If we add one more class axiom, namely that if a person owns an advanced television, then they are rich, i.e.,

owns some AdvancedTV SubClassOf RichPerson

然后我们可以推断出John a RichPerson.

这种表示形式很好,因为使用了限制,例如,我们可以断言John在某些电视上观看YouTube,而没有说明他在哪台电视上观看.这需要向John添加类型断言,即:

This kind of representation is nice in that using restrictions, we can assert, for instance, that John watches YouTube on some television, without stating which television he watches it on. This requires adding a type assertion to John, namely:

John a inverse hasWatcher some (hasWatchedChannel value YouTube and
                                hasWatchedTelevision some Television)

这表示约翰在某些电视上观看YouTube,但没有说哪个电视.根据我们较早的公理,推理者仍然可以推断出,无论碰巧是什么电视,它都必须是一台高级电视,而约翰必须拥有它.然后,推理者仍可以推断出约翰是一个有钱人.

This says that John watches YouTube on some television, but does not say which television. By our earlier axioms, the reasoner can still infer that whatever television it happens to be, it must be an advanced television, and John must own it. The reasoner can then still infer that John is a rich person.

这甚至可以更进一步.我们甚至不需要指定John观看过哪个频道,而只是指定它是一个互联网频道:

This works even one step farther. We do not even need to specify which channel John watched, but just that it is an internet channel:

John a inverse hasWatcher some (hasWatchedChannel some InternetChannel and
                                hasWatchedTelevision some Television)

并且推理机仍然可以推断出约翰是有钱人.最重要的是,类表达式

and the reasoner can still infer that John is rich person. To top things off, the class expression

inverse hasWatcher some (hasWatchedChannel some InternetChannel and
                         hasWatchedTelevision some Television)

包括在某些电视上观看某些互联网频道的那些人.推理者可以告诉我们,该类表达式是RichPerson的子类,这意味着这些推断不仅适用于John,而且适用于此类:

consists of those individuals that watch some internet channel on some television. The reasoner can tell us that this class expression is a subclass of RichPerson, which means that these kinds of inferences work not just for John, but anything in this class:

这篇关于蛋白质推论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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