Subversion

helios_wp3

[/] [trunk/] [triplify/] [bugzilla/] [config.inc.php] - Rev 116 Go to most recent revision

Compare with Previous - Blame


<?php
/* This file contains the configuration for triplify in order to triplify Bugzilla.
 * See https://picoforge.int-evry.fr/cgi-bin/twiki/view/Helios_wp3/Web/TriplifyBugzillaToRdf for some details 
 *
 * Triplify rapidly simplifies the creation of structured content for Web 2.0
 * mashups and Semantic Web applications.
 *
 * Triplyfy uses a number of SQL queries, whose results are converted into
 * either RDF/N3, JSON or Linked Data.
 *
 * @version $Id:$
 * @license LGPL
 * @copyright 2008 Sören Auer (soeren.auer@gmail.com) for the original example config file
 * @copyright 2009 Andrei Sambra and Olivier Berger for the bugzilla triplification
 */

/*
 * You can either use an external file or you can uncomment the line containing the object.
 */
include("db.inc.php");

#$triplify['db']=new PDO('mysql:host=localhost;dbname=yourdbname','user','password');


/*
 * This is the base URI where your Bugzilla installation is.
 * You need to modify this file to contain your own URL (don't forget to include the bugzilla dir and the trailing /).
 */
$BASEURI 'http://erty.int-evry.fr/bugzilla/';


/*
 * List of ontologies
 */
$triplify['namespaces']=array(
    
'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/',
    
'doap'=>'http://usefulinc.com/ns/doap#',
    
'sioc'=>'http://rdfs.org/sioc/ns#',
    
'sioctypes'=>'http://rdfs.org/sioc/types#',
    
'dc'=>'http://purl.org/dc/elements/1.1/',
    
'bom'=>'http://www.ifi.uzh.ch/ddis/evoont/2008/11/bom#',
    
'hel'=>'http://picoforge.int-evry.fr/projects/svn/helios_wp3/helios_bt.owl#',
    
'wf'=>'http://www.w3.org/2005/01/wf/flow#',
);

/*
 * Bugzilla queries
 */
$triplify['queries']=array(
    
'product'=>array(
            
"SELECT p.id AS id,
            p.name AS 'bom:name',
            p.description AS 'rdfs:label',
            id AS 'owl:sameAs->productcomponents',
            id AS 'rdfs:seeAlso->productcomponents'
            FROM products p WHERE id IS NOT NULL"
            
),
    
'component'=>array("
            SELECT id AS id,
            name AS 'bom:title',
            product_id AS 'bom:isInProduct',
            initialowner AS 'sioc:User',
            description AS 'rdfs:label',
            id AS 'rdfs:seeAlso->componentbugs',
            id AS 'owl:sameAs->componentbugs'
            FROM components WHERE id IS NOT NULL"
            
),
    
'issue'=>array(
        
"SELECT * FROM (
            SELECT b.bug_id AS id,
            CONCAT('show_bug.cgi?id=',b.bug_id) AS 'bom:bugURL',
            b.short_desc AS 'dc:title',
            b.creation_ts AS 'doap:created',
            b.assigned_to AS 'bom:hasAssignee->user',
            CONCAT('helios_bt.owl#BugzillaSeverity',b.bug_severity) AS 'bom:hasSeverity',
            CONCAT('helios_bt.owl#BugzillaState',b.bug_status) AS 'bom:hasState',
            b.component_id AS 'bom:isIssueOf->component',
            CONCAT('helios_bt.owl#BugzillaPriority',b.priority) AS 'bom:hasPriority',
            b.reporter AS 'bom:hasReporter->user',
            CONCAT('helios_bt.owl#BugzillaResolution',r.value) AS 'bom:hasResolution',
            10 * o.id + p.id AS 'bom:hasComputerSystem->computersystem',
            m.id AS 'bom:hasMilestone->milestone',
            b.product_id AS 'bom:isInProduct->product',
            b.bug_id AS 'owl:sameAs->issuecomments',
            CONCAT('Bug ',b.bug_id) AS 'rdfs:label'
            FROM bugs b INNER JOIN profiles u ON (assigned_to = u.userid)
            INNER JOIN op_sys o ON (b.op_sys = o.value)
            INNER JOIN rep_platform p ON (b.rep_platform = p.value)
            INNER JOIN milestones m ON (b.target_milestone = m.value)
            LEFT OUTER JOIN resolution r ON (r.value = b.resolution AND r.value != '')) AS b
            WHERE b.id IS NOT NULL"
            
),
    
'productcomponents'=>array(
        
"SELECT * FROM (
            SELECT c.product_id AS id,
            c.id AS 'bom:hasComponent->component',
            c.product_id AS 'rdfs:seeAlso->product',
            c.product_id AS 'owl:sameAs->product'
            FROM components c) c WHERE c.id IS NOT NULL"
            
),
    
