1/* Part of ClioPatria SeRQL and SPARQL server 2 3 Author: Jan Wielemaker 4 E-mail: J.Wielemaker@cs.vu.nl 5 WWW: http://www.swi-prolog.org 6 Copyright (C): 2010-2018, University of Amsterdam, 7 VU University Amsterdam, 8 CWI, Amsterdam 9 10 This program is free software; you can redistribute it and/or 11 modify it under the terms of the GNU General Public License 12 as published by the Free Software Foundation; either version 2 13 of the License, or (at your option) any later version. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public 21 License along with this library; if not, write to the Free Software 22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 24 As a special exception, if you link this library with other files, 25 compiled with a Free Software compiler, to produce an executable, this 26 library does not by itself cause the resulting executable to be covered 27 by the GNU General Public License. This exception does not however 28 invalidate any other reasons why the executable file might be covered by 29 the GNU General Public License. 30*/ 31 32:- module(cliopatria, []).
65:- multifile 66 menu_item/2, 67 menu_label/2, 68 menu_popup_order/2, 69 70 rdf_label:label_property/1, 71 bnode_label//1, % +Resource 72 display_link//2, % +RDFObject, +Options 73 resource_link/2, % +URI, -URL 74 75 list_resource//2, % +URI, +Options 76 77 user_preference_db/2, % ?Property, ?Value 78 user_preference_default/2, % ?Property, ?Value 79 80 page_body//1, % +Body 81 page_body//2, % +Style, +Body 82 server_address//0, 83 logo//0, 84 85 predicate_order/2, % +P, -Order 86 context_graph/2, % +R, -RDF 87 context_graph/3, % +R, -RDF, +Options 88 context_predicate/2, % +R, -Pred 89 node_label/4, % +R, +Lang, +MaxLen, -Label 90 node_shape/3, % +R, -Shape, +Options 91 bag_shape/3. % +Members, -Shape, +Options 92 93 94 /******************************* 95 * THE MENU * 96 *******************************/
For example, if we want to add a new item to the Repository menu after Load from library that crawls LOD data, we can use the following code:
:- use_module(cliopatria(hooks)). :- use_module(library(http/http_dispatch)). :- handler(cliopatria('crawl_lod_form'), crawl_lod_form, []). cliopatria:menu_item(400=repository/crawl_lod_form, 'Crawl LOD'). crawl_lod_form(Request) :- ...
140 /******************************* 141 * LABELS * 142 *******************************/
172 /******************************* 173 * LOCAL VIEW * 174 *******************************/
184 /******************************* 185 * USER/SESSION PREFERENCES * 186 *******************************/
203 /******************************* 204 * SKINS * 205 *******************************/
skin(cliopatria)
defines the overall
skin and first calls cliopatria:page_body//2, if this fails
cliopatria:page_body//1 and if this fails too it uses the
default page.address
using the class
cliopatria
.float:left
style.230 /******************************* 231 * RDF BROWSING * 232 *******************************/
Predicates that have order `0' are deleted from the table.
rdf(S,P,O)
triples that
describe the context. Typically only object-triples are used,
although that is not a requirement.
rdf(Subject, Predicate, _)
must be included in the
context graph for Subject.
ClioPatria hooks
This module declares the hooks an application may define to extend or modify some of ClioPatria's behaviour. Hooks are
multifile
defined predicates that -typically- have no default definition. Code using the hook typically first calls the hook. If the hook succeeds the task is considered done. Otherwise some default action is performed. For example, a property myprefix:componentName can be added as a property that provides a label using this code:The example below adds an item to
Help
popup of ClioPatria:*/