jena使用 java,在使用Jena(java)或RDFLib(python)时,我应该如何确定是以“turtle”还是“xml”的形式打开本体?...

您正在打开RDF文件,而不是本体。在<?xml version="1.0"?>

xml:base="http://example.com/ontology"

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:owl="http://www.w3.org/2002/07/owl#"

xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

[ {

"@id" : "http://example.com/ontology",

"@type" : [ "http://www.w3.org/2002/07/owl#Ontology" ]

}, {

"@id" : "http://example.com/ontology#Person",

"@type" : [ "http://www.w3.org/2002/07/owl#Class" ]

}, {

"@id" : "http://example.com/ontology#Woman",

"@type" : [ "http://www.w3.org/2002/07/owl#Class" ],

"http://www.w3.org/2000/01/rdf-schema#subClassOf" : [ {

"@id" : "http://example.com/ontology#Person"

} ]

} ]

用文本编辑器打开文件,查看文件内容类似的内容,然后选择合适的选项。可以使用this online service将RDF文件从一种序列化格式转换为另一种序列化格式。在

RDF(抽象)语法并不是OWL本体论的唯一语法。其他的很少:<?xml version="1.0"?>

xml:base="http://example.com/ontology"

xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:xml="http://www.w3.org/XML/1998/namespace"

xmlns:xsd="http://www.w3.org/2001/XMLSchema#"

xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

ontologyIRI="http://example.com/ontology">

Prefix(:=)

Prefix(owl:=)

Prefix(rdf:=)

Prefix(xml:=)

Prefix(xsd:=)

Prefix(rdfs:=)

Ontology(

Declaration(Class(:Person))

Declaration(Class(:Woman))

SubClassOf(:Woman :Person)

)Prefix: :

Prefix: owl:

Prefix: rdf:

Prefix: rdfs:

Prefix: xml:

Prefix: xsd:

Ontology:

Class: Person

Class: Woman

SubClassOf:

Person

不过,我们不能使用RDFlib解析这些格式的文件。

您可以使用this online service在这些格式(和RDF格式)之间转换OWL文件。在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值