tdbloader
当我使用or将数据加载到 Fuseki 时,我想设置基本 url tdbloader2
。目前本地路径被用作基础,这不是我想要的。例子:
# mytriple.ttl
@prefix owl: <http://www.w3.org/2002/07/owl#> .
<#myitem> a owl:Thing .
./tdbloader --loc /path/to/database /path/to/local/file/mytriple.ttl
# sparql query example
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?subject ?predicate ?object
WHERE {
?subject ?predicate ?object .
?subject a owl:Thing .
}
查询结果:
<file:///path/to/local/file/mytriple.ttl#myitem> rdf:type owl:Thing
这(1)在数据库中不是很干净,(2)当我想在需要指定基础时查询特定项目时,它会导致可维护性问题:
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?subject ?predicate ?object
WHERE {
?subject a owl:Thing .
<file:///path/to/local/file/mytriple.ttl#myitem> ?predicate ?object .
}
或者
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
BASE <file:///path/to/local/file/mytriple.ttl>
SELECT ?subject ?predicate ?object
WHERE {
?subject a owl:Thing .
<#myitem> ?predicate ?object .
}
tdbloader
例如,我如何指定不同的基数<mydomain:myontology#>
?