问题描述
dbpedia_2014.owl是一个组织不同概念的猫头鹰文件,其中没有任何个体。
可以通过
"dbpedia_2014.owl" is an owl file organizing different concepts, which contains no individual.It can be download by http://data.dws.informatik.uni-mannheim.de/dbpedia/2014/dbpedia_2014.owl.bz2
问题是当我使用listIndividual()方法时在耶拿(Jena),处理此类小文件(2MB)花费了15分钟以上。代码如下:
The thing is when I use listIndividual() method in Jena, it took more than 15 minutes to handle such a small size(2MB) file. The code is below:
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.ModelFactory;
public class OntModelTest
{
public static void main(String[] args)
{
String fileName1 = new String("owl_qiwang_test/vc-db-1.rdf");
String fileName2 = new String("owl_qiwang_test/dbpedia_2014.owl");
OntModel ontModel = ModelFactory.createOntologyModel();
ontModel.read(fileName2);
long startMil = System.currentTimeMillis();
System.out.println("Start: " + startMil);
ontModel.listIndividuals();
long endMil = System.currentTimeMillis();
System.out.println("Duration: " + (endMil - startMil));
}
}
我想知道为什么要这样做这么长时间。有任何想法吗?
I'm wondering why it takes such a long time to do that. Any ideas?
推荐答案
我有一个类似的问题
如果要使用无需使用推理程序的 listIndividuals()
方法,您可以执行以下操作:
If you want to use the listIndividuals()
method without using a reasoner, you can do:
Model _model = model.getRawModel();
OntModel newModel = new OntModelImpl(OntModelSpec.OWL_MEM, _model);
这篇关于方法listIndividual()与“ DBPedia_2014.owl”一起花费超过15分钟。 (2MB大小的文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!