Cwm

Cwm (pronounced coom) is a general-purpose data processor for the semantic
web, somewhat like sed, awk, etc. for text files or XSLT for XML. It is a
forward chaining reasoner which can be used for querying, checking,
transforming and filtering information. Its core language is RDF, extended to
include rules, and it uses RDF/XML or RDF/N3 (see Notation3 Primer) serializations as required.

This is for the announcement and brief discussion/clarification of
cwm bugs or Requests For Enhancement (RFE). If responding to an
existing bug, only use mailers which send the refernce headers so that
the threads on this mail ling list work. For new threads, please make
the subject line informative, and use the word "bug" or "RFE" as
appopriate. The current plan is to review changes in this monthly and
send it to the announce list.

Rules can read data from the web, indirectly letting data out by the
URIs they use.

Rules can take up your resources such as processor time and memory.

Rules can pick data up from within the web you have access to,
including confidential files.

Be carfeul even when using cryptography. I am not an expert but a few
things to watch are:

Allways think where the weakest link is. It is not always on the
net.

Where do you keep the private key, anyway?

Beware of all forms of attack, including replay and man in the
middle.

Always sign some random junk as well as the critical data to prevent
the reverse engineering of the key.

Ask a crypto specialist to look over your stuff

Make the techniques, rules, code. public. Public debugging is valuable.
Trying to hide it from attackers by keeping it secret doesn't pay.

This code is not guaranteed anyway, or made for production use. It is
designed for prototyping new semantic web applications. Use at your own
risk.

About the name cwm

Originally, the name is from from "Closed World Machine" because it
processed information in a limited space, cwm does not make any
assumptions about a closed world. Think of it as defined area but with
openings - like a valley.

Related Work

see also Sean Palmer's guide to
cwm -- sometimes it is more up to date than this!

Development

This swap code is
open source and available for those that want to play with it, but comes with
no warranty.

Using CVS

from the public w3c CVS
repository. Check out the whole tree to develop. This includes the
test data - if you don't need that, delete the test subdirectory. Make
a fresh directory where you want to put stuff from dev.w3.org.

Get the files one by one. cwm.py
is the main application file. You can browse the source files on the
web, but this is not a practical way to install the
system.

In the following, we assume $SWAP expands to the place where you
have code checked out.

Test Driven Development (Don't trust the docs ;-)

The best test of works is what has been tested. So the list of files in
the regression test defines the set of
features which are generally checked on each checkin. Cwm developers agree
that all the tests have to pass before code is checked in. To run the tests,
do make in the swap/test directory. We reckon to add a test
for a new bug, so that bugs don't recur in future versions.

Each subdirectory of test has its own detailed.tests file. In that you can
put tests for new features. Note that the test commands are all writted to be
run in $SWAP/test.

How to make a release

Remember to cvs update to ensure you have any changes
other people have done before running tests.

A quick test that your code still works is cd $SWAP/test; make
fast

The test a release must pass before you make it is cd $SWAP/test; make
pre-release

Update the releases page with details of the new bug fixes and/or
features.

Edit $SWAP/Makefile

Make sure the HTML files generated from any new .py files are added
to the list HTMLS

Change the version number if you are going to make a new
tarball

Code Overview

Cwm developers agree to keep line lengths below 80 characters, though we
have some code that predates that agreement.

llyn.py - The Store

An in-memory store which does the inference. See the Formula class methods
for a more or less conventional RDF API. A Forumula is a set of
statements.

notation3.py - Serializing/deserializaing RDF/N3

Originally written by Dan Connolly, uses a basic RDF stream parser
interface, migrating to API

Parses N3

Generates N3

The command line form (alias n3 python notation3.py; n3 -help) allows RDF
to be parsed and re-output.

The module will also run as a CGI script to convert N3 to RDF M&S 1.0
- by DanC magic.

Acknowledgements

Thanks to Dan Connolly for writing the first code and thereby introducing me to Python, and to him and Sean Palmer and
Mark Nottingham for writing built-in function modules. Eric Prud'hommeaux
wrote the remote database query and mySQL interface. Sandro Hawke has made
various contributions. Yosi Scharf engineered the cwm 1.0.0 release and fixed
various bugs and added SPARQL support. Thanks to Sean for his guide to cwm, as well as n3p, which
is the basis for Cwm's Sparql parser.. Thanks for all on #RDFIG for being
everything which is #RDFIG.

Development of cwm is supported in part by funding from US Defense
Advanced Research Projects Agency (DARPA) and Air Force Research Laboratory,
Air Force Materiel Command, USAF, under agreement number F30602-00-2-0593,
"Semantic Web Development".