'componentbugs'=>array(
        
"SELECT * FROM (
            SELECT b.component_id AS id,
            b.bug_id AS 'bom:hasIssue->issue',
            b.component_id AS 'rdfs:seeAlso->component',
            b.component_id AS 'owl:sameAs->component'
            FROM bugs b) b  WHERE b.id IS NOT NULL"
            
),
    
'milestone'=>array(
            
"SELECT id AS id,
            product_id AS 'bom:Product->product',
            value AS 'rdfs:label'
            FROM milestones WHERE id IS NOT NULL"
            
),
    
'computersystem'=>array(
        
"SELECT * FROM (
            SELECT 10 * o.id + r.id AS id,
            o.value AS 'bom:os',
            r.value AS 'bom:platform'
            FROM `op_sys` o, rep_platform r) o WHERE o.id IS NOT NULL"
            
),
    
'user'=>array(
        
"SELECT * FROM (
            SELECT userid AS id,
            SHA(CONCAT('mailto:',login_name)) AS 'sioc:email_sha1',
            realname AS 'rdfs:label',
            userid AS 'owl:sameAs->submission',
            userid AS 'owl:sameAs ->usercomments',
            userid AS 'rdfs:seeAlso->person'
            FROM profiles) AS u WHERE u.id IS NOT NULL"
            
),
    
'submission'=>array(
        
"SELECT * FROM (
            SELECT reporter as id,
            bug_id AS 'bom:isReporterOf->issue',
            reporter AS 'owl:sameAs->user'
            FROM bugs) b WHERE b.id IS NOT NULL"
            
),
    
'person'=>array(
        
"SELECT * FROM (
            SELECT userid AS id,
            userid AS 'foaf:hasAccount->user',
            SHA(CONCAT('mailto:',login_name)) AS 'sioc:email_sha1',
            realname AS 'foaf:name',
            userid AS 'rdfs:hasAccount->user'
            FROM profiles WHERE userid IS NOT NULL) AS u WHERE u.id IS NOT NULL"
            
),
    
'comment'=>array(
        
"SELECT * FROM (
            SELECT comment_id AS id,
            who AS 'bom:hasCreator->user',
            thetext AS 'bom:Comment',
            bug_id AS 'bom:isCommentOf->issue',
            bug_id AS 'rdfs:seeAlso->issue'
            FROM longdescs) AS c WHERE c.id IS NOT NULL"
            
),
    
'issuecomments'=>array(
        
"SELECT * FROM (
            SELECT bug_id AS id,
            comment_id AS 'bom:hasComment->comment',
            bug_id AS 'owl:sameAs->issue'
            FROM longdescs) AS c WHERE c.id IS NOT NULL"
            
),
    
'usercomments'=>array(
        
"SELECT * FROM (
            SELECT who AS id,
            comment_id AS 'bom:isCommentorOf->comment',
            who AS 'rdfs:seeAlso->user',
            who AS 'owl:sameAs->user'
            FROM longdescs) AS h WHERE h.id IS NOT NULL"
            
),
);

$triplify['objectProperties']=array(
    
'bom:bugURL'=>$BASEURI,
    
'bom:hasSeverity'=>'http://picoforge.int-evry.fr/projects/svn/helios_wp3',
    
'bom:hasState'=>'http://picoforge.int-evry.fr/projects/svn/helios_wp3',
    
'bom:hasPriority'=>'http://picoforge.int-evry.fr/projects/svn/helios_wp3',
    
'bom:hasResolution'=>'http://picoforge.int-evry.fr/projects/svn/helios_wp3',
);

$triplify['classMap']=array(
    
'computersystem'=>'bom:ComputerSystem',
    
'product'=>'bom:Product',
    
'component'=>'bom:Component',
    
'issue'=>'bom:Issue',
    
'milestone'=>'bom:Milestone',
    
'user'=>'sioc:User',
    
'person'=>'foaf:Person',
    
'productcomponents'=>'bom:hasComponent',
    
'componentbugs'=>'bom:hasIssue',
    
'submission'=>'sioc:User',
    
'comment'=>'bom:Comment',
    
'issuecomments'=>'bom:Issue',
    
'usercomments'=>'sioc:User',
);

$triplify['license']='http://creativecommons.org/licenses/by/3.0/us/';

$triplify['metadata']=array(
    
'hel:bugtracker'=>'Helios Bugzilla Test Tracker',
    
'hel:bugTrackerURL'=>$BASEURI,
);

/* 
 * Do not register by default.
 */
$triplify['register']=false;

$triplify['TTL']=0;

$triplify['cachedir']='cache/';

/* 
 * We decided to use "2" since Bugzilla trackers can contain a lot of data,
 * so it's not a good idea to display everything in one page!
 */
$triplify['LinkedDataDepth']='2';

$triplify['CallbackFunctions']=array(
);
?>

Powered by WebSVN v1.61