Joomla! Configuration
This configuration was created by
Danh Le Phuoc. Danh is working on refining the configuration in a GSoC project. So in case of inquiries, bug reports and feature requests regarding this configuration email Danh and/or the Triplify mailinglist.
<?php
define( '_JEXEC', 1 );
include("../configuration.php");
$conf = new JConfig();
$triplify['db']=new PDO("mysql:host=$conf->host;dbname=$conf->db","$conf->user","$conf->password");
/* Alternatively the db configuration value can point to a mysql link resource*/
#$triplify['db']=mysql_connect($conf->host,$conf->user,$conf->password);
#mysql_select_db($conf->db);
$triplify['namespaces']=array(
'vocabulary'=>'http://triplify.org/vocabulary/Joomla/',
'rdf'=>'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
'rdfs'=>'http://www.w3.org/2000/01/rdf-schema#',
'owl'=>'http://www.w3.org/2002/07/owl#',
'foaf'=>'http://xmlns.com/foaf/0.1/',
'sioc'=>'http://rdfs.org/sioc/ns#',
'sioctypes'=>'http://rdfs.org/sioc/types#',
'rss'=>'http://purl.org/rss/1.0/modules/content/',
'dc'=>'http://purl.org/dc/elements/1.1/',
'dcterms'=>'http://purl.org/dc/terms/',
'skos'=>'http://www.w3.org/2004/02/skos/core#',
'tag'=>'http://www.holygoat.co.uk/owl/redwood/0.1/tags/',
'xsd'=>'http://www.w3.org/2001/XMLSchema#',
);
$servURI='http://'.$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']!=80?':'.$_SERVER['SERVER_PORT']:'');
$bsURI=$servURI.substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'/triplify'));
$article_uri="$bsURI/index.php?option=com_content&view=article&id=";
$triplify['queries']=array(
'content'=>array(
"SELECT c.id AS id,c.title AS 'dc:title', u.name AS 'sioc:has_creator',
CONCAT('".$article_uri."',c.id) AS 'sioc:about',
c.created AS 'sioc:created_at',
c.modified AS 'sioc:modified_at',
s.title AS 'vocabulary:has_section',cat.title AS 'vocabulary:has_category',
c.fulltext AS 'sioc:content', c.fulltext AS 'rss:encoded'
FROM jos_content c INNER JOIN jos_users u ON(created_by=u.id)
LEFT JOIN jos_sections s ON(c.sectionid=s.id)
LEFT JOIN jos_categories cat ON(c.catid=cat.id)
"),
'user'=>"SELECT name id,SHA(CONCAT('mailto:',email)) AS 'foaf:mbox_sha1sum' FROM jos_users",
'section'=>"SELECT id,title as 'vocabulary:section_Title',description as 'vocabulary:sectionDescription' FROM jos_sections",
'cat'=>"SELECT id,title as 'vocabulary:cat_Title',description as 'vocabulary:catDescription' FROM jos_categories",
);
$triplify['objectProperties']=array(
'sioc:has_creator'=>'user',
'sioc:about' =>''
);
$triplify['classMap']=array(
'user'=>'foaf:person',
'content'=>'foaf:Post',
'section'=>'vocabulary:Section',
'cat'=>'vocabulary:Category'
);
$triplify['license']='http://creativecommons.org/licenses/by/3.0/us/';
$triplify['metadata']=array(
'dc:title'=>'',
'dc:publisher'=>''
);
$triplify['register']=true;
$triplify['TTL']=0;
$triplify['cachedir']='cache/';
$triplify['LinkedDataDepth']='0';
function htmlcleaning( $text ) {
$text = preg_replace('#<br[^>]*>#ims', "\n", $text);
$text = preg_replace('#<li[^>]*>#ims', "\n - ", $text);
$text = preg_replace( '#{.*?}#ims', '', $text );
$text = strip_tags( $text );
$text = decodeHTML( $text );
return $text;
}
function decodeHTML( $string ) {
$string = strtr( $string, array_flip(get_html_translation_table( HTML_ENTITIES ) ) );
$string = preg_replace( "/&#([0-9]+);/me", "chr('\\1')", $string );
return $string;
}
$triplify['CallbackFunctions']=array(
'sioc:content'=>'htmlcleaning',
'dc:title'=>'htmlcleaning',
);
?>
There are no files on this page.
[Display files/form]
There is no comment on this page.
[Display comments/form]
Information
Last Modification:
2008-04-21 18:37:01 by Soeren Auer
