-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinciples.php
More file actions
71 lines (65 loc) · 2.25 KB
/
principles.php
File metadata and controls
71 lines (65 loc) · 2.25 KB
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
<?php
/**
* User: Hans-Gert Gräbe
* last update: 2023-05-10
*/
require 'vendor/autoload.php';
require_once 'helper.php';
require_once 'layout.php';
function thePrinciples()
{
setNamespaces();
global $sparql;
$query='
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX od: <http://opendiscovery.org/rdf/Model#>
describe ?a ?b
from <http://opendiscovery.org/rdf/Principles/>
where { ?a a od:Principle . ?b a od:Recommendation .}';
try {
$graph = $sparql->query($query);
} catch (Exception $e) {
print "<div class='error'>".$e->getMessage()."</div>\n";
}
$a=array();
$res = $graph->allOfType('od:Principle');
foreach ($res as $concept) {
$name=str_replace("http://opendiscovery.org/rdf/Concept/","",$concept->getUri());
$out="<h3> $name </h3>";
$nr73=$concept->get("od:hasAltshuller73Id");
$nr=$concept->get("od:hasAltshuller84Id");
$nr03=$concept->get("od:Matrix2003Id");
if (!empty($nr73)) {$out.="Principle $nr in Matrix-73 <br/>"; }
if (!empty($nr)) {$out.="Principle $nr in Matrix-84 <br/>"; }
if (!empty($nr03)) {$out.="Principle $nr in Matrix-2003 <br/>"; }
$out.="<h4>".showLanguage($concept->all("skos:prefLabel"),"<br/>")."</h4>";
$out.="<h5>".showLanguage($concept->all("skos:altLabel"),"<br/>")."</h5>";
$b=array();
foreach ($concept->all("od:hasRecommendation") as $v) {
$b[]=showLanguage($v->all("od:description"),"<br/>");
}
$out.="<h4>Recommendations</h4><p>".join("</p><p>",$b)."</p>";
$b=array();
foreach ($concept->all("od:LippertGlossaryNote") as $v) {
$b[]=$v;
}
if (!empty($b)) {
$out.="<h4>Lippert's Recommendations</h4><ul><li>"
.join("</li>\n<li>",$b)."</li></ul>";
}
if ($nr>0) { $a["$nr"]="<div>\n$out\n</div>\n"; }
else { $e[]="<div>\n$out\n</div>\n"; }
}
ksort($a);
$out='<h2>The 40 TRIZ Principles</h2>
<div class="concept">
'.join("\n", $a).'
</div> <!-- end concept list -->
<h2>Additional Principles</h2>
<div class="concept">
'.join("\n", $e).'
</div> <!-- end concept list -->';
return '<div class="container">'.$out.'</div>';
}
echo showpage(thePrinciples());
?>