简体   繁体   English

乌龟中定义的OWL子类

[英]OWL subclass defined in turtle

I try to add a bit of ontology to a (public) RDF dataset (wordnet), specifically I need to differentiate between LexicalEntries for Verbs and Nouns, separated as two subclasses. 我尝试向(公共)RDF数据集(wordnet)添加一些本体,特别是我需要区分动词和名词的LexicalEntries ,并分为两个子类。 Following examples on the web and in the OWL standard, I assumed that 根据网上和OWL标准中的示例,我假设

:LexicalEntryNoun a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty wn:part_of_speech ;
      owl:hasValue wn:noun
    ] .

should build a class LexicalEntryNoun , but the query (in jena fuseki) 应该建立一个类LexicalEntryNoun ,但是查询(在jena fuseki中)

prefix  :  <http://gerastree.at/2017/litonto#> 
   SELECT *  
WHERE { 
   ?s a  :LexicalEntryNoun.
 } 

gives an empty result. 给出一个空结果。 The two URI which should be returned are included in the class represented by a blank node, which stands for the restriction, but are not reported as LexicalEntryNoun as reported in other queries. 应该返回的两个URI包含在由空白节点表示的类中,该节点代表限制,但未如其他查询中所报告的那样报告为LexicalEntryNoun

i am new to OWL and do not find many examples of OWL in turtle syntax. 我是OWL的新手,在乌龟语法中找不到很多OWL的示例。 Where is my error? 我的错误在哪里? Thank you for help! 谢谢你的帮助!

I constructed a very small subset of data which is loaded together with the OWL reasoner http://jena.hpl.hp.com/2003/OWLFBRuleReasoner : 我构造了一个很小的数据子集,将其与OWL推理程序http://jena.hpl.hp.com/2003/OWLFBRuleReasoner一起加载:

@prefix wn31:  <http://wordnet-rdf.princeton.edu/wn31> .
@prefix lemon: <http://lemon-model.net/lemon#> .
@prefix nlp:   <http://gerastree.at/nlp_2015#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix lit:   <http://gerastree.at/lit_2014#> .
@prefix wn:    <http://wordnet-rdf.princeton.edu/ontology#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ns:   <http://www.example.org/ns#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix  :  <http://gerastree.at/2017/litonto#> .

<http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n>
        a                    _:b0 , owl:Thing , rdfs:Resource , lemon:LexicalEntry ;
        lemon:canonicalForm  <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n#CanonicalForm> ;
        lemon:sense          <http://www.lexvo.org/page/wordnet/30/noun/%27s_gravenhage_1_15_00> , <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n#1-n> ;
        wn:part_of_speech    wn:noun ;
        owl:sameAs           <http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n> .

<http://wordnet-rdf.princeton.edu/wn31/%27hood-n>
        a                    _:b0 , owl:Thing , rdfs:Resource , lemon:LexicalEntry ;
        lemon:canonicalForm  <http://wordnet-rdf.princeton.edu/wn31/%27hood-n#CanonicalForm> ;
        lemon:sense          <http://www.lexvo.org/page/wordnet/30/noun/%27hood_1_15_00> , <http://wordnet-rdf.princeton.edu/wn31/%27hood-n#1-n> ;
        wn:part_of_speech    wn:noun ;
        owl:sameAs           <http://wordnet-rdf.princeton.edu/wn31/%27hood-n> .

:LexicalEntryNoun a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty wn:part_of_speech ;
      owl:hasValue wn:noun
    ] .

as already posted on the Apache Jena Users mailing list, the answer is: 正如已经发布在Apache Jena Users邮件列表上的,答案是:

Change the subclassof to an equivalence. 将subclassof更改为等效项。 Since both resources: 由于这两种资源:

http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n http://wordnet-rdf.princeton.edu/wn31/%27s+Gravenhage-n

http://wordnet-rdf.princeton.edu/wn31/%27hood-n http://wordnet-rdf.princeton.edu/wn31/%27hood-n

would fall inside the :LexicalEntryNoun class and show up in his SPARQL query. 会属于:LexicalEntryNoun类,并显示在他的SPARQL查询中。

Regards, Barry 问候,巴里

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

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