Skip to content

Commit

Permalink
Added RDFS classification, to have it show up nicely in a default Pro…
Browse files Browse the repository at this point in the history
…tege 4.1
  • Loading branch information
egonw committed Apr 5, 2012
1 parent f824bcf commit e84dcdf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion targetOntology.php
Expand Up @@ -22,12 +22,16 @@
function level($classRow, $level, $ontology) {
$counter = $ontology["ops:counter"];
$higher = $ontology["ops:higher"];
$SKOS = "http://skos.org/";
$SKOS = "http://www.w3.org/2004/02/skos/core#";
$RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
$RDFS = "http://www.w3.org/2000/01/rdf-schema#";
if ($classRow[$level]) {
$desc = $classRow[$level];
if (!$ontology[$desc]) {
$counter = $counter + 1;
$ontology[$desc] = "http://www.openphacts.org/chembl/target/TARONT" . $counter;
echo triple($ontology[$desc], $RDF . "type", $SKOS . "Concept");
echo triple($ontology[$desc], $RDFS . "subClassOf", $higher);
echo triple($higher, $SKOS . "narrower", $ontology[$desc]);
echo data_triple($ontology[$desc], $SKOS . "prefLabel", $desc);
$ontology["ops:counter"] = $counter;
Expand All @@ -37,6 +41,9 @@ function level($classRow, $level, $ontology) {
return $ontology;
}

echo data_triple($root, $SKOS . "prefLabel", "Target");
echo triple($root, $RDF . "type", $SKOS . "Concept");

# classifications
$class = mysql_query("SELECT DISTINCT * FROM target_class");
while ($classRow = mysql_fetch_assoc($class)) {
Expand Down

0 comments on commit e84dcdf

Please sign in to comment.