Exemplo n.º 1
0
        expect($results)->to_equal($expected);
    });
    it("should let you get matching descriptions for a (* p o)  triple pattern", function () {
        global $store;
        $results = $store->get(null, rdftype, biboBook);
        $expected = array();
        expect(count(array_keys($results)))->to_equal(7);
    });
    it("should let you query with an LDPath", function () {
        global $store;
        $results = $store->query("foaf:made/dct:date=1773");
        $uris = array_keys($results);
        expect($uris[0])->to_equal('http://example.org/ecco-tcp/person/Mrs_(anna_Letitia)_Barbauld_1743-1825');
    });
    it("should let you query with simple LDPath rdf:type=foaf:Person", function () {
        global $store;
        $results = $store->query("rdf:type=foaf:Person");
        $uris = array_keys($results);
        expect($uris[0])->to_equal('http://example.org/ecco-tcp/person/A_Alison');
    });
    it("should tell you what namespaces are used in the data", function () {
        $data = array(ex . 'people/tom' => array(ex . 'vocab/name' => array(array('value' => 'Tom', 'type' => 'literal'))));
        $store = new \Raffles\RafflesStore('testdata');
        $store->reset();
        $store->indexPredicates = false;
        $store->load($data);
        expect($store->Index->getSubjectNamespaces())->to_equal(array(ex . 'people/'));
        expect($store->getNamespaces())->to_equal(array(ex . 'people/' => 'r1', ex . 'vocab/' => 'r2'));
    });
});
\pecs\run();
Exemplo n.º 2
0
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (empty($_POST)) {
        serveErrorPage('The file is too big for this server; try increasing the maximum post size and file upload settigns in php.ini, or at the command line, in your trilby directory, run: php bin/add-data.php {filename}');
    }
    try {
        savePostToConfig();
        uploadData();
    } catch (SetupException $e) {
        serveErrorPage($e->getMessage());
    }
    redirect('_setup');
} else {
    $maxfileSize = return_bytes(ini_get('upload_max_filesize'));
    $Store = new \Raffles\RafflesStore(RAFFLES_DATA_DIR);
    $ns = $Store->getNamespaces();
    $Config = getConfig(false);
    if (empty($Config->prefixes)) {
        $Config->prefixes = new StdClass();
    }
    foreach ($ns as $nsUri => $prefix) {
        if (empty($Config->prefixes->{$prefix})) {
            $Config->prefixes->{$prefix} = $nsUri;
        }
    }
    $innerTemplate = 'setup.html';
    $showMap = false;
    $title = 'Setup';
    $site_name = 'Trilby';
    $licenses = getLicenses();
    require 'templates/outer.html';