使用Jena将owl文件从终端转换为N-Triples会返回一个空文件

时间:2017-07-27 23:56:10

标签: jena owl n-triples lubm

我使用此生成器http://swat.cse.lehigh.edu/projects/lubm/

生成了owl个文件

我想在N-triples中转换文件并在使用

之前完成
$ riot -out N-TRIPLE ~/lubm20/*.owl > lubm20.nt

由于某种原因,我现在得到一个空文件(lubm20.nt)

当我使用

$ rdfcat -out N-TRIPLE ~/lubm20/*.owl > lubm20.nt

我收到此错误

Exception in thread "main" org.apache.jena.riot.RiotException: <file:///root/lubm20/classes\University0_0.owl> Code: 4/UNWISE_CHARACTER in PATH: The character matches no grammar rules of URIs/IRIs. These characters are permitted in RDF URI References, XML system identifiers, and XML Schema anyURIs.
at org.apache.jena.riot.s5ystem.IRIResolver.exceptions(IRIResolver.java:371)
at org.apache.jena.riot.system.IRIResolver.resolve(IRIResolver.java:328)
at org.apache.jena.riot.system.IRIResolver$IRIResolverSync.resolve(IRIResolver.java:489)
at org.apache.jena.riot.system.IRIResolver.resolveIRI(IRIResolver.java:254)
at org.apache.jena.riot.system.IRIResolver.resolveString(IRIResolver.java:233)
at org.apache.jena.riot.SysRIOT.chooseBaseIRI(SysRIOT.java:109)
at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:286)
at org.apache.jena.util.FileManager.readModel(FileManager.java:341)
at jena.rdfcat.readInput(rdfcat.java:328)
at jena.rdfcat$ReadAction.run(rdfcat.java:473)
at jena.rdfcat.go(rdfcat.java:231)
at jena.rdfcat.main(rdfcat.java:206)

生成器会生成一个众所周知的语义Web基准数据集,所以它如何具有

UNWISE_CHARACTER s?

编辑: 对于提出的问题 我用这一行来生成* .owl文件

java edu.lehigh.swat.bench.uba.Generator -onto http://swat.cse.lehigh.edu/onto/univ-bench.owl univ 20

然后将* .owl文件移动到lubm20文件夹

1 个答案:

答案 0 :(得分:0)

我使用rdf2rdf而不是jena

java -jar rdf2rdf-1.0.1-2.3.1.jar /lubmData/lubm100/*.owl lubm100.nt

像魅力一样工作

enter link description here