标签: ontology

OWL限制中的枚举

我试图使用Protege3.x在本体中添加属性限制.

我在指定限制内​​的枚举时遇到问题.例如,尝试指定枚举以这种方式限制可能的数据元素:

在此输入图像描述

它将整个表达式视为单个字符串:

在此输入图像描述

在另一个例子中,我试图通过使用多个表达式和它们之间的"或"来解决问题,这似乎是合适的.但在前一个版本中,不允许使用"或".

在此输入图像描述

如何使用枚举来满足这种需求?谢谢!

owl ontology manchester-syntax protege

2
推荐指数
1
解决办法
1119
查看次数

Jena多个rdfs:标签

我是Jena和Owl的新手,我获得了本体论.我可以用Protege 4.2打开它而没有任何问题但是当我尝试用Jena打开它时我得到了: Exception in thread "main" org.apache.jena.riot.RiotException: {E201} Multiple children of property element.

我一直在我的Ontology中查看它可能是什么,我注意到一些元素在一种语言中有多个Label,例如:

<AnnotationAssertion>
    <AnnotationProperty abbreviatedIRI="rdfs:label"/>
    <AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
    <Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">Sukralfat</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
    <AnnotationProperty abbreviatedIRI="rdfs:label"/>
    <AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
    <Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">antepsin</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
    <AnnotationProperty abbreviatedIRI="rdfs:label"/>
    <AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
    <Literal datatypeIRI="&xsd;string">sucralfate</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
    <AnnotationProperty abbreviatedIRI="rdfs:label"/>
    <AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
    <Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">sukralfat</Literal>
</AnnotationAssertion>
Run Code Online (Sandbox Code Playgroud)

这会导致问题吗?我使用的所有代码都与其他本体一起工作,所以我认为它真的来自这个本体.你知道什么可能导致这个例外吗?

编辑

所以我得到了一个最小化的案例,仍然得到同样的错误:

<?xml version="1.0"?>

