我有一个类Movie,其中有像 2515159 这样的代表电影的实例,还有一个名为 的类Country,其中有像英国、美国、意大利、奥地利和其他国家这样的实例。我还有一个hasCountry与电影中的国家相匹配的角色,例如:
2515159 hasCountry Italy
2515159 hasCountry Austria
Run Code Online (Sandbox Code Playgroud)
(一部电影可以有多个国家)
现在的问题是:
我想创建一个MovienameEuropeanMovie,其中包含仅拥有欧洲国家的个人的实例。
在 protege 创建名为 EuropeanMovie 的 Movie 子类后,我尝试将“等效项”放置为:
Movie and hasCountry only {Austria,Italy, ...all the EU countries...}
Run Code Online (Sandbox Code Playgroud)
还尝试过:
Movie
and hasCountry some (
{Austria,Italy, ...all the EU countries...}
and not {USA, and other non EU countries...} )
Run Code Online (Sandbox Code Playgroud)
但是,上面仅使用关键字不会返回任何内容,而有仅包含欧盟国家的电影(如开头的示例)。
经过大量搜索后,我没有找到太多,但我认为这可能与猫头鹰的开放世界假设有关,但我不明白这一点。
如果有人能给任何建议,那将非常有帮助,谢谢!
我想生成遵循OWL格式的RDF代码.我能够生成一个RDF文件,但我需要将其转换为OWL.下面是我可以生成的RDF.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:ns1="http://example.com/nodetypes/2012/04/24/vehicle/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description rdf:about="http://example.com/nodetypes/2012/04/24/vehicle/2">
<ns1:nodetype_ptr_id>2</ns1:nodetype_ptr_id>
<ns1:slug>vehicle</ns1:slug>
<ns1:last_update>2012-04-24 23:49:36.633689</ns1:last_update>
<ns1:end_publication>2042-03-15 00:00:00</ns1:end_publication>
<ns1:tree_id>2</ns1:tree_id>
<ns1:featured>False</ns1:featured>
<ns1:parent_id>None</ns1:parent_id>
<ns1:content></ns1:content>
<ns1:rating_score>0</ns1:rating_score>
<ns1:rating_votes>0</ns1:rating_votes>
<ns1:start_publication>2012-04-24 23:49:15</ns1:start_publication>
<ns1:level>0</ns1:level>
<ns1:creation_date>2012-04-24 23:49:15</ns1:creation_date>
<ns1:status>2</ns1:status>
<ns1:template>gstudio/nodetype_detail.html</ns1:template>
<ns1:content_org>None</ns1:content_org>
<ns1:excerpt></ns1:excerpt>
<ns1:plural>vehicles</ns1:plural>
<ns1:comment_enabled>True</ns1:comment_enabled>
<ns1:password></ns1:password>
<ns1:title>vehicle</ns1:title>
<ns1:login_required>False</ns1:login_required>
<ns1:pingback_enabled>True</ns1:pingback_enabled>
<ns1:rurl></ns1:rurl>
</rdf:Description>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud) 我有一个漂亮的OWL架构,我写了,我想实际加载到一个三元组,然后添加数据,以便我可以查询它.但我对如何做到这一点有点无能为力.
你看,我有Fuseki/TDB,完全是因为Jena带来了它们,我喜欢Jena API.但我不知道如何将这个架构实际放入三元店.是否有人像传统数据库一样加载模式?我不知道.
我有Fuseki/TDB运行,并按照"入门"教程,但该教程处理将数据加载到默认图表,我不知道如何进一步移动.救命?线索?我应该使用不同的三重店设置和实际详细的操作方法文档吗?
我从网上下载了一个OWL文件,我需要知道它是如何使用Jena编写的.我可以编写简单的RDF文档,但是我无法理解编写OWL文档.OWL文件内容如下.
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<!-- OWL Header Example -->
<owl:Ontology rdf:about="http://www.linkeddatatools.com/plants">
<dc:title>The LinkedDataTools.com Example Plant Ontology</dc:title>
<dc:description>An example ontology written for the LinkedDataTools.com RDFS & OWL introduction tutorial</dc:description>
</owl:Ontology>
<!-- OWL Class Definition Example -->
<owl:Class rdf:about="http://www.linkeddatatools.com/plants#planttype">
<rdfs:label>The plant type</rdfs:label>
<rdfs:comment>The class of plant types.</rdfs:comment>
<rdfs:description> Plant type description </rdfs:description>
</owl:Class>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud) 我想mybrandofmercedes在OWL中设置对类的限制,这在语法上是否正确?我应该有方括号,如下所示?
mynamespace: mybrandofmercedes rdf:type owl:Class;
mynamespace: mybrandofmercedes
[
rdf:type owl:Restriction;
owl:onProperty mynamespace:hasOwner;
owl:hasValue mynamespace: Anders
]
Run Code Online (Sandbox Code Playgroud) 我对它们的真正含义感到困惑.如果我们有一个类肉,那么我们可以将任何非肉类定义为"notMeat"类.所以我们可以在这里使用owl:complementOf.但男人和女人呢?我们可以用owl:complementOf来说"女人"不是"男人"吗?如果没有,那么有没有办法在不使用猫头鹰的情况下描述男女阶级的脱节:disjointWith?
我们可以在两个类中使用属性"disjoint",然后使用此属性作为三元组中的谓词,其主题和对象是"man"和"woman"类来描述不相交吗?
考虑以下示例,http://www.w3.org/TR/owl-ref/#intersectionOf-def.
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#Tosca" />
<owl:Thing rdf:about="#Salome" />
</owl:oneOf>
</owl:Class>
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="#Turandot" />
<owl:Thing rdf:about="#Tosca" />
</owl:oneOf>
</owl:Class>
</owl:intersectionOf>
</owl:Class>
Run Code Online (Sandbox Code Playgroud)
虽然我们理解第二个和第三个的用法,但rdf:parseType="Collection"我对第一个用法感到困惑,就在之后owl:intersectionOf.
在此示例中,值owl:intersectionOf是两个类描述的列表,即两个枚举,两者都描述具有两个个体的类.生成的交集是一个具有一个个体的类,即Tosca,因为这是两个枚举共有的唯一个体.
如果我们遗漏第一个会发生什么rdf:parseType="Collection"?
rdf:parseType="Collection"如果相交的类不是集合,我们还需要使用第一个吗?
在RDF/OWL中,属性和属性的含义是相同的,还是不同?
在RDF中指定模式时,如何指定集合的类型?例如,我有一个名为的房产hobbies.可以有不止一个hobbies.还要求列表中的每个成员必须是类的实例Hobby.虽然我可以指定类似的东西 -
myschema:hobbies
a rdf:Property;
rdfs:domain myschema:Student;
rdfs:range rdf:bag
.
Run Code Online (Sandbox Code Playgroud)
如何指定此集合中的每个成员必须是类型myschema:Hobby?
提前致谢!
我可以知道Apahe JENA是否在Java中支持OWL 2语法?它确实提到在文档(https://jena.apache.org/documentation/ontology/)中,它仅提供了有限的基数限制。我想向专家们证实这一点。
owl ×10
rdf ×8
semantic-web ×4
jena ×3
ontology ×2
jena-rules ×1
owl-api ×1
protege ×1
rdflib ×1
rdfs ×1
terminology ×1
triplestore ×1
turtle-rdf ×1