protegeproject / swrlapi-example Goto Github PK
View Code? Open in Web Editor NEWExample SWRLAPI application
License: Other
Example SWRLAPI application
License: Other
Hi, I noticed the dependency version is not indicated for owlapi and for the slf4j libraries on the POM file. Is there suppose to be a version indicated for these libraries?
Hi,
I am trying to use the SWRLAPI to run some rules/inferences in a dynamic application with Java.
I firstly designed my ontology, then, I exported the Java code using the Protégé code generation plugin. I made an application with the generated classes and they are ok, but when trying to use the SWRLEngine to perform the inferences (from the SWRL rules) it throws nothing important (compared to the results obtained in Protégé).
I am not sure if the generated Java code contains the SWRL rules embedded, or what can I do to use them in Java?
SWRLRuleEngine swrlEngine = SWRLAPIFactory.createSWRLRuleEngine(ontology);
swrlEngine.infer();
Set<OWLAxiom> inferredOWLAxioms = swrlEngine.getInferredOWLAxioms();
for(OWLAxiom axiom : inferredOWLAxioms)
{
System.out.println("Inferred axiom: " + axiom);
}
--------------------------------------------------------------------------------------
Output: Inferred axiom: SameIndividual(<send-piece-material-data-service> )
Inferred axiom: SameIndividual(<request-piece-material-data-function> )
Inferred axiom: SameIndividual(<piece-data> )
Inferred axiom: SameIndividual(<semantic-application-interoperability> )
Inferred axiom: SameIndividual(<product-asset-b> )
Inferred axiom: SameIndividual(<application-complex-discrete-dynamics-model> )
Inferred axiom: SameIndividual(<s1_ba> )
Inferred axiom: SameIndividual(<process-c> )
Inferred axiom: SameIndividual(<resource-state-4> )
...
All the inferences are similar, not important information is given.
P.S:
swrlEngine.createSWRLRule(string, string1);
command, but I have many rules and I would want to avoid declaring them again.Any idea?
Many thanks in advance.
Santiago
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.