-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplayprop.php
More file actions
37 lines (31 loc) · 896 Bytes
/
displayprop.php
File metadata and controls
37 lines (31 loc) · 896 Bytes
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
<?php
/**
* User: Hans-Gert Gräbe
* Last Update: 2022-08-14
* Display only the properties of an URI exploring the WUMM SPARQL Endpoint.
*/
require 'vendor/autoload.php';
require_once 'helper.php';
require_once 'layout.php';
function displayProp($uri) {
setNamespaces();
global $sparql;
$query = '
construct { ?s ?p ?o . }
where
{?s ?p ?o . filter regex(?s,"'.$uri.'") }
LIMIT 100';
$result=$sparql->query($query);
$out=$result->dump("html");
$out=str_replace("href='http://opendiscovery.org/rdf/",
"href='displayprop.php?uri=",
$out);
$out=str_replace('Model#', '', $out);
$prefix='<p><a href="http://wumm.uni-leipzig.de">Home</a></p>';
return $prefix.$out;
}
$uri=$_GET["uri"]; // e.g.
//$uri='http://opendiscovery.org/rdf/Concept/EngineeringProblem';
//$uri='Concept/theory';
echo displayProp($uri);
?>