-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbpm.php
More file actions
73 lines (63 loc) · 2.26 KB
/
bpm.php
File metadata and controls
73 lines (63 loc) · 2.26 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
72
73
<?php
/**
* User: Hans-Gert Gräbe
* last update: 2022-06-16
*/
require 'vendor/autoload.php';
require_once 'helper.php';
require_once 'layout.php';
function theBusinessProcessModelPatterns()
{
setNamespaces();
\EasyRdf\RdfNamespace::set('bpm', 'http://bpmpatterns.org/rdf/Model#');
\EasyRdf\RdfNamespace::set('bpmp', 'http://bpmpatterns.org/rdf/Pattern/');
global $sparql;
$query='
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX od: <http://opendiscovery.org/rdf/Model#>
PREFIX bpm: <http://bpmpatterns.org/rdf/Model#>
PREFIX bpmp: <http://bpmpatterns.org/rdf/Pattern/>
construct { ?a a bpm:Pattern; skos:prefLabel ?l; od:relatedPaper ?p;
od:relatedCategory ?c .}
from <http://opendiscovery.org/rdf/BPM-Patterns/>
where { ?a a bpm:Pattern; skos:prefLabel ?l .
optional {?p a od:BPMPaper; od:toPatternURI ?a . }
optional {?p a od:BPMPaper; od:toCategory ?c . }
}';
try {
$graph = $sparql->query($query);
} catch (Exception $e) {
print "<div class='error'>".$e->getMessage()."</div>\n";
}
$a=array();
foreach($graph->allOfType('bpm:Pattern') as $bmp) {
$paper=array();
foreach ($bmp->all("od:relatedPaper") as $v) {
$paper[]=str_replace('http://bpmpatterns.org/rdf/','',$v->getURI());
}
$cat=array();
foreach ($bmp->all("od:relatedCategory") as $v) {
$cat[]=str_replace('http://bpmpatterns.org/rdf/Model#','',$v->getURI());
}
$uri=str_replace('http://bpmpatterns.org/rdf/','',$bmp->getURI());
$out="<h3>".$uri."</h3>";
$out.="<p>".join(", ",$bmp->all("skos:prefLabel"))."</p>";
if (!empty($paper)) {
$out.="<p><strong>References: </strong>".join(", ",$paper)."</p>";
}
if (!empty($cat)) {
$out.="<p><strong>Categories: </strong>".join(", ",$cat)."</p>";
}
$a[$uri]="<div>\n$out\n</div>\n";
}
ksort($a);
$out='<h2>Business Process Model Patterns</h2>
<p>The following Business Process Model Patterns are derived from <a
href="http://bpmpatterns.org/">bpmpatterns.org</a>.</p>
<div class="concept">
'.join("\n", $a).'
</div> <!-- end concept list -->';
return '<div class="container">'.$out.'</div>';
}
echo showpage(theBusinessProcessModelPatterns());
?>