How to get Least common subsumer in ontology using SPARQL Query?

匿名 (未验证) 提交于 2019-12-03 01:14:02

问题:

How to get Least Common Subsumer(LCS) of individuals in ontology using SPARQL Query? (I want to get common concept of two individuals. Here i have mentioned owl file code)

                     ]>                                                 Bollworms_Pesticides         Bollworms_Pesticide                             Carbamates         Carbamate                             Organophosphateses         Organophosphates                    Pesticides         Pesticide                             Carbaryl                             Ethion      

Answer must be here BollwormsPests_Pesticide:

My Java code is :

package sparql;  import com.hp.hpl.jena.iri.impl.Main; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.rdf.model.InfModel; import com.hp.hpl.jena.rdf.model.Literal; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.reasoner.Reasoner; import com.hp.hpl.jena.reasoner.ReasonerRegistry; import com.hp.hpl.jena.util.FileManager; import com.hp.hpl.jena.sparql.syntax.*; import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern;  public class SPARQLReasoningQuery {      public static void main(String args[]) throws FileNotFoundException, IOException {          BufferedReader br = new BufferedReader(new FileReader("C:\\Users\\Chetan\\Desktop\\Final Cotton Ontology\\query.txt"));         String sparqlQuery;         String[] finalStringArray = new String[
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!