-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbusinessstandards.php
More file actions
52 lines (46 loc) · 1.57 KB
/
businessstandards.php
File metadata and controls
52 lines (46 loc) · 1.57 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
<?php
/**
* User: Hans-Gert Gräbe
* last update: 2021-09-21
*/
require 'vendor/autoload.php';
require_once 'helper.php';
require_once 'layout.php';
function theBusinessStandards($input)
{
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/BusinessStandards/>
where { ?a a od:TRIZ_Standard . ?b a od:TRIZ_StandardGroup .}';
try {
$graph = $sparql->query($query);
} catch (Exception $e) {
print "<div class='error'>".$e->getMessage()."</div>\n";
}
$a=array();
foreach($graph->allOfType('od:TRIZ_Standard') as $concept) {
$uri=str_replace('http://opendiscovery.org/rdf/BusinessStandard/','',$concept->getURI());
$out="<h3> Standard ".$uri."</h3>";
$out.="<p>".showLanguage($concept->all("skos:prefLabel"),"<br/>")."</p>";
if ($concept->all("skos:narrower")) {
$out.="<p> Belongs to Group <em>"
.$concept->get("skos:narrower")->get("skos:prefLabel")."</em></p>";
}
if ($concept->all("skos:example")) {
$out.="<h4>Example</h4>".showLanguage($concept->all("skos:example"),"<br/>");
}
$a[$uri]="<div>\n$out\n</div>\n";
}
ksort($a);
$out='<h2>The Business Standards proposed by Valeri Souchkov</h2>
<div class="concept">
'.join("\n", $a).'
</div> <!-- end concept list -->';
return '<div class="container">'.$out.'</div>';
}
echo showpage(theBusinessStandards("rdf/BusinessStandards.rdf"));
?>