$result[] = stringify($trip->subject) . ' <' . $trip->predicate . '> ' . stringify($trip->object) . ' . ' . (isset($trip->canonicalObjectValue) ? '#=> '. $trip->canonicalObjectValue : ''); } } } $result = null; if(get_magic_quotes_gpc()) { $_POST['rdf'] = @stripslashes($_POST['rdf']); } if(isset($_POST['rdf']) && strlen($_POST['rdf'])) { $result = array(); $triples = RDF::tripleSetFromXMLString($_POST['rdf']); $subjects = array(); $nodes = array(); dumpTriples($triples, 'Source:'); emit('Processing...'); $hasher = new GraphHasher($triples); $hasher->markInbound(); $hasher->updateHashes(); $hasher->replace(); $hasher->sort(); $hasher->dump('Result:'); } class GraphHasher { public $nodes = array();