1/* Part of ClioPatria SeRQL and SPARQL server 2 3 Author: Jan Wielemaker 4 E-mail: J.Wielemaker@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 All rights reserved. 10 11 Redistribution and use in source and binary forms, with or without 12 modification, are permitted provided that the following conditions 13 are met: 14 15 1. Redistributions of source code must retain the above copyright 16 notice, this list of conditions and the following disclaimer. 17 18 2. Redistributions in binary form must reproduce the above copyright 19 notice, this list of conditions and the following disclaimer in 20 the documentation and/or other materials provided with the 21 distribution. 22 23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 27 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 29 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 33 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 POSSIBILITY OF SUCH DAMAGE. 35*/ 36 37:- module(cliopatria, []).
70:- multifile 71 menu_item/2, 72 menu_label/2, 73 menu_popup_order/2, 74 75 rdf_label:label_property/1, 76 bnode_label//1, % +Resource 77 display_link//2, % +RDFObject, +Options 78 resource_link/2, % +URI, -URL 79 80 list_resource//2, % +URI, +Options 81 82 user_preference_db/2, % ?Property, ?Value 83 user_preference_default/2, % ?Property, ?Value 84 85 page_body//1, % +Body 86 page_body//2, % +Style, +Body 87 server_address//0, 88 logo//0, 89 90 predicate_order/2, % +P, -Order 91 context_graph/2, % +R, -RDF 92 context_graph/3, % +R, -RDF, +Options 93 context_predicate/2, % +R, -Pred 94 node_label/4, % +R, +Lang, +MaxLen, -Label 95 node_shape/3, % +R, -Shape, +Options 96 bag_shape/3, % +Members, -Shape, +Options 97 edge_shape/3. % +P, -Shape, +Options 98 99 100 /******************************* 101 * THE MENU * 102 *******************************/
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) :- ...
146 /******************************* 147 * LABELS * 148 *******************************/
178 /******************************* 179 * LOCAL VIEW * 180 *******************************/
190 /******************************* 191 * USER/SESSION PREFERENCES * 192 *******************************/
209 /******************************* 210 * SKINS * 211 *******************************/
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.236 /******************************* 237 * RDF BROWSING * 238 *******************************/
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:*/