<!DOCTYPE Ontology [
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>


<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     ontologyIRI="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl">
    <Prefix …
Run Code Online (Sandbox Code Playgroud)

java owl ontology rdfs jena

2
推荐指数
1
解决办法
3016
查看次数

与耶拿的OWL本体谓词逻辑

我无法在我的Ontology中表达以下情况:

假设我有四个人投票和四个投票(因此投票和选民之间存在一对一的映射).人们可以投票赞成或反对.如果我知道三人投票的结果,我应该能够推断出第四人的投票.

重申一下:约翰,鲍勃,玛丽和卡罗尔各自投票.由于有四个人有四票.投票结果是一个平局(2是,2没有).后来推理者确定Bob和John投了反对票.然后推理者应该能够推断出玛丽和卡罗尔的选票是肯定的.

目前我正在使用Jena的java api构建我的本体,并使用Jena推理器进行推理,所以我宁愿使用Jena支持的规则/语义.

owl ontology jena

2
推荐指数
1
解决办法
854
查看次数

在Protege ontology中扩展DBpedia实体

我正在使用Protege开发一个本体,其中包含一些已在DBpedia中描述的内容.假设我想要包括一个"城市"课程,并将"柏林"作为个人.我的柏林将拥有柏林DBpedia所拥有的一些属性,但除此之外我还想"重用"DBpedia的柏林.

我是否需要定义自己的柏林然后使用rdf:seeAlso还是我可以以某种方式导入DBpedia的柏林并添加一些属性?

rdf owl ontology protege dbpedia

2
推荐指数
1
解决办法
2232
查看次数

RDFS:多个域的相同属性

我有一个RDFS本体,有两个完全独立的类:UserVenue.我希望它们都具有通过被称为属性提供的名称hasName,对于a User应该看起来类似于:

<rdf:Property rdf:ID="hasName"> 
    <rdfs:comment> 
        Comment here. Blah blah blah.
    </rdfs:comment>
    <rdfs:domain rdf:resource="#user"/> 
    <rdfs:range rdf:resource="Literal"/> 
</rdf:Property>
Run Code Online (Sandbox Code Playgroud)

但是,如果我也想要它Venue,它不会验证.

我该怎么做呢?

rdf ontology rdfs

2
推荐指数
1
解决办法
2561
查看次数

从RDF节点拉出字符串

我在使用与Jena的SPARQL查询时尝试以更易读的格式获取数据,但是我不知道如何以正确的方式提取数据.至于现在,输出是:

" http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SaucelitoCanyon "

相反,我想把"SaucelitoCanyon"作为输出.

public JenaQuery() {

    String wineRegion = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
            + "PREFIX owl: <http://www.w3.org/2002/07/owl#>\n"
            + "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n"
            + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
            + "PREFIX wine:<http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\n"
            + "SELECT  ?region ?winery \n"
            + "WHERE {?wine wine:locatedIn ?region . \n"
            + "?region wine:locatedIn wine:CaliforniaRegion  . \n"
            + "?wine wine:hasMaker  ?winery}";

    String inputFileName = "wine.rdf";
    // create an empty model

    Model model = ModelFactory.createDefaultModel();
    // use the FileManager to find the input file
    InputStream in;
    in = FileManager.get().open(inputFileName);
    if (in …
Run Code Online (Sandbox Code Playgroud)

java owl ontology sparql jena

2
推荐指数
2
解决办法
710
查看次数

为什么OWA(Open World Assumption)在这种情况下无法推断?

请参阅本书"语义Web技术的基础",第130页中的本体代码.

(本书的精选页面可在Google Books上找到.)

<Person rdf:about="anton">
  <likesToWorkWith rdf:resource="doris" />
  <likesToWorkWith rdf:resource="dagmar" />
</Person>
<Person rdf:about="doris">
  <likesToWorkWith rdf:resource="dagmar" />
  <likesToWorkWith rdf:resource="bernd" />
</Person>
<Person rdf:about="gustav">
  <likesToWorkWith rdf:resource="bernd" />
  <likesToWorkWith rdf:resource="doris" />
  <likesToWorkWith rdf:resource="desiree" />
</Person>
<Person rdf:about="charles" />
<owl:Class rdf:about="FemaleColleagues">
  <owl:oneOf rdf:parseType="Collection">
    <Person rdf:about="dagmar" />
    <Person rdf:about="doris" />
    <Person rdf:about="desiree" />
  </owl:oneOf>
</owl:Class>
<owl:AllDifferent>
  <owl:distinctMembers 
      rdf:parseType="Collection">
    <Person rdf:about="anton" />
    <Person rdf:about="bernd" />
    <Person rdf:about="charles" />
    <Person rdf:about="dagmar" />
    <Person rdf:about="desiree" />
    <Person rdf:about="doris" />
  </owl:distinctMembers>
</owl:AllDifferent>
Run Code Online (Sandbox Code Playgroud)

现在,在同一本书的第132页中,Class2 …

owl ontology

2
推荐指数
1
解决办法
132
查看次数

本体和地名词典之间的区别?

根据gate.ac.uk,地名词典是:

地名词典由一组列表组成,这些列表包含诸如城市,组织,星期几等实体的名称。这些列表用于查找文本中这些名称的出现,例如,用于命名实体的识别任务。“地名词典”一词通常既可用于实体列表集,又可用于处理资源,该资源使用这些列表来查找文本中名称的出现。

这与“本体论”有何不同?

semantic-web ontology gate

2
推荐指数
1
解决办法
203
查看次数

如何使用owlapi从加载的本体中获取所有类?

如何使用owlapi从加载的本体中获取所有类?在这里,我有一个关于如何获取一个类的示例,但是我对访问本体中定义的所有类感兴趣。

    OWLOntologyManager manager = WLManager.createOWLOntologyManager();
    OWLOntology ontology = manager.loadOntology(IRI.create(fileURI));
    OWLDataFactory owlDF = manager.getOWLDataFactory();
//Example to get ONE class, but I want ALL!
    OWLClass stringDocuClass = owlDF.getOWLClass(IRI.create("http://example.com/my_ontology.owl#StringDocu"));
Run Code Online (Sandbox Code Playgroud)

我正在使用Java owlapi 4.2.3(请参阅API:http ://owlapi.sourceforge.net/javadoc/ )

java ontology owl-api

2
推荐指数
1
解决办法
1073
查看次数

Fuseki SPARQL INSERT生成"错误400:SPARQL查询:否'query ='参数"

我尝试将一个人插入我的本体,但得到错误:

Error 400: SPARQL Query: No 'query=' parameter

Fuseki - version 2.4.1 (Build date: 2016-11-04T18:59:20+0000)
Run Code Online (Sandbox Code Playgroud)

这是我的SPARQL INSERT查询#1:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX oo:  <http://www.test.com/test-ontology.owl#> 

INSERT { 
  oo:cap_123 rdf:type oo:MyTours .  
  oo:cap_123 oo:active true . 
  oo:cap_123 oo:title 'Text text text' . 
} 
WHERE { 
  FILTER NOT EXISTS { oo:cap_123 rdf:type oo:MyTours . 
  } 
} 
Run Code Online (Sandbox Code Playgroud)

这是我的INSERT查询#2:

INSERT DATA {
  oo:cap_123 rdf:type oo:MyTours .
  oo:cap_123 oo:active true .
  oo:cap_123 oo:title 'Text text text' .
}
Run Code Online (Sandbox Code Playgroud)

如果我使用Protégé插入个体,那么它可以工作并保存结果,如下所示:

<owl:NamedIndividual rdf:about="http://www.test.com/test-ontology.owl#cap_123"> …
Run Code Online (Sandbox Code Playgroud)

rdf owl ontology sparql fuseki

2
推荐指数
1
解决办法
1187
查看次数

标签 统计

ontology ×10

owl ×7

java ×3

jena ×3

rdf ×3

protege ×2

rdfs ×2

sparql ×2

dbpedia ×1

fuseki ×1

gate ×1

manchester-syntax ×1

owl-api ×1

semantic-web ×1