我有一个包含三元组的N3数据集。我希望对此数据集进行散列分区。是否有散列分区程序对OWL/NT/N3数据集进行散列分区?如果没有,你能为我提供一些如何有效地解析文件的代码/提示吗?
发布于 2013-11-06 00:10:05
解析RDF文件与以有效的方式存储结果三元组是完全不同的任务。为了简单地解析RDF文件,您可以使用许多RDF处理库中的一个,这很好用。(StackOverflow确实不是提供工具列表的地方,但http://answers.semanticweb.com上的bunch Which Tools and Libraries do you use to develop Semantic Web applications?列出了一大堆工具。)正如你在评论中澄清的那样:
LUBM使用
(Lehigh University Benchmak)数据生成器生成了一个OWL数据集,并使用在线转换器将其转换为N3格式。现在,我想对数据集进行散列分区,并将每个分区存储在工作计算机上。在实现我自己的库之前,我想知道是否有这样的库。你能告诉我一些可用的图书馆吗?至于效率,我之所以提到它,是因为我拥有的数据集非常大,使用顺序散列分区程序可能会消耗大量时间来完成任务。
这里至少有两件重要的事情需要注意。
N-Triples是一种基于行的格式,每行只有一个三元组。如果您只需要将数据分成三部分并将其发送到其他位置,只需将其转换为N-triple,其中k个三元组将位于k行上。然后,您可以将第一个k/3发送给worker A,将第二个k/3发送给worker B,将最后的k/3发送给worker B。或者,您可以一次迭代一行,将一行发送到A,然后将一行发送到B,然后再将一行发送到C。这是N-Triple的一大优势:拆分或合并数据集非常便宜。例如,考虑下面的DBpedia查询和its results in NTriples。您只需将其分成3行、3行和4行,然后将它们发送给您的员工。
construct where {
dbpedia:Mount_Monadnock ?prop ?obj
}
limit 10 <http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Mountain> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/NaturalPlace> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.opengis.net/gml/_Feature> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/class/yago/GeologicalFormation109287968> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://umbel.org/umbel/rc/Mountain> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Mountain> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Place> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/class/yago/Object100002684> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Place> .
<http://dbpedia.org/resource/Mount_Monadnock> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Thing> .https://stackoverflow.com/questions/19787895
复制相似问题