【问题标题】:OWL2: Is it possible put Annotation on an ObjectIntersectionOf?OWL2:是否可以在 ObjectIntersectionOf 上放置注释?
【发布时间】:2015-06-30 15:22:59
【问题描述】:

我知道我可以在 SubClassOf 关系上添加注释:

SubClassOf(
    Annotation(rdfs:comment "This annotation is valid")
    ObjectIntersectionOf(
        ObjectHasValue(:prop1 :instance1) 
        ObjectHasValue(:prop2 :instance2)
    )
    ObjectHasValue(:prop3 :instance3)
)

然而,我真正想做的是:

SubClassOf(
    ObjectIntersectionOf(
        Annotation(rdfs:comment "This annotation is invalid")
        ObjectHasValue(:prop1 :instance1) 
        ObjectHasValue(:prop2 :instance2)
    )
    ObjectHasValue(:prop3 :instance3)
)

我想要的是创建一个对所有具有 :prop1 :instance1 和 :prop2 :instance 关系的对象有意义的注释,而不是对子类关系。

我不想为 ObjectIntersectionOf 创建一个类,因为在我的真实示例中会有数千个这样的类。

在以下文件上运行颗粒 2.3.1 会产生以下错误:

$ pellet.sh explain draft2.owl

There are 1 input files:
./draft2.owl
Start loading
org.semanticweb.owlapi.io.UnparsableOntologyException: Problem parsing file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl
Could not parse ontology.  Either a suitable parser could not be found, or parsing failed.  See parser logs below for explanation.
The following parsers were tried:
1) RDFXMLParser
2) OWLXMLParser
3) OWLFunctionalSyntaxOWLParser
4) TurtleOntologyParser
5) OWLOBOParser
6) KRSS2OWLParser
7) ManchesterOWLSyntaxOntologyParser


Detailed logs:
--------------------------------------------------------------------------------
Parser: RDFXMLParser
org.xml.sax.SAXParseException; systemId: file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

--------------------------------------------------------------------------------
Parser: OWLXMLParser
org.xml.sax.SAXParseException; systemId: file:/home/users/djogo/Desktop/ontologia%20tnm/draft2.owl; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

--------------------------------------------------------------------------------
Parser: OWLFunctionalSyntaxOWLParser
Encountered "" at line 8, column 9.
Was expecting one of:
     (Line 7)

--------------------------------------------------------------------------------
Parser: TurtleOntologyParser
uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered "" at line 1, column 1.
Was expecting one of:


--------------------------------------------------------------------------------
Parser: OWLOBOParser
org.coode.owlapi.obo.parser.TokenMgrError: Lexical error at line 6, column 12.  Encountered: "\n" (10), after : ""

--------------------------------------------------------------------------------
Parser: KRSS2OWLParser
de.uulm.ecs.ai.owlapi.krssparser.ParseException: Encountered " <NAME> "Prefix "" at line 1, column 1.
Was expecting:
    <EOF> 


--------------------------------------------------------------------------------
Parser: ManchesterOWLSyntaxOntologyParser
Encountered Prefix at line 1 column 1. Expected one of:
    DifferentIndividuals:
    Individual:
    Class:
    AnnotationProperty:
    Import:
    DisjointClasses:
    ObjectProperty:
    Datatype:
    EquivalentClasses:
    SameIndividual:
    Prefix:
    DataProperty:
    DisjointProperties:
    ValuePartition:
 (Line 1)


    at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:236)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:880)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:818)
    at com.clarkparsia.pellet.owlapiv3.OWLAPILoader.parseFile(OWLAPILoader.java:142)
    at org.mindswap.pellet.KBLoader.parse(KBLoader.java:99)
    at com.clarkparsia.pellet.owlapiv3.OWLAPILoader.parse(OWLAPILoader.java:128)
    at org.mindswap.pellet.KBLoader.createKB(KBLoader.java:65)
    at pellet.PelletCmdApp.getKB(PelletCmdApp.java:210)
    at pellet.PelletCmdApp.getKB(PelletCmdApp.java:198)
    at pellet.PelletExplain.parseArgs(PelletExplain.java:204)
    at pellet.Pellet.run(Pellet.java:104)
    at pellet.Pellet.main(Pellet.java:59)

draft2.owl

Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(:=<http://cipe.accamargo.org.br/ontologias/tnm.owl#>)

Ontology(<http://cipe.accamargo.org.br/ontologias/tnm.owl>

SubClassOf(
    ObjectIntersectionOf(
        Annotation(rdfs:comment "This annotation is invalid")
        ObjectHasValue(:prop1 :instance1) 
        ObjectHasValue(:prop2 :instance2)
    )
    ObjectHasValue(:prop3 :instance3)
)

【问题讨论】:

    标签: annotations owl ontology pellet


    【解决方案1】:

    不,我认为你不能这样做。 OWL 2 规范允许对本体、公理和实体进行注释,而复杂的类表达式都不是这些(参见§10 Annotations)。

    Pellet 与此无关,您会从 OWL API FSS 解析器中收到错误,因为您的本体在语法上无效。

    【讨论】:

    • 感谢您的回答。你对如何注释这个有什么建议吗?
    • 我不确定我是否理解您所说的“创建对具有...的所有对象有意义的注释”是什么意思。有什么意义?如果您希望任何被推断为连词实例的个体都以某种方式与特定注释相关,那么除了引入一个新的类名(即新实体)之外,我看不到其他方法连词的超类,然后注释该实体。当然,这可能会减慢分类速度并使您在 Protege(或其他)中的课程视图变得混乱。
    • 假设类表达式 ObjectIntersectionOf ( ObjectHasValue (:prop1 :instance1) ObjectHasValue (:prop2 :instance2a) ) 表示小猫,而 ObjectIntersectionOf ( ObjectHasValue (:prop1 :instance1) ObjectHasValue (:prop2 :instance2b ) ) 指小型犬。我需要知道什么时候是小狗或小猫,但是,我不需要这个类——我只会查询小东西,或者所有大小的猫。由于我会有很多大小和很多动物,我想保存类以获得更好的性能。
    • 听起来您正在寻找查询的注释(DL 查询,即在这种情况下具有复杂类表达式的查询),而不是本体中事物的注释。
    • 如果您多次运行相同的查询,命名您正在查找的类实际上可能会提高性能。不要不先尝试就放弃这个想法。
    猜你喜欢
    • 2012-10-26
    • 1970-01-01
    • 2016-02-04
    • 1970-01-01
    • 2019-09-12
    • 2016-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多