This repository is used for demo Forward and backward chaining web service application.
This is only server part of the web service, client source code can be reachedhere.
- JDK 1.7
- Maven 3
- Internet connection
- Clone git repo
- Project is based on Maven, thus import project to IntelliJ IDEA by:
- File -> Open... -> pick
pom.xmlfile.
- File -> Open... -> pick
- Change database configuration at
web/WEB-INF/resources.xml - Setup application server (Apache TomEE):
- Download WebProfile, ZIP from: http://tomee.apache.org/downloads.html
- Unzip
- In IntelliJ IDEA: register "TomEE Server" -> local:
- Press "Fix", choose "exploded war" as artifact
- Set page:
http://localhost:8080/rest/get/forward/A/B - Set port:
8080(should be default)
- Run the server, project should start successfully.
- Create DB tables from
db/single_db/single_db_tables - Execute chosen test case from
db/single_db/Test Values - Create Multi DB tables from
db/multi_db_tables/multi_db_test_case_example.txt- Example uses
F5value which identifies as "Forward 5th test case":- Letter represents chaining algorithm (
ForB) - Number represents test case number
- Letter represents chaining algorithm (
- Example uses
Note: Each test case represents a database, in order to add more than one, these steps must be taken:
- First test case use steps 1-3 from DB configuration section
- Delete values from
ruleandrule_antecedenttables (antecedentis optional as in all test cases remains unchanged). - Execute chosen test case from
db/single_db/Test Values - Insert values into Multi DB tables from
db/multi_db_tables/multi_db_test_case_insert_example.txtwithF5as an example test case (same as 3rd step) - Repeat 2-4 if more test cases are needed
- Create DB tables from
db/single_db/single_db_tableson separate DB - Execute chosen test case from
db/single_db/Test Valuesordb/single_db/values[2-4].txt([2-4] represents one of 4 files) - Repeat for all databases
- Import dblink extension by executing
CREATE EXTENSION dblink; - Create Multi DB tables by changing and executing
db/multi_db_tables/multi_db_tables_4_tables.txt- Example uses 4 databases (2 local, 2 external), where dblink function parameters are:
- dbname - DB name
- port - used port
- host - DB host IP
- user - DB username
- pass - DB password
- Server values are identified with names
local1,local2,remote1,remote2which can be changed
- Example uses 4 databases (2 local, 2 external), where dblink function parameters are: