Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-dev] swrltab-project problem

Jake micro_wf at outlook.com
Tue Dec 8 17:34:05 PST 2015


Matthew:            Hi,i have constructed the swrltab-project with maven and git . I do it just step by step according to the following website.https://github.com/protegeproject/swrltab-project/blob/master/README.md            
                
                   I have get the APIs.  I want to programming  manuplate owl ontology  and query it by SQWRL .  But i happen to many runtime errors.  I don't know what is the problem.  Or  i  have packaged the swrl-project with mistake  ?or version  incompatibility ? I am upset with the problem.  the problem is as following:
the source program:
import org.semanticweb.owlapi.apibinding.OWLManager;import org.semanticweb.owlapi.model.IRI;import org.semanticweb.owlapi.model.OWLOntology;import org.semanticweb.owlapi.model.OWLOntologyCreationException;import org.semanticweb.owlapi.model.OWLOntologyManager;import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.swrlapi.exceptions.SWRLRuleEngineException;import org.swrlapi.factory.SWRLAPIFactory;import org.swrlapi.parser.SWRLParseException;import org.swrlapi.sqwrl.SQWRLQueryEngine;import org.swrlapi.sqwrl.SQWRLResult;import org.swrlapi.sqwrl.exceptions.SQWRLException;
public class test {	public static OWLOntologyManager manager;	public static OWLOntology ontology;	public static OWLReasoner reasoner;

	public static void main(String[] args) {		try {//			System.out.println("=================");			manager = OWLManager.createOWLOntologyManager();			ontology = manager.loadOntology(IRI.create("file:/d:/animal.owl"));						SQWRLQueryEngine queryEngine = SWRLAPIFactory					.createSQWRLQueryEngine(ontology);
			SQWRLResult result = queryEngine.runSQWRLQuery("Q1",					"Animal(?a)  -> sqwrl:select(?a)");
//			System.out.println("----------------------------------");			while(result.next()){				System.out.println(result.getNumberOfColumns());				System.out.println(result.getNumberOfRows());			}				} catch (SWRLRuleEngineException 				| OWLOntologyCreationException | SQWRLException | SWRLParseException e) {			e.printStackTrace();		}
	}
}
after compiling and running :           just like this
              configuration:  win10 x86       eclipse4.4.2       jdk1.8_65        
I don't know why the program appear the problem, please help me. I will appreciate you very much.  
Best wishes for you!
Jack







 		 	   		  

2.png (24K) <http://protege-project.136.n4.nabble.com/attachment/4664133/0/2.png>
3.png (23K) <http://protege-project.136.n4.nabble.com/attachment/4664133/1/3.png>
4.png (21K) <http://protege-project.136.n4.nabble.com/attachment/4664133/2/4.png>




--
View this message in context: http://protege-project.136.n4.nabble.com/swrltab-project-problem-tp4664133.html
Sent from the Protege Developer mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-dev/attachments/20151208/3d64a5f3/attachment.html>


More information about the protege-dev mailing list