GithubHelp home page GithubHelp logo

arche-lib's Introduction

arche-lib's People

Contributors

zozlak avatar

Watchers

James Cloos avatar  avatar  avatar

arche-lib's Issues

Add an option to fetch total matched resources count to the SearchConfig

For the proper paging implementation on the client side a straightforward way for fetching a total matched resources count is required.

This can be done either as a separate type of query returning a single number/technical triple or by adding a special technical triple to each search results. The second approach sounds more appealing as it allows to avoid API changes.

skip tombstone resource from search

There is currently no way to skip tombstone resources while using the Repo/RepoDb search API. This option should be added or tombstone resources should be skipped at all.

Improve performance of a query generated by RepoDb::getPdoStatementBySqlQuery()

If there are many resources matched by the search, using get_relatives_metadata() doesn't result in an optimal execution plan. The better plan could be probably achieved with executing get_relatives() first and then joining the result separately with metadata, relations and identifiers (and taking a union of all of that).

Try to rewrite methods returning arrays of RepoResourceInterface objects to use generators

Currently we are always materializing full search results as arrays but it sounds like a waste of memory.

It's worth trying to rewrite methods searching for resources to return Generators instead.

This has to be tested carefully as it may break other libraries code depending on ability to access a given element within the returned set.

This is a serious API change and should definitely bump a major version number.

SearchTerm order/orderByLang/count issues

UPDATE: 24.01.2022:

so as we agreed, please modify the order to make it work as the "normal" ordering should be :)

count problem solved, i had an outdated arche-lib version.

And this is not a typo -> $config->orderBy = array('^https://vocabs.acdh.oeaw.ac.at/schema#hasAvailableDate'); this is the DESC ordering from the documentation, which is also working.


Original ticket was:

on hephaistos i have the following code:
`

    $config = new \acdhOeaw\arche\lib\SearchConfig();
    $config->limit = 10;
    $config->offset = 0;
    $config->orderBy = array('^https://vocabs.acdh.oeaw.ac.at/schema#hasAvailableDate');
    $config->orderByLang = 'en';
    $term1  = new \acdhOeaw\arche\lib\SearchTerm('http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'https://vocabs.acdh.oeaw.ac.at/schema#TopCollection', '=');
    $results = $this->repo->getResourcesBySearchTerms([$term1], $config);

    echo '<pre>';
    var_dump($config->count);
    echo '</pre>';

`

But the ordering is not working as i expected. Doesn't matter if i use the available date or the hasTitle, both are fetching random results.

Also after the query, the $config->count value is still null.

RepoResource::delete() could return a list of deleted resources

Currently the RepoResource::delete() returns nothing but when recursive deletion is used it would be nice to be able to check which resources have been actually deleted.

Similarly it would be nice to know which references have been removed if $references option was set.

Add sorting option to SearchTerms

The SearchTerm class should allow to define results sorting by a given (set of?) metadata property.

Only properties with literal values can be used for sorting. Resources without a given property should be put at the end.

It would be nice to honor datatype but it might be difficult in practice because there is no guarantee a given property is stored only with a single datatype.

As on the API level returning EasyRdf\Graph there is no natural way to express the sorting order, additional technical property should be introduced for storing it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.