N-triples IRI前缀jena

N-triples IRI前缀jena,jena,prefix,n-triples,iri,Jena,Prefix,N Triples,Iri,我想使用前缀表示此nt文件: <www.test.com/a/yan-dang-shan> <www.test.com/a/zhongwenming> <www.test.com/a/yan-dang-shan> . <www.test.com/a/yan-dang-shan> <http://www.w3.org/2000/01/rdf-schema#label> "a" . <www.test.com/a/zhongwenmi

我想使用前缀表示此nt文件:

<www.test.com/a/yan-dang-shan> <www.test.com/a/zhongwenming> <www.test.com/a/yan-dang-shan> .
<www.test.com/a/yan-dang-shan> <http://www.w3.org/2000/01/rdf-schema#label> "a" .
<www.test.com/a/zhongwenming> <http://www.w3.org/2000/01/rdf-schema#label> "b" .
<www.test.com/a/yan-dang-shan> <http://www.w3.org/2000/01/rdf-schema#label> "c" .
cmd中显示了一个错误:

D:\>sparql --data=ceshi.nt --query=ceshi.rq
11:01:42 ERROR riot                 :: [line: 1, col: 1 ] Expected BNode or IRI:
 Got: [DIRECTIVE:prefix]
Failed to load data
我也试过:

@prefix sp: <www.test.com/a/> .
sp:yan-dang-shan sp:zhongwenming sp:yan-dang-shan .
sp:yan-dang-shan <http://www.w3.org/2000/01/rdf-schema#label> "a" .
sp:zhongwenming <http://www.w3.org/2000/01/rdf-schema#label> "b" .
sp:yan-dang-shan <http://www.w3.org/2000/01/rdf-schema#label> "c" .
@前缀sp:。
警司:雁荡山警司:钟文明警司:雁荡山。
sp:雁荡山“a”。
sp:钟文明“b”。
警司:雁荡山“c”。
但它报告了相同的错误,我不知道如何修复它

我应该如何修改以使其正确

任何帮助都将不胜感激。
谢谢

N个三元组没有前缀

海龟有前缀。尝试将数据放入扩展名为“.ttl”的文件中

您可以使用命令行工具
riot
测试数据

D:\>sparql --data=ceshi.nt --query=ceshi.rq
11:01:42 ERROR riot                 :: [line: 1, col: 1 ] Expected BNode or IRI:
 Got: [DIRECTIVE:prefix]
Failed to load data
@prefix sp: <www.test.com/a/> .
sp:yan-dang-shan sp:zhongwenming sp:yan-dang-shan .
sp:yan-dang-shan <http://www.w3.org/2000/01/rdf-schema#label> "a" .
sp:zhongwenming <http://www.w3.org/2000/01/rdf-schema#label> "b" .
sp:yan-dang-shan <http://www.w3.org/2000/01/rdf-schema#label> "c" .