方法listIndividual()与“ DBPedia_2014.owl”一起花费超过15分钟。 (2MB大小的文件) [英] Method listIndividual() takes more than 15 mins with "DBPedia_2014.owl" (2MB-size file)

查看:104
本文介绍了方法listIndividual()与“ DBPedia_2014.owl”一起花费超过15分钟。 (2MB大小的文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dbpedia_2014.owl是一个组织不同概念的猫头鹰文件,其中没有任何个体。
可以通过 http://下载data.dws.informatik.uni-mannheim.de/dbpedia/2014/dbpedia_2014.owl.bz2

"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大小的文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