逻辑编程和自动定理证明(ATP)之间有什么区别(例如使用E-Prover,Spass或Princess)?
我搜索了很多,我发现的唯一信息是ATP是逻辑编程的先驱.但我没有看到差异.但我想这不仅仅是语法.
我使用SPARQL查询我的本体,但是我观察到性能下降,我请求的查询越多,它就越糟糕.一开始PC需要大约150ms来处理查询,30查询需要670ms,而查询需要超过7秒!它取决于查询和/或本体,但直到现在,我可以在每个本体中找到它.
行"ResultSetRewindable r = ResultSetFactory.copyResults(results);" 负责时间泄漏,但也通过避免线路导致类似的行为.
我使用了披萨本体(https://ontohub.org/pizza/pizza.owl)和以下代码.另外,我使用了Jena 2.13版.
有谁知道如何解决它?
public static void main(String[] args) throws UnsupportedEncodingException, InterruptedException{
OntModel model = ModelFactory.createOntologyModel();
String OWLPath = "pizza.owl";
String queryString = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX pz: <http://www.co-ode.org/ontologies/pizza/pizza.owl#> SELECT DISTINCT ?x WHERE { ?b owl:someValuesFrom pz:MozzarellaTopping. ?x rdfs:subClassOf ?b. ?x rdfs:subClassOf* pz:Pizza.}";
for(int j=0; j<100;j++){
double starttime = System.currentTimeMillis();
InputStream in = FileManager.get().open(OWLPath);
if (in == null) {
throw new IllegalArgumentException("File: " + …Run Code Online (Sandbox Code Playgroud)