-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttlToRdf.php
35 lines (24 loc) · 1.18 KB
/
ttlToRdf.php
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
<?php
require_once('vendor/autoload.php');
$ontology = $_GET['ontology'];
switch(strtolower($ontology)){
case 'itcat':
//https://raw.githubusercontent.com/ITcatalog/ITcat/master/Ontology/SchemaGraph.ttl
$ttl = 'https://raw.githubusercontent.com/ITcatalog/ITcat/master/Ontology/'.$_GET['file'].'.ttl';
break;
case 'edugraph':
//https://raw.githubusercontent.com/EduGraph/bise-ontology/master/bise_schema.ttl
$ttl = 'https://raw.githubusercontent.com/EduGraph/bise-ontology/master/ontology/'.$_GET['file'].'.ttl';
break;
}
$client = new GuzzleHttp\Client(['base_uri' => 'http://any23.org/']);
$response = $client->request('GET', 'rdfxml/' . $ttl );
// Response
header('HTTP/ ' . $response->getStatusCode() .' ' . $response->getReasonPhrase());
//http_response_code($response->getStatusCode());
//header('Content-Type: ' . implode( $response->getHeader('Content-Type')));
header('Content-Type: text/plain; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Accept-Ranges: bytes');
echo $response->getBody();
//http://www.essepuntato.it/lode/lang=de/https://raw.githubusercontent.com/ITcatalog/ITcat/master/Ontology/SchemaGraph.rdf