Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort Concepts / Filter Concepts #15

Open
tkurz opened this issue Nov 12, 2012 · 1 comment
Open

Sort Concepts / Filter Concepts #15

tkurz opened this issue Nov 12, 2012 · 1 comment

Comments

@tkurz
Copy link
Owner

tkurz commented Nov 12, 2012

It should be possible to sort Concepts (static or dynamic)

@jaw111
Copy link

jaw111 commented Jun 27, 2013

One of our requirements is to have custom ranking on concepts, so we have implemented this by adding an optional ranking property on concepts, then in the query to fetch the list of concepts we simply ORDER BY this ranking as follows:

ORDER BY str(if(bound(?rank), ?rank, 'ZZZ')) str(?title) ?uri

The ranking is optional for us, but concepts with a ranking should be listed before those without, so to force this we check if the ?rank variable is bound and if not then give it a value ZZZ. Otherwise in sorting according to SPARQL 1.1 standard, unbound variables are sorted before bound variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants