- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用:jena-fuseki-1.1.0,apache-jena-2.12.0
我想要达到的目标和我目前的状态:
我正在尝试使用 dbpedia Persondata(英语和德语)、跨语言链接、图像和维基百科文章链接设置本地 jena-fuseki 服务器
从 wiki.dbpedia.org/Downloads2014 下载为 .nt 文件。我想对它们运行下面的 SPAQRL-Query 并获得与 dbpedia.org/sparql 相同的结果。这个查询应该给我所有在德国斯图加特出生的人,包括他们的姓名、生日、英语和德语描述文本、维基百科链接、图片链接和简短描述。
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?name ?birth ?description_en ?description_de ?wiki ?description ?pic
WHERE {
?person dbo:birthPlace :Stuttgart .
?person dbo:birthDate ?birth .
?person foaf:name ?name .
OPTIONAL{
?person dc:description ?description .
FILTER (LANG(?description) = 'en') .
}
OPTIONAL{
?person foaf:isPrimaryTopicOf ?wiki .
}
FILTER NOT EXISTS{
?person dbo:deathDate ?death .
}
OPTIONAL {
?person rdfs:comment ?description_en .
FILTER (LANG(?description_en) = 'en') .
}
OPTIONAL {
?person rdfs:comment ?description_de .
FILTER (LANG(?description_de) = 'de') .
}
OPTIONAL {
?person dbo:thumbnail ?pic
}
}
ORDER BY ?name
"Abdulsamed Akin"@en 1991-07-17+02:00 "Abdulsamed Akin (born July 17, 1991) is a Turkish-German footballer who plays for Stuttgarter Kickers."@en "Abdulsamed Akin (* 17. Juli 1991 in Stuttgart) ist ein deutscher Fußballspieler türkischer Abstammung."@de http://en.wikipedia.org/wiki/Abdulsamed_Akin "Footballer"@en http://commons.wikimedia.org/wiki/Special:FilePath/Abdulsamed_Akin.jpg?width=300
"Abdulsamed Akin"@en "1991-07-17"^^<http://www.w3.org/2001/XMLSchema#date> [empty] [empty] [empty] [empty] "Footballer"@en [empty]
@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#service1>
) .
# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<#service1> rdf:type fuseki:Service ;
# URI of the dataset -- http://localhost:3030/ds
fuseki:name "ds" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceReadGraphStore "data" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:dataset <#dataset> ;
.
## ----------------------------------
## dataset for default graph
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#dbenGraph> ;
#ja:namedGraph
# [ ja:graphName <http://localhost:3030/dbenGraph> ;
# ja:graph <#dbenGraph> ] ;
ja:namedGraph
[ ja:graphName <http://localhost:3030/dbdeGraph> ;
ja:graph <#dbdeGraph> ] ;
ja:namedGraph
[ ja:graphName <http://localhost:3030/dbinterGraph> ;
ja:graph <#dbinterGraph> ] ;
ja:namedGraph
[ ja:graphName <http://localhost:3030/dbpicGraph> ;
ja:graph <#dbpicGraph> ] ;
ja:namedGraph
[ ja:graphName <http://localhost:3030/dbwikiGraph> ;
ja:graph <#dbwikiGraph> ] ;
.
## ----------------------------------
## the graph's
<#dbenGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_en> ;
tdb:unionDefaultGraph true ;
.
<#dbdeGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_de> ;
tdb:unionDefaultGraph true ;
.
<#dbinterGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_inter> ;
tdb:unionDefaultGraph true ;
.
<#dbpicGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_wiki> ;
tdb:unionDefaultGraph true ;
.
<#dbwikiGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_inter> ;
tdb:unionDefaultGraph true ;
.
## DB of persons in Englisch
<#dbpedia_en> rdf:type tdb:DatasetTDB ;
tdb:location "db" ;
tdb:unionDefaultGraph true ;
.
## DB of persons in German
<#dbpedia_de> rdf:type tdb:DatasetTDB ;
tdb:location "dbde" ;
tdb:unionDefaultGraph true ;
.
## DB of persons inter-language-link
<#dbpedia_inter> rdf:type tdb:DatasetTDB ;
tdb:location "dbinter" ;
tdb:unionDefaultGraph true ;
.
## DB of image-links
<#dbpedia_pic> rdf:type tdb:DatasetTDB ;
tdb:location "dbpic" ;
tdb:unionDefaultGraph true ;
.
## DB of wiki-links
<#dbpedia_wiki> rdf:type tdb:DatasetTDB ;
tdb:location "dbwiki" ;
tdb:unionDefaultGraph true ;
.
@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#service1>
) .
# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
## ---------------------------------------------------------------
## Services.
<#service1> rdf:type fuseki:Service ;
# URI of the dataset -- http://localhost:3030/ds
fuseki:name "ds" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceReadGraphStore "data" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:dataset <#dataset> ;
.
<#dataset> rdf:type ja:RDFDataset ;
ja:defaultGraph <#model_inf> ;
.
<#model_inf> a ja:InfModel ;
ja:baseModel <#dbenGraph> ;
ja:reasoner [
ja:reasonerURL <http://jena.hpl.hp.com/2003/OWLMicroFBRuleReasoner>
]
.
<#dbenGraph> rdf:type tdb:GraphTDB ;
tdb:dataset <#dbpedia_en> ;
tdb:unionDefaultGraph true ;
.
## DB of Persons in Englisch
<#dbpedia_en> rdf:type tdb:DatasetTDB ;
tdb:location "db" ;
tdb:unionDefaultGraph true ;
.
## DB of Persons in German
<#dbpedia_de> rdf:type tdb:DatasetTDB ;
tdb:location "dbde" ;
tdb:unionDefaultGraph true ;
.
## DB of Persons inter-language-link
<#dbpedia_inter> rdf:type tdb:DatasetTDB ;
tdb:location "dbinter" ;
tdb:unionDefaultGraph true ;
.
## DB von Resource auf Image
<#dbpedia_pic> rdf:type tdb:DatasetTDB ;
tdb:location "dbpic" ;
tdb:unionDefaultGraph true ;
.
## DB von Resource auf Wiki
<#dbpedia_wiki> rdf:type tdb:DatasetTDB ;
tdb:location "dbwiki" ;
tdb:unionDefaultGraph true ;
.
最佳答案
绝对没有必要将每个单独的文件加载到单独的 TDB 数据集中,除非您出于某种原因确实希望将数据分开。
从您的问题描述来看,您似乎希望将所有数据组合在一起,因此您最好只创建一个 TDB 数据集并进行查询。 tdbloader
将很高兴允许您将多个文件加载到单个 TDB 数据库中。
至于为什么您当前的设置不起作用,那是因为您只将服务连接到一个 TDB 数据集。
关于sparql - 查询多个 TDB 数据集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26121947/
我正在尝试使用 TDB 使用 Jena 在 Java 中进行查询。所以基本上我得到了一个 n3 文件名 song.n3 并且使用这个文件我想将它与 TDB 一起使用。所以我创建了一个在我的 Java1
我必须为 DBpedia 中的一组 1500 个实体序列化一些特定属性(大约十部电影的属性)。因此,对于每个实体,我运行 sparql 查询以检索它们,之后,对于每个 ResultSet,我使用默认的
使用:jena-fuseki-1.1.0,apache-jena-2.12.0 我想要达到的目标和我目前的状态: 我正在尝试使用 dbpedia Persondata(英语和德语)、跨语言链接、图像和
我正在尝试在 java 中查询 jena TDB。我的代码如下。我的 TDB 数据集似乎是空的,因为 model.size()(其中 model 是数据集默认模型)返回 0。我确定它不为空,不过,因为
我正在提供一个数据集,其中包含来自 Fuseki 2 中 TDB 数据集的 10-20 个命名图。 我想使用推理器对我的数据进行推断。我希望看到的行为是每个图中推断的三元组应该出现在这些图中(尽管如果
这是我的配置文件 # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 ## Fuseki Server c
有没有办法通过 Java API 使用 OWL API 访问 Jena TDB? Jena 似乎不支持 OWL-API。除了 RDF API 之外,它还具有一些便利函数 (OntAPI),用于在被视为
我有一个问题。 我正在尝试在 Jena TDB 上加载我的 RDF 文件。 我写了这段代码: public void store(){ String directory = "C:\\tdb"
我目前正在改编一个在内存模型中与 JENA 一起使用的程序,但当我尝试使用 TDB 存储不同的命名模型时会中断。我认为由此产生的行为是 JENA 中的一个错误,但也许我对同一 TDB 中命名模型的假设
我对 Apache Jena TDB 有疑问。基本上我创建了一个新的数据集,将数据从 RDF/XML 文件加载到名为“http://example.com/model/filename”的命名模型中,
我有一个问题要问你: 我想在我的 Jena TDB TripleStore 上加载一个文件。我的文件很大,大约80Mb,大约700000个三倍RDF。当我尝试加载它时,执行停止工作或需要很长时间。 我
我正在使用 Jena API 在 Jena TDB 中插入和更新三元组。我的设计是这样的,每个插入操作都在事务控制之内。例如: dataset.begin (ReadWrite.WRITE) try
我有一个相当小的图,其中包含大约 50 万个三元组。我还生成了 stats.opt 文件并在相当快的计算机(四核、16gb ram、ssd 驱动器)上运行我的代码。但是对于我在 OP 界面的帮助下构建
public void createDatabase(){ // Make a TDB-backed dataset String directory = "MyDatabase
我正在使用 Jena TDB (1.1.1) 来存储一组命名图。一切正常,但每当我从数据集中检索命名图时,所有 namespace 前缀信息都会丢失。有没有办法保留原始 RDF 图中的 namespa
是否可以运行 Jena TDB database从 Python 应用程序存储大量 RDF 数据?什么是 Python 的原生替代品? 最佳答案 另一种方法是使用 SPARQL 端点,例如 Apach
我想重写我当前的代码以使用交易。但是,根据 Jena 文档 (http://incubator.apache.org/jena/documentation/tdb/tdb_transactions.h
根据 Apache website TDB“可以用作单台机器上的高性能 RDF 存储”。阅读文档我看不到它存储任何内容的位置。是否只是将每个资源存储在定义目录中其自己的文件中,如 this 中所述教程
我有一个 RDF 文件,其中包含 7MB 和约 80k 语句。 启动应用程序时,我有以下代码,用于检索我需要向用户显示的项目列表: NodeIterator iterator =
我正在开发一个使用 Jena 进行存储(带有 TDB 后端)的应用程序。我正在寻找类似 Squirrel 的东西,它可以让我看到正在存储的内容,运行查询等。这似乎是一个明显需要的东西,但我的(可能措辞
我是一名优秀的程序员,十分优秀!