(original) (raw)

#!/usr/bin/python """ Id:cwm.py,v1.1982012/01/3009:30:20timblExpId: cwm.py,v 1.198 2012/01/30 09:30:20 timbl Exp Id:cwm.py,v1.1982012/01/3009:30:20timblExp Closed World Machine (also, in Wales, a valley - topologiclly a partially closed world perhaps?) This is an application which knows a certian amount of stuff and can manipulate it. It uses llyn, a (forward chaining) query engine, not an (backward chaining) inference engine: that is, it will apply all rules it can but won't figure out which ones to apply to prove something. License ------- Cwm: http://www.w3.org/2000/10/swap/doc/cwm.html Copyright (c) 2000-2004 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University). All Rights Reserved. This work is distributed under the W3C Software License [1] in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 """ #the following lines should be removed. They will NOT work with any distribution #----------------- from os import chdir, getcwd from sys import path qqq = getcwd() chdir(path[0]) chdir('..') path.append(getcwd()) chdir(qqq) #import swap #print dir(swap) #----------------- #end lines should be removed import string, sys # From http://www.w3.org/2000/10/swap/ from swap import diag from swap.why import explainFormula, newTopLevelFormula from swap.diag import verbosity, setVerbosity, progress, tracking, setTracking from swap.uripath import join, splitFrag from swap.webAccess import urlopenForRDF, load, sandBoxed from swap import notation3 # N3 parsers and generators from swap import toXML # RDF generator from swap.why import BecauseOfCommandLine from swap.query import think, applyRules, applyQueries, applySparqlQueries, testIncludes from swap.update import patch from swap import uripath from swap import llyn from swap import RDFSink cvsRevision = "$Revision: 1.198 $" ################################################# Command line def doCommand(): """Command line RDF/N3 tool