command/commit

Setup command package

authorJan Wielemaker
Thu Mar 10 12:12:37 2011 +0100
committerJan Wielemaker
Thu Mar 10 12:12:37 2011 +0100
commit5db90c877a66bf12223b27a13083601396971257
tree7496af2379becd8fb87fb560eba5858961627211
parentfc60edbcd5dcd67e2187830dc4f8a65e476c02e9
Diff style: patch stat
diff --git a/api/command.pl b/api/command.pl
new file mode 100644
index 0000000..eca6cd6
--- /dev/null
+++ b/api/command.pl
@@ -0,0 +1,48 @@
+/*  Part of ClioPatria SeRQL and SPARQL server
+
+    Author:        Jan Wielemaker
+    E-mail:        J.Wielemaker@cs.vu.nl
+    WWW:           http://www.swi-prolog.org
+    Copyright (C): 2011, University of Amsterdam,
+		   VU University Amsterdam
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed 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.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    As a special exception, if you link this library with other files,
+    compiled with a Free Software compiler, to produce an executable, this
+    library does not by itself cause the resulting executable to be covered
+    by the GNU General Public License. This exception does not however
+    invalidate any other reasons why the executable file might be covered by
+    the GNU General Public License.
+*/
+
+:- module(api_command, []).
+:- use_module(library(http/http_dispatch)).
+:- use_module(library(http/http_path)).
+:- use_module(library(http/http_parameters)).
+
+/** <module> ClioPatria command line interface
+
+*/
+
+:- multifile http:location/3.
+
+http:location(cmd, root(cmd), []).
+
+:- http_handler(cmd(ping), ping, []).
+
+ping(_Request) :-
+	format('Content-type: text/plain\n\n'),
+	format('alive\n').
diff --git a/config-available/command.pl b/config-available/command.pl
index b5502ab..b4fdafe 100644
--- a/config-available/command.pl
+++ b/config-available/command.pl
@@ -3,3 +3,4 @@
 /** <module> Command line interface
 */
 
+:- use_module(api(command)).
diff --git a/rdf/cpack/command.ttl b/rdf/cpack/command.ttl
index 567e762..4d831d3 100644
--- a/rdf/cpack/command.ttl
+++ b/rdf/cpack/command.ttl
@@ -11,12 +11,12 @@
 # this.  Otherwise you can specify the information inline as done below.
 # See http://xmlns.com/foaf/spec/ for defines fields.
 
-<> a cpack:Package ;
+<> a cpack:API ;
 	cpack:packageName "command" ;
 	dcterms:title "Command line interface" ;
 	cpack:author [ a foaf:Person ;
 		       foaf:name "Jan Wielemaker" ;
-		       foaf:mbox "@FOAFMBOX@" ;
+		       foaf:mbox <mailto:J.Wielemaker@cs.vu.nl> ;
 		     ] ;
 	cpack:primaryRepository
 	    [ a cpack:GitRepository ;
@@ -24,7 +24,9 @@
 	    ] ;
 	cpack:description
 
-"""The package description goes here.  You can use PlDoc Wiki markup.
+"""The command package provides a commandline interface for ClioPatria.  It
+   consists of two parts: the server-side API and a client program.  The client
+   program allows for loading and unloading data, asking SPARQL queries, etc.
 """ .