GithubHelp home page GithubHelp logo

swrlapi-example's Introduction

SWRLAPI Example

This project provides a simple example of a Java application that uses the SWRLAPI to create and execute SWRL rules and SQWRL queries.

You can import this project into your favourite IDE using its Maven-based project creation facility.

Building and Running

To build and run this project you must have the following items installed:

  • Java 11
  • A tool for checking out a Git repository
  • Apache's Maven
  • A Protégé (5.6.0 or higher) distribution. Download here.

Get a copy of the latest code:

git clone https://github.com/protegeproject/swrlapi-example.git 

Change into the swrlapi-example directory:

cd swrlapi-example

Build it with Maven:

mvn clean install

On build completion, your local Maven repository will contain generated swrlapi-example-${version}.jar and swrlapi-example-${version}-jar-with-dependencies.jar files. The ./target directory will also contain these JARs.

You can then run the application as follows:

mvn exec:java

Questions

If you have questions about this library, please go to the main Protégé website and subscribe to the Protégé Developer Support mailing list. After subscribing, send messages to protege-dev at lists.stanford.edu.

swrlapi-example's People

Contributors

martinjoconnor avatar

Stargazers

 avatar Sean P. Myrick V19.1.7.2 avatar amir avatar  avatar Dr. Muhammad Asif Razzaq avatar Daniele avatar

Watchers

Matthew Horridge avatar James Cloos avatar  avatar Timothy Redmond avatar  avatar Tania Tudorache avatar Josef Hardi avatar  avatar Sean P. Myrick V19.1.7.2 avatar

swrlapi-example's Issues

POM file versioning

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?

Using SWRLAPI with generated Java code

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:

  • I also noticed the swrlEngine.createSWRLRule(string, string1); command, but I have many rules and I would want to avoid declaring them again.
  • I have run the SWRL rules of my ontology in Protégé and it gives pretty interesting results, as the rule states. So, the rules are not the problem.

Any idea?

Many thanks in advance.

Santiago

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.