4Suite™ is a platform for XML and RDF application development. This document gives step-by step instructions for installing 4Suite on a UNIX-like system such as Linux.
1. | Introduction and Conventions | ||||||||||||
2. | Quick Installation Steps | ||||||||||||
3. | CVS: bleeding-edge 4Suite | ||||||||||||
4. | Detailed Installation Guide
|
||||||||||||
5. | Resources
|
||||||||||||
6. | Appendix A: Notes on PyXML and 4Suite |
These instructions were written for Red Hat 7.1 Linux, but should work for most Linux distributions and other UNIX variants with few, if any, modifications.
In most cases, the installation will occur in directories under /usr/local and /var/local. Ideally, you should perform these steps as a non-superuser who has write access in these directories.
Some instructions require the user to modify their shell environment. If multiple users will be running and accessing the repository servers, you'll want to be careful to ensure the environment is set up correctly for each user.
In command-line examples, "$" is used to represent the shell's command prompt. The actual prompt will vary from system to system. The part you are supposed to type is to the right of the "$".
Sometimes there will be a great deal of output from an instruction. If there is nothing of particular interest in the output, it will be omitted and replaced with the text "SNIP".
There are useful third-party resources mentioned in this document. Those that are necessary to follow instructions are directly linked from the text. Others are marked as endnotes and the links are available in the Resources section.
The Detailed Installation Guide sections that follow this section will further explain these steps.
Install Python 2.1 or 2.2
Although you can install Python using your operating system's native package or ports system (RPMs, BSD packages/ports collection, etc.), the 4Suite developers prefer that you install Python from source (it's quite portable as-is). Just get the appropriate Python tarball from python.org, build and install via the usual "untar; configure; make" procedure.
Install 4Suite
Download the latest tarball, which at the time of this writing was 4Suite-1.0a3.tar.gz, from ftp://ftp.4suite.org/pub/4Suite/
Untar the source, then build and install via the usual procedure for installing a python application: invoke "python setup.py install" in the top-level source directory.
If you want to use Triclops, the RDF graph visualization tool that comes with 4Suite, then install GraphViz.
GraphViz tarball - http://www.research.att.com/sw/tools/graphviz/download.html
If you need up-to-the-minute features or fixes for 4Suite, you can install the latest version from the developers' CVS repository. It should be considered an unstable work-in-progress preview of the next official release; it is not recommended for ordinary users.
CVS snapshots are a way to get bug fixes and experimental new features between full releases of the software. They are tarballs and zipfiles generated from Fourthought's internal CVS repository nightly.
If you want to keep closer track of the 4Suite development, you can use anonymous CVS (pserver). The main advantage of this approach is that you can get fixes quite easily when checked in by the developers, and keeping up-to-date afterward is easy. The main disadvantage is that you can also pick up bugs that the developers sometimes accidentally check in.
For more information about 4Suite CVS, refer to the Obtaining 4Suite with CVS documentation.
4Suite is written mostly in Python: a mature, robust, efficient programming language well-suited to object-oriented programming, functional programming, and procedural tasks of any complexity. In the few cases where Python is not sufficiently speedy, certain 4Suite components are implemented in C. Therefore, you need both an appropriate version of Python and an ANSI C compiler installed if you want to be able to use 4Suite. C compilers are standard on most UNIX systems, but Python is not always available.
Specifically, Python 2.1 or higher is required for 4Suite. Your system might not have Python at all, or it might only have Python 1.5.2, or it may have more than one version installed -- some Linux distributions install Python 2.x as "python2", for example. You can have other versions of Python installed alongside the one you need for 4Suite, as long as when you use 4Suite's Python API, you be sure to load the modules with the interpreter that they were built for, and as long as the directory containing the correct python executable comes first in your executable path. Test that you have a good version of python in your path by issuing this command in your command shell: python -V (that's a capital V).
If you need to install Python, then compiling and installing from source is recommended, rather than installing from a precompiled package such as from an RPM archive. Get the appropriate Python tarball from python.org, build and install via the usual "untar; read the README and INSTALL docs; configure; make" procedure.
Untar to a suitable location
$ cd /usr/local/src $ tar xzvf Python-2.2.3.tgz ; cd Python-2.2.3 SNIP
You should probably at least browse the Python README, but here's what you can do:
$ ./configure SNIP $ make SNIP $ make install SNIP
Note: make install installs to /usr/local/lib/python2.2, with python interpreter executable at /usr/local/bin. Remember this to avoid mixing up Python 2.2 and Python 1.5.2. Red Hat 7.1 or lower comes with Python 1.5.x installed at /usr/lib/python1.5 with the exe at /usr/bin.
IMPORTANT: If your system has python 1.5.2 already installed, then you need to do the following additional step. You'll need to have Python 2.2 ahead of Python 1.5.2 in your executable path. There are many ways to do this, but the simplest is to edit the ~/.bash_profile (on Red Hat, at least, where bash is the default user shell) or equivalent shell startup script (syntax may vary) for all users that need 4Suite. Of course you may use whatever editor you prefer. The goal is just to edit the PATH environment variable.
$ cd ~ $ vi .bash_profile
Change the PATH variable to
PATH=/usr/local/bin:$PATH:$HOME/bin
Note that any change you make in your shell startup script is not going to take effect in the current shell unless you run the script again. The command source .bash_profile should suffice.
Test the Installation
Test that Python is working by typing python to enter the Python interpreter shell.
$ python Python 2.2.1 (#1, Jul 1 2002, 19:51:59) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-81)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
Slight differences in build info are to be expected, but if you get an error or don't get similar output, then your environment is probably incorrect.
Type ctrl-D to get out of the Python interpreter.
Regardless of whether you need to install Python, please take note that some parts of 4Suite depend on the availability of pyexpat, which are Python wrappers for the C-based XML parser expat. Expat libraries are on most POSIX systems these days. If they were available on the system when Python was built, then pyexpat was probably built and installed, as well. The simple command-line test python -c 'import pyexpat' will reveal if pyexpat is installed. The command will produce an ImportError traceback if pyexpat is not found. This test does not ensure pyexpat actually works or that it wraps a good version of expat, however.
If pyexpat is not available, or if the underlying version of expat is the very buggy (and unfortunately, very common) 1.95.5 version, then the recommended procedure is to install the latest version of PyXML, which, as long as it is not PyXML version 0.8.1, will make pyexpat and a safe version of expat available for use in Python applications. Installing PyXML will also make a validating XML parser available for use in 4Suite, and will install other useful XML processing tools. PyXML is available from http://pyxml.sourceforge.net/. If you don't install PyXML, it is possible to install expat and pyexpat separately, but this is sometimes more difficult than it needs to be.
Download the latest tarball, which at the time of this writing was 4Suite-1.0a1.tar.gz, from ftp://ftp.4suite.org/pub/4Suite/. The same files are also available in a .tar.bz2 (compressed with bzip2 rather than gzip) archive, if you prefer.
Untar the source, then build and install via the usual procedure for installing a python application: invoke "python setup.py install" in the top-level source directory.
4Suite will be installed in your python site-packages directory, the actual location of which will vary from system to system, but is usually in either /usr/lib/python2.2/site-packages or /usr/local/lib/python2.2/site-packages. This directory is typically writable by root only. Although it should be safe to install 4Suite as root, it is not necessary, so you may want to make site-packages writable by a non-superuser and proceed with the remaining steps while logged in as that user.
An example of an installation session follows.
$ cd /usr/local/src $ tar xzvf 4Suite-1.0a3.tar.gz; cd 4Suite-1.0a3 SNIP $ python setup.py install SNIP
Now you can perform a quick test to make sure everything is installed correctly. First, open up a command prompt. From any directory outside of the 4Suite source or installation directories, run the following (you enter 'python and then the text to the right of the '>>> prompts):
$ python Python 2.2.1 (#1, Jul 1 2002, 19:51:59) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Ft.Xml import Domlette >>> from Ft.Xml.Xslt import Processor >>> print Processor <module 'Ft.Xml.Xslt.Processor' from '/usr/local/lib/python2.2/site-packages/Ft/Xml/Xslt/Processor.pyc'> >>>
The imports and the print should complete without error. Report any problems to the 4Suite mailing list.
If all you wish to use in 4Suite are the basic command-line tools and Python libraries, then you are done with installation and can proceed to use them. To make sure things are working, try running a few of the command-line tools with the -h option to get usage information.
$ 4xml -h SNIP $ 4xslt -h SNIP $ 4xpath -h SNIP $ 4rdf -h SNIP
More thorough regression test suites for the 4Suite Python libraries are included with 4Suite, and you are welcome to try them out. Ideally, in a regular release version of 4Suite, they should all run to completion without errors. Warnings are OK. In alpha and beta versions or CVS snapshots, some errors are to be expected, and do not need to be reported unless the tests cannot even run to completion.
$ cd /usr/local/lib/python2.2/site-packages/Ft/Share/Tests $ python test.py -v SNIP
Be prepared for a lot of output. Omit the -v if you want somewhat less detail. You can also specify certain tests by appending the relative path to a subdirectory or .py file.
If you want to use the XML/RDF repository and server features of 4Suite, then you will need to customize and install a configuration file, initialize a repository, and do some further tests. These topics are covered in the Quick Start documentation.
4Suite Project Page - Bug Reports, Feature Requests, Patches
4suite.org - Documentation, Downloads, News, CVS, Developer Resources
4Suite Users Mailing List - Peer & Developer Support
4Suite Announcement Mailing List - Infrequent Announcements about 4Suite
Fourthought, Inc. - Commercial Development, Consulting & Support
PyXML is a collection of XML processing libraries for Python. 4Suite and PyXML are complementary projects developed in tandem. There is minimal overlap in functionality. For example, where PyXML has a compliant, pure Python implementation of DOM Level 1, 4Suite has a lightweight, "Domlette" optimized for XPath processing and implemented mostly in C.
Prior to 4Suite 0.12.0a1 release, PyXML was required to use 4Suite. This is no longer the case with 0.12.0a1, 1.0a3, and newer; 4Suite does not need PyXML. As noted above, however, the absence of expat and pyexpat on some systems can affect the usability of certain parts of 4Suite, and the absence of xmlproc, the validating parser that comes with PyXML, will mean that 4Suite cannot do validation when parsing XML... so the installation of PyXML can still be advantageous.
If you decide to install PyXML, you must install PyXML 0.7 or higher for compatibility with current versions of 4Suite. Avoid PyXML 0.8.1 -- that specific version integrates a buggy version of expat (1.95.5) and leads to core dumps in some situations. When installing PyXML, it is recommended that you use the --without-xpath --without-xslt options for setup.py install, so that the very old, deprecated XPath and XSLT implementations are not installed.
Python API changes
If you are already familiar with PyXML, then you may have used a different form of imports to utilize XPath and XSLT features. The old xml.xpath and xml.xslt modules are deprecated and should be avoided if you have installed a recent version of 4Suite.