forked from egonw/chembl.rdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtargets_ls_uniprot.php
75 lines (60 loc) · 2.69 KB
/
targets_ls_uniprot.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php header('Content-type: application/rdf+xml'); ?>
<?php
include 'namespaces.php';
include 'functions.php';
include 'to.php';
$ini = parse_ini_file("vars.properties");
$rooturi = $ini["rooturi"];
$importedBy = $ini["importedBy"];
$db = $ini["dbprefix"] . $ini["version"];
$con = mysqli_connect(ini_get("mysqli.default_host"), ini_get("mysqli.default_user"), ini_get("mysqli.default_pw"), $db);
if (mysqli_connect_errno($con)) die(mysqli_connect_errno($con));
# VOID
$mastervoid = $rooturi . "void.ttl#";
$masterset = $mastervoid . "ChEMBLRDF";
$thisset = $mastervoid . "ChEMBLUniprotMapping";
$thisSetTitle = "ChEMBL Target - Uniprot mappings";
$thisSetDescription = "Mappings between ChEMBL targets and Uniprot.";
$sourceSet = $mastervoid . "ChEMBLTarget";
$sourceSpace = $CHEMBL;
$targetSet = $mastervoid . "Uniprot";
$targetSpace = "http://purl.uniprot.org/uniprot/";
$linkPredicate = $SKOS . "exactMatch";
$expresses = "http://lsdis.cs.uga.edu/projects/glycomics/propreo#UNIPROT_accession_number";
$current_date = gmDate("Y-m-d\TH:i:s");
echo triple( $thisset , $PAV . "createdBy", $importedBy );
echo typeddata_triple( $thisset, $PAV . "createdOn", $current_date, $XSD . "dateTime" );
echo triple( $thisset , $PAV . "authoredBy", $importedBy );
echo typeddata_triple( $thisset, $PAV . "authoredOn", $current_date, $XSD . "dateTime" );
echo triple( $thisset, $RDF . "type", $VOID . "Linkset" );
echo triple( $masterset, $VOID . "subset" , $thisset );
# echo triple( $molset, $RDF . "type", $VOID . "Dataset" );
echo data_triple( $sourceSet, $VOID . "uriSpace", $sourceSpace );
echo triple( $masterset, $VOID . "subset" , $sourceSet );
# echo triple( $chebiset, $RDF . "type", $VOID . "Dataset" );
echo data_triple( $targetSet, $VOID . "uriSpace", $targetSpace );
echo triple( $masterset, $VOID . "subset" , $thisset );
echo "\n";
echo data_triple( $thisset, $DCT . "title", $thisSetTitle ) ;
echo data_triple( $thisset, $DCT . "description", $thisSetDescription ) ;
echo triple( $thisset, $VOID . "subjectsTarget", $sourceSet) ;
echo triple( $thisset, $VOID . "objectsTarget", $targetSet);
echo triple( $thisset, $VOID . "linkPredicate", $linkPredicate );
echo triple( $thisset, $DCT . "license", $ini["license"] ) ;
echo triple( $thisset, $DUL . "expresses", $expresses);
echo "\n";
# DATA
$allIDs = mysqli_query($con, "SELECT DISTINCT * FROM target_dictionary " . $ini["limit"]);
function appendTo($appendTo, $string) {
if (strlen($string) > 0) {
return $appendTo . "/" . $string;
}
return $appendTo;
}
while ($row = mysqli_fetch_assoc($allIDs)) {
$target = $CHEMBL . $row['chembl_id'];
if ($row['protein_accession']) {
echo triple( $target, $SKOS . "exactMatch", $UNIPROT . $row['protein_accession'] );
}
}
?>