TweetyProject@Web
Inconsistency Measurement Server status:

Inconsistency Measurement (IM) is a subfield of Knowledge Representation (KR) that deals with quantitative measures of inconsistency. Formally, an inconsistency measure I is a function that assigns to any knowledge base K in propositional logic a value I(K) with the idea that larger values indicate a larger inconsistency in K. In recent years, a lot of proposals have been given of how an inconsistency measure I can be defined. For a more elaborate introduction to inconsistency measures see the Technical Documentation and the references listed therein.

This page complements the theoretical research in IM by providing an experimentation platform for the practical use of inconsistency measures. It is part of the TweetyProject collection of Java libraries for logical aspects of artificial intelligence and knowledge representation which contains implementations of various inconsistency measures. This page serves as documentation to these implementations and provides both a web-based interface for using these implementations and a REST API for integrating them in your own applications.


Online Inconsistency Measurement

You can try out different inconsistency measures directly below by entering a knowledge base in propositional logic in the field Knowledge base. The syntax used on this page is the one of Boolean expressions in most programming languages (such as Java). Each line in the field is a separate formula and each formula can be composed using arbitrary propositions (starting with a letter or "_" and containing only letters, numbers, and "_") and the connectives "&&" (conjunction), "||" (disjunction), and "!" (negation). The operators follow the usual order of preference ("!">"&&">"||") and parentheses "(" and ")" can be used to override this order.

Once a knowledge base has been entered a set of inconsistency measures can be selected (using the button "...") and the inconsistency values of those measures wrt. the given knowledge base are computed using the button "Compute inconsistency values". The computation of a measure can be aborted at any time by pressing the corresponding button (note that for large knowledge bases the computation of some measures can take quite some time). The request is handled on the server and the runtime of a request on the server is also shown besides the actual inconsistency value.

For more information on the individual inconsistency measures see the Technical Documentation.

Knowledge base:
Selected inconsistency measures:   



REST API and source code

The above web interface uses a REST API to remotely compute inconsistency values. If you need to integrate inconsistency measurement in your own applications you can also use this REST API directly. Communication between a client and the server is done using JSON (in UTF-8), the URL of the server is . The API supports two commands:

  1. Get list of inconsistency measures

    Simply send a JSON of the form

    {
       "cmd": "measures",
       "email": "<your e-mail>"
    }

    to the server. The field "email" serves as an identification of your request. I recommend to use a valid e-mail address as it can also be used if issues arise during the computation and I would like to contact you. However, if you feel uncomfortable with that you may also use any other arbitrary identification string.

    In reply to the above request the server will send you back a JSON of the form

    {
       "measures":
        [
          {
             "id": "drastic",
             "label": "Drastic Inconsistency Measure",
             "description": "<some description in HTML>"
          },
          {
             "id": "mi",
             "label": "MI Inconsistency Measure",
             "description": "<some description in HTML>"
          },
          ...
        ]
       "reply":"measures",
       "email":"<your e-mail>"
    }

    which lists all currently available measures with their id.

  2. Retrieve inconsistency value

    Let id be the id of any inconsistency measure currently supported (see above). Then you retrieve the inconsistency value of this measure wrt. some given knowledge base (the format is the same as for web-based interface above) by issuing the request

    {
       "cmd": "value",
       "email": "<your e-mail>",
       "measure": "<id>",
       "kb": "<your knowledge base>",
       "format": "tweety"
    }

    to the server. The field "format" indicates the syntactical format of the knowledge base (currently, only the "tweety"-format as explained above is allowed; other formats may be added in the future). In response to this request the server will reply with a JSON of the form

    {
       "reply": "value",
       "email": "<your e-mail>",
       "measure": "<id>",
       "kb": "<your knowledge base>",
       "format": "tweety",
       "value": "<the inconsistency value>",
       "time": "<time needed to compute the value (in milliseconds)>"
    }

You may also want to look at scripts.js which is the JavaScript file underlying the web-based client on this page in order to see how the API is used from within JavaScript.

The source code of the server and all inconsistency measures can be found in the TweetyProject collection of Java libraries for logical aspects of artificial intelligence and knowledge representation. More specifically, a good entry point for the server software is the package org.tweetyproject.web and for the inconsistency measures this is InconsistencyMeasureFactory.java. All source code is published under the GNU Lesser General Public License version 3.0 except when this is noted otherwise.


Contact

This page and TweetyProject is maintained by Matthias Thimm. If you are interested in participating in the development of TweetyProject or have general comments and/or questions please write an e-mail to matthias@mthimm.de.



Last updated 13.12.2023, Matthias Thimm