.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.6. .TH CWM "1" "June 2015" "cwm 1.197" "User Commands" .SH NAME cwm \- Closed World Machine, an RDF/N3 semantic web data processor .SH DESCRIPTION Command line RDF/N3 tool .IP [\-\-with ] .SH OPTIONS .TP .B \--pipe Don't store, just pipe out * .PP steps, in order left to right: .PP .TP .B \--rdf Input & Output ** in RDF/XML instead of n3 from now on .TP .B \--n3 Input & Output in N3 from now on. (Default) .TP .B \--rdf=\fI\,flags\/\fR Input & Output ** in RDF and set given RDF flags .TP .B \--n3=\fI\,flags\/\fR Input & Output in N3 and set N3 flags .TP .B \--ntriples Input & Output in NTriples (equiv \fB\-\-n3\fR=\fI\,usbpartane\/\fR \fB\-bySubject\fR \fB\-quiet\fR) .TP .B \--language=\fI\,x\/\fR Input & Output in "x" (rdf, n3, etc) \fB\-\-rdf\fR same as: \fB\-\-language\fR=\fI\,rdf\/\fR .TP .B \--languageOptions=\fI\,y\/\fR \fB\-\-n3\fR=\fI\,sp\/\fR same as: \fB\-\-language\fR=\fI\,n3\/\fR \fB\-\-languageOptions\fR=\fI\,sp\/\fR .TP .B \--ugly Store input and regurgitate, data only, fastest * .TP .B \--bySubject Store input and regurgitate in subject order * .TP .B \--no No output * .RS (default is to store and pretty print with anonymous nodes) * .TP .B \--base=\fI\fR Set the base URI. Input or output is done as though this were the document URI. .TP .B \--closure=\fI\,flags\/\fR Control automatic lookup of identifiers (see below) Load document. URI may be relative to current directory. .PP .TP .B \--apply=\fI\,foo\/\fR Read rules from foo, apply to store, adding conclusions to store .TP .B \--patch=\fI\,foo\/\fR Read patches from foo, applying insertions and deletions to store .TP .B \--filter=\fI\,foo\/\fR Read rules from foo, apply to store, REPLACING store with conclusions .TP .B \--query=\fI\,foo\/\fR Read a N3QL query from foo, apply it to the store, and replace the store with its conclusions .TP .B \--sparql=\fI\,foo\/\fR Read a SPARQL query from foo, apply it to the store, and replace the store with its conclusions .TP .B \--rules Apply rules in store to store, adding conclusions to store .TP .B \--think as \fB\-rules\fR but continue until no more rule matches (or forever!) .TP .B \--engine=\fI\,otter\/\fR use otter (in your $PATH) instead of llyn for linking, etc .TP .B \--why Replace the store with an explanation of its contents .TP .B \--why=\fI\,u\/\fR proof tries to be shorter .TP .B \--mode=\fI\,flags\/\fR Set modus operandi for inference (see below) .TP .B \--reify Replace the statements in the store with statements describing them. .TP .B \--dereify Undo the effects of \fB\-\-reify\fR .TP .B \--flatten Reify only nested subexpressions (not top level) so that no {} remain. .TP .B \--unflatten Undo the effects of \fB\-\-flatten\fR .TP .B \--think=\fI\,foo\/\fR as \fB\-apply\fR=\fI\,foo\/\fR but continue until no more rule matches (or forever!) .TP .B \--purge Remove from store any triple involving anything in class log:Chaff .TP .B \--data Remove all except plain RDF triples (formulae, forAll, etc) .TP .B \--strings Dump :s to stdout ordered by :k whereever { :k log:outputString :s } .TP .B \--crypto Enable processing of crypto builtin functions. Requires python crypto. .TP .B \--help print this message .TP .B \--revision print CVS revision numbers of major modules .TP .B \--chatty=\fI\,50\/\fR Verbose debugging output of questionable use, range 0\-99 .TP .B \--sparqlServer instead of outputting, start a SPARQL server on port 8000 of the store .TP .B \--sparqlResults After sparql query, print in sparqlResults format instead of rdf .PP finally: .PP .TP .B \--with Pass any further arguments to the N3 store as os:argv values .IP * mutually exclusive ** doesn't work for complex cases :\-/ .SH EXAMPLES .TP cwm \-\-rdf foo.rdf \-\-n3 \-\-pipe Convert from rdf/xml to rdf/n3 .TP cwm foo.n3 bar.n3 \-\-think Combine data and find all deductions .IP cwm foo.n3 \-\-flat \-\-n3=spart .SS "Mode flags affect inference extending to the web:" .TP .B r Needed to enable any remote stuff. .TP .B a When reading schema, also load rules pointed to by schema (requires r, s) .TP .B E Errors loading schemas of definitive documents are ignored .TP .B m Schemas and definitive documents loaded are merged into the meta knowledge (otherwise they are consulted independently) .TP .B s Read the schema for any predicate in a query. .TP .B u Generate unique ids using a run\-specific .PP Closure flags are set to cause the working formula to be automatically expanded to the closure under the operation of looking up: .TP .B s the subject of a statement added .TP .B p the predicate of a statement added .TP .B o the object of a statement added .TP .B t the object of an rdf:type statement added .TP .B i any owl:imports documents .TP .B r any doc:rules documents .TP .B E errors are ignored \-\-\- This is independant of \-\-mode=E .TP .B n Normalize IRIs to URIs .TP .B e Smush together any nodes which are = (owl:sameAs) .PP See http://www.w3.org/2000/10/swap/doc/cwm for more documentation. .PP Setting the environment variable CWM_RDFLIB to 1 makes Cwm use rdflib to parse rdf/xml files. Note that this requires rdflib. .PP Flags for N3 output are as follows:\- .PP a Anonymous nodes should be output using the _: convention (p flag or not). d Don't use default namespace (empty prefix) e escape literals \-\-\- use \eu notation i Use identifiers from store \- don't regen on output l List syntax suppression. Don't use (..) n No numeric syntax \- use strings typed with ^^ syntax p Prefix suppression \- don't use them, always URIs in <> instead of qnames. q Quiet \- don't output comments about version and base URI used. r Relative URI suppression. Always use absolute URIs. s Subject must be explicit for every statement. Don't use ";" shorthand. t "this" and "()" special syntax should be suppressed. u Use \eu for unicode escaping in URIs instead of utf\-8 %XX v Use "this log:forAll" for @forAll, and "this log:forAll" for "@forSome". / If namespace has no # in it, assume it ends at the last slash if outputting. .PP Flags for N3 input: .PP B Turn any blank node into an existentially qualified explicitly named node. .PP Flags to control RDF/XML output (after \-\-rdf=) areas follows: .PP b \- Don't use nodeIDs for Bnodes c \- Don't use elements as class names d \- Default namespace supressed. l \- Don't use RDF collection syntax for lists r \- Relative URI suppression. Always use absolute URIs. z \- Allow relative URIs for namespaces .IP Flags to control RDF/XML INPUT (after \-\-rdf=) follow: .TP .B S \- Strict spec. Unknown parse type treated as Literal instead of error. .TP .B T \- take foreign XML as transparent and parse any RDF in it .IP (default is to ignore unless rdf:RDF at top level) .TP .B L \- If non\-rdf attributes have no namespace prefix, assume in local <#> namespace .TP .B D \- Assume default namespace declared as local document is assume xmlns="" .TP .B R \- Do not require an outer , treating the file as RDF content (opposite of T) .IP Note: The parser (sax2rdf) does not support reification, bagIds, or parseType=Literal. .IP It does support the rest of RDF incl. datatypes, xml:lang, and nodeIds.