-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstandards.php
More file actions
54 lines (48 loc) · 1.61 KB
/
standards.php
File metadata and controls
54 lines (48 loc) · 1.61 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
<?php
/**
* User: Hans-Gert Gräbe
* last update: 2021-09-21
*/
require 'vendor/autoload.php';
require_once 'helper.php';
require_once 'layout.php';
function theStandards($input)
{
setNamespaces();
global $sparql;
$query='
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX od: <http://opendiscovery.org/rdf/Model#>
describe ?a
from <http://opendiscovery.org/rdf/StandardSolutions/>
where { ?a a od:StandardSolution . }';
try {
$graph = $sparql->query($query);
} catch (Exception $e) {
print "<div class='error'>".$e->getMessage()."</div>\n";
}
$a=array();
foreach($graph->allOfType('od:StandardSolution') as $concept) {
$uri=str_replace('http://opendiscovery.org/rdf/Standard/','',$concept->getURI());
$out="<h3> Standard Solution ".$uri."</h3>";
//echo $concept->get("skos:prefLabel");
$out.="<p>".showLanguage($concept->all("skos:prefLabel"),"<br/>")."</p>";
if ($concept->all("skos:broader")) {
$out.="<p> Belongs to Class "
.str_replace('http://opendiscovery.org/rdf/Standard/','',
$concept->get("skos:broader"))."</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 76 Inventive Standards</h2>
<div class="concept">
'.join("\n", $a).'
</div> <!-- end concept list -->';
return '<div class="container">'.$out.'</div>';
}
echo showpage(theStandards("rdf/StandardSolutions.rdf"));
?>