-
Notifications
You must be signed in to change notification settings - Fork 0
A collection of tools that can be used to define distributed access control policies using an extension of the Answer Set Programming system DLV. In particular, several external predicates were developed, which can be used via DLV-Complex, with the aim to query remote knowledge bases. A server that handles such queries using its own local DLV-Co…
License
rispoli/secommunity
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
:<<DLV-Server README file Usage: ------ 'dlv-server[.exe] --help' for online help. examples/*.dlv for Knowledge Bases and Queries examples. Differences between *NIX and Windows: - right now the software can work in background only in *NIX environments - in Windows, when writing a path on the command line (e.g.: dlv-server.exe -e X:\\path\\to\\dlv.exe ...), remember to use '\\' as folder separator How to use the examples: ------------------------ Every remote query in these files asks a local instance of the dlv-server to handle its requests; if needed you should change the various 'localhost' in the *_query.dlv files to contact the right address for the instance of the dlv-server that you have available. In the following commands we will use $DLC to indicate the DLV-Complex executable, when you try these on your machine substiture $DLC with the actual path for DLV-Complex; ours was: > DLC=../bin/dl-complex.linux.20100303.beta but yours, of course, can be anything you want. local_*: -------- This example does not require dlv-server, just use the command: > $DLC examples/local_kb.dlv examples/local_query.dlv remote_kb_*, remote_query.dlv: ------------------------------ This example does two remote queries and a local one: > ./dlv-server -e $DLC -k examples/remote_kb_omega1.dlv -d > ./dlv-server -e $DLC -k examples/remote_kb_omega2.dlv -d -p 3334 > $DLC examples/remote_kb_omega.dlv examples/remote_query.dlv > kill `pidof -o %PPID dlv-server` remote_count_*: --------------- This example does two remote aggregate queries: > ./dlv-server -e $DLC -k examples/remote_count_kb_omega1.dlv -d > ./dlv-server -e $DLC -k examples/remote_count_kb_omega2.dlv -d -p 3334 > $DLC examples/remote_count_query.dlv > kill `pidof -o %PPID dlv-server` remote_aggregate_*: ------------------- This example is from the DLV User Manual (http://www.dlvsystem.com/dlvsystem/html/DLV_User_Manual.html#AEN814) and does one query for every (remote) aggregate function available in the system: > ./dlv-server -e $DLC -k examples/remote_aggregate_kb.dlv -d > $DLC examples/remote_aggregate_query.dlv > kill `pidof -o %PPID dlv-server` remote_negation_*: ------------------ This example shows how to make a remote query containing a negated formula and have it intepreted remotely in the correct fashion: > ./dlv-server -e $DLC -k examples/remote_negation_kb.dlv -d > $DLC examples/remote_negation_query.dlv > kill `pidof -o %PPID dlv-server` one_local_at_three_remote_queries_*: ------------------------------------ This example has only one #at statement in the [...]_query.dlv file but, since DLV-Complex has to compute all of the answer set, that gets translated in as many remote inquiries to the server as the number of 'source(...).' facts in the [...]_kb.dlv file: > ./dlv-server -e $DLC -k examples/one_local_at_three_remote_queries_kb.dlv -d > $DLC examples/one_local_at_three_remote_queries_query.dlv > kill `pidof -o %PPID dlv-server` double_remote_*: ---------------- This example shows how a query to a remote knowledge base can trigger another remote query that the latter presents to a third instance of our server: > ./dlv-server -e $DLC -k examples/double_remote_count_kb_omega1.dlv -d > ./dlv-server -e $DLC -k examples/double_remote_count_kb_omega2.dlv -d -p 3334 > ./dlv-server -e $DLC -k examples/double_remote_count_kb_omega3.dlv -d -p 3335 > $DLC examples/double_remote_count_query.dlv > kill `pidof -o %PPID dlv-server` loop_*: ------- This example shows how loops in the remote requests to the various knowledge bases get detected and the further execution of the code promptly stopped to avoid bringing down the machine: > ./dlv-server -e $DLC -k examples/loop_kb_omega1.dlv -d > ./dlv-server -e $DLC -k examples/loop_kb_omega2.dlv -d -p 3334 > $DLC examples/loop_query.dlv > kill `pidof -o %PPID dlv-server` ground_loop_*: -------------- This example shows how different knowledge bases can reference each other and still obtain a meaningful result if the requests do not form a loop: > ./dlv-server -e $DLC -k examples/ground_loop_kb_omega1.dlv -d > ./dlv-server -e $DLC -k examples/ground_loop_kb_omega2.dlv -d -p 3334 > $DLC examples/ground_loop_query.dlv > kill `pidof -o %PPID dlv-server` multiple_as_*: -------------- This example showcases the capability to handle disjunctive KBs with multiple ASs: > ./dlv-server -e $DLC -k examples/multiple_as_kb.dlv -d > $DLC examples/multiple_as_query.dlv > kill `pidof -o %PPID dlv-server` N.B.: ----- This README file is composed using Donald E. Knuth's literate programming approach: if you are on a *NIX system and have compiled correctly all of our software then you can issue 'bash README' to run the examples above (provided that the executable for DLV-Complex is in the right place). End of the README file for: DLV-Server cat README | grep '^\s\s*> ' | sed -e 's/^\s*> //' | bash
About
A collection of tools that can be used to define distributed access control policies using an extension of the Answer Set Programming system DLV. In particular, several external predicates were developed, which can be used via DLV-Complex, with the aim to query remote knowledge bases. A server that handles such queries using its own local DLV-Co…
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published