- Notifications
You must be signed in to change notification settings - Fork0
The OpenCog hypergraph database, query system and rule engine
License
nko5/atomspace
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The OpenCog AtomSpace is a knowledge representation (KR) database andthe associated query/reasoning engine to fetch and manipulate that data,and perform reasoning on it. Data is represented in the form of graphs,and more generally, as hypergraphs; thus the AtomSpace is a kind ofgraph database, the query engine is a general graph re-writing system,and the rule-engine is a generalized rule-driven inferencing system.The vertices and edges of a graph, known as "Atoms", are used torepresent not only "data", but also "procedures"; thus, many graphsare executable programs as well as data structures.
There are pre-defined Atoms for many basic knowledge-representation andcomputer-science concepts. These include Atoms for relations, such assimilarity, inheritance and subsets; for logic, such as Boolean and, or,for-all, there-exists; for Bayesian and other probabilistic relations;for intuitionist logic, such as absence and choice; for parallel(threaded) synchronous and asynchronous execution; for expressions withvariables and for lambda expressions and for beta-reduction and mapping;for uniqueness constraints, state and a messaging "blackboard"; forsearching and satisfiability and graph re-writing; for the specificationof types and type signatures, including type polymorphism and typeconstruction (dependent types and type variables TBD).
Because of these many and varied Atom types, constructing graphs torepresent knowledge looks kind-of-like "programming"; the programminglanguage is informally referred to as "Atomese". It vaguely resemblesa strange mashup of SQL (due to queriability), prolog/datalog (due tothe logic and reasoning components), lisp/scheme (due to lambdaexpressions), haskell/caml (due to the type system) and rule engines(due to the graph rewriting and forward/backward chaining inferencesystems). This "programming language" is NOT designed for use byhuman programmers (it is too verbose and awkward for that); it isdesigned for automation and machine learning. That is, like anyknowledge representation system, the data and procedures encodedin "Atomese" are meant to be accessed by other automated subsystemsmanipulating and querying and inferencing over the data/programs.Also, viewed as a programming language, it can be very slow andinefficient and not scalable; it was not designed with efficiencyand programming tasks in mind, nor with scalability; but rather, itwas designed to allow the generalized manipulation of networks ofprobabilistic data by means of rules and inferences and reasoningsystems. It extends the idea of probabilistic logic networks to ageneralized system for automatically manipulating and managing data.
The use of the AtomSpace, and the operation and utility of Atomese,remains a topic of ongoing research and change, as various dependentsubsystems are brought online. These include machine learning,natural language processing, motion control and animation, planningand constraint solving, pattern mining and data mining, questionanswering and common-sense systems, and emotional and behavioralpsychological systems. Each of these impose sharply conflictingrequirements on the system architecture; the AtomSpace and "Atomese"is the current best-effort KR system for satisfying all these variousneeds in an integrated way. It is likely to change, as the variouscurrent short-comings, design flaws, performance and scalabilityissues are corrected.
The main project site is athttp://opencog.org
Theexamplesdirectory contains demonstrations of the various components of theAtomSpace, including the python and scheme bindings, the patternmatcher, the rule engine, and many of the various different atom typesand their use for solving various different tasks.
To build the OpenCog AtomSpace, the packages listed below are required.With a few exceptions, most Linux distributions will provide thesepackages. Users of Ubuntu 14.04 "Trusty Tahr" may use the dependencyinstaller at/scripts/octool
. Users of any version of Linux mayuse the Dockerfile to quickly build a container in which OpenCog willbe built and run.
- C++ utilities package.
- http://www.boost.org/ |
apt-get install libboost-dev
- Build management tool; v2.8 or higher recommended.
- http://www.cmake.org/ |
apt-get install cmake
- Common OpenCog C++ utilities.
- http://github.com/opencog/cogutils
- It uses exactly the same build procedure as this package. Be sureto
sudo make install
at the end.
- Embedded scheme REPL (version 2.0.9 or newer is required).
- http://www.gnu.org/software/guile/guile.html |
apt-get install guile-2.0-dev
The following packages are optional. If they are not installed, someoptional parts of the AtomSpace will not be built. The CMake command,during the build, will be more precise as to which parts will not be built.
- Test framework
- Optional but recommended; required for running unit tests.
- http://cxxtest.sourceforge.net/ |https://launchpad.net/~opencog-dev/+archive/ppa
- C bindings for Python.
- Strongly recommended, as many examples and important subsystemsassume python bindings.
- http://cython.org |
apt-get install cython
- Haskell bindings (experimental).
- Optional; almost no existing code makes use of haskell.
- https://www.haskell.org/
- Distributed, multi-client networked storage.
- Needed for "remembering" things between shutdowns.
- http://postgres.org |
apt-get install postgresql postgresql-client
- Generic SQL Database client access libraries.
- Required for the distributed-processing atomspace.
- http://www.unixodbc.org/ |
apt-get install unixodbc-dev
- Asynchronous messaging library.
- Optional, almost completely unused, mostly due to poor performance.
- http://zeromq.org/intro:get-the-software |
apt-get install libzmq3-dev
- Google's data interchange format (used by ZeroMQ).
- Optional, needed only for ZMQ, above.
- https://developers.google.com/protocol-buffers |
apt-get install libprotobuf-dev
Perform the following steps at the shell prompt:
cd to project root dir mkdir build cd build cmake .. make
Libraries will be built into subdirectories within build, mirroringthe structure of the source directory root.
To build and run the unit tests, from the./build
directory enter(after building opencog as above):
make test
After building, you MUST install the atomspace.
sudo make install
The AtomSpace can be used in one of three ways, or a mixture of all three:By using the GNU Guile scheme interface, by using Python, or by runningthe OpenCog cogserver.
Guile provides the easiest interface for creating atoms, loading theminto the AtomSpace, and performing various processing operations onthem. For examples, see the/examples/guile
and the/examples/pattern-matcher
directories.
Python is more familiar than scheme (guile) to most programmers, andit offers another way of interfacing to the atomspace. See the/examples/python
directory for how to use python with the AtomSpace.
The OpenCog cogserver provides a network server interface to OpenCog.It is required for running embodiment, some of the reasoning agents,and some of the natural-language processing agents. The cogserver isonly available in the main OpenCog project; it is not a part of theAtomSpace.
Some useful CMake's web sites/pages:
- http://www.cmake.org (main page)
- http://www.cmake.org/Wiki/CMake_Useful_Variables
- http://www.cmake.org/Wiki/CMake_Useful_Variables/Get_Variables_From_CMake_Dashboards
- http://www.cmake.org/Wiki/CMakeMacroAddCxxTest
- http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware
The main CMakeLists.txt currently sets -DNDEBUG. This disables Boostmatrix/vector debugging code and safety checks, with the benefit ofmaking it much faster. Boost sparse matrixes and (dense) vectors arecurrently used by ECAN's ImportanceDiffusionAgent. If you use Boostublas in other code, it may be a good idea to at least temporarilyunset NDEBUG. Also if the Boost assert.h is used it will be necessaryto unset NDEBUG. Boost ublas is intended to respond to a specificBOOST_UBLAS_NDEBUG, however this is not available as of the currentUbuntu standard version (1.34).
About
The OpenCog hypergraph database, query system and rule engine
Resources
License
Stars
Watchers
Forks
Packages0
Languages
- C++60.1%
- Scheme29.1%
- CMake4.8%
- Python4.2%
- Haskell1.2%
- Shell0.2%
- Other0.4%