Hi,
every time i call rdf_query(....)
the rdf_get_repositories is called more than one times.
look at function _rdf_get_callbacks(), file rdf.api.inc
then i have several sql queries like "SELECT COUNT(did) FROM rdf_data" or "SELECT COUNT(did) FROM rdf_data_file"
i think its enough to build one repositories array per page load
i want to set the repository in my modul with some simple code like that
// if rdf_repository es empty load it
if(empty($GLOBALS['rdf_repository'])){
$repos = rdf_get_repositories();
rdf_use_repository($repos);
}else{
//else reload from global
$repos = $GLOBALS['rdf_repository'];
}
// call rdf_query with my $repos
$data = rdf_query(NULL, rdf_qname_to_uri('dc:source'), $file->uri, $repos['my_repos']);
to work this way if removed the line
$repos = !empty($repos) ? array_intersect_key(rdf_get_repositories(), array_flip($repos)) : rdf_get_repositories();
in function _rdf_get_callbacks, file rdf.api.inc
i know that this solution can have site effects when rdf_get_repositories() is never called before.
so function _rdf_get_callbacks needs more work
Comments
Comment #1
johanneshahn CreditAttribution: johanneshahn commentedsomething like that???
Comment #2
smustgrave CreditAttribution: smustgrave at Mobomo commented