-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_statement.php
More file actions
69 lines (43 loc) · 2.07 KB
/
test_statement.php
File metadata and controls
69 lines (43 loc) · 2.07 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
<?php
require_once 'inc.php';
// use InfModelF
$infModel = ModelFactory::getInfModelF('onto://InfModelF/', TRUE);
$infModel->startProfile();
// standard RDFS / OWL
$subPropertyOf = RDFS_RES::SUB_PROPERTY_OF();
$subClassOf = RDFS_RES::SUB_CLASS_OF();
$subClassOf = OWL_RES::INVERSE_OF();
// define classes
$game = new RDFResource(NS . 'Game');
$ktulu = new RDFResource(NS . 'CallOfChtulhu');
$ktulu2 = new RDFResource(NS . 'CallOfChtulhu2');
$person = new RDFResource(NS . 'Person');
$master = new RDFResource(NS . 'Master');
$player = new RDFResource(NS . 'Player');
// define properties
$pPlays = new RDFResource(NS . 'Plays');
$pPlayedBy = new RDFResource(NS . 'IsPlayedBy');
$pDirects = new RDFResource(NS . 'Directs');
$pDirectedBy = new RDFResource(NS . 'IsDirectedBy');
$pPartecipates = new RDFResource(NS . 'Partecipates');
$pPartecipatedBy = new RDFResource(NS . 'IsPartecipatedBy');
$pKnows = new RDFResource(NS . 'Knows');
// define taxonomies (RDF triples)
// and add them to infModel
$infModel->add(new Statement($ktulu, $subClassOf, $game));
$infModel->add(new Statement($ktulu2, $subClassOf, $ktulu));
$infModel->add(new Statement($master, $subClassOf, $person));
$infModel->add(new Statement($player, $subClassOf, $person));
$infModel->add(new Statement($pPlays, $subPropertyOf, $pPartecipates));
$infModel->add(new Statement($pDirects, $subPropertyOf, $pPartecipates));
// property characteristics
$infModel->add(new Statement($pPlayedBy, OWL_RES::INVERSE_OF(), $pPlays));
$infModel->add(new Statement($pDirectedBy, OWL_RES::INVERSE_OF(), $pDirects));
$infModel->add(new Statement($pPartecipatedBy, OWL_RES::INVERSE_OF(), $pPartecipates));
$infModel->add(new Statement($pKnows, OWL_RES::SYMMETRIC_PROPERTY(), $pKnows));
// define ontologic statements
$infModel->add(new Statement($master, $pDirects, $game));
$infModel->add(new Statement($player, $pPlays, $game));
$infModel->add(new Statement($master, $pKnows, $player));
require_once 'end.php';
?>