You'll usually want to edit an Oedipus database by dropping certain
categories, or by only keeping a specific subtree. Writing a full
Web-based tool for editing a database is a sizable job, and
one I haven't attempted yet. I may never work on such an
editing tool, because I'm most interested in re-using dmoz.org's data,
not in setting up a competing effort.
As a simple demo, I've written a character-based tool that
resembles a Unix shell. You can walk around the tree of topics and
subtopics, in much the same way that you'd walk around a file system's
odpsh.py is only a demo. If you want to do
complicated transformations or edits, you're much better off
implementing them in Python, a programming language much more powerful
than any shell.
- Change current topic to topic. You can use a leading
'/' to start from the root of the tree, or use .. to move one level
up, toward the root.
- Clear the ODP database, erasing all the topics and pages.
- List contents of the current topic.
- Create a new editor within the current topic.
You will be prompted for the editor's ID.
- Create a letterbar link.
You will be prompted for the destination topic that is the target of the link.
Create a newsgroup within the current topic.
You will be prompted for the newsgroup name.
- Create a new external page within the current topic.
You will be prompted for the URL, a title, and a description.
- Create a related topic link, used for 'See also' references).
You will be prompted for the destination topic.
- Create a new symbolic link to another topic. You will be
prompted for the destination topic, and the title of the link.
- Create a new subtopic within the current topic.
You will be prompted for the topic's title.
- Move a subtopic to another topic.
You will be prompted for the name of the topic to move, and its
parse contentfile structurefile
- Parse the two named XML files,
adding their contents to the in-memory database.
- Print current topic.
- Exit the ODP shell.
rdf contentfile structurefile
- Generate two XML files
containing the current database, writing them to the provided filenames.
- Delete a subtopic.
- Print statistics (# of subcategories, # of links)
for current topic.
- Display tree of subcategories for current topic.
[amk@mira ODP-0.04]$ python odpsh.py
CAD Software Books
ODP> cd CAD Software
Description (. to end):
Software for designing MEMS-based caps.
ODP> cd ..
ODP> rdf /tmp/content.xml /tmp/struct.xml