Allow sorting based on triples with integer values
Sorting of search results are currently based on various labels as well as dates. A requirement is that these fields are single-valued. The nature of RDF though is to allow repeated properties and limitations requires knowledge of the schema level which EntryStore is totally oblivious to.
The effect is that the majority of Solr fields are multi-valued and cannot be used for sorting. But even if they were single-valued, the values must have a natural order to be useful for sorting.
E.g. a status flag could be single-valued but the range would probably be literals or URIs that does not necessarily have an order that corresponds to the order needed by a specific use-case.
One exception is direct properties of the resource with integer values:
They can be assumed to be single-valued, the use-cases where you would want to have multiple integers values for an individual property for the same resource are hard to find and can safely be ignored.
There is an inherent ordering that cannot be mistaken, exactly what is meant is determined by the semantics of the predicate, there is no room for interpretation of alternative sorting orders the way it would be for arbitrary literals or URIs.
Hence, a suggestion is to introduce two new solr scheme:
(Alternatively the entry.predicate information could be fit into the metadata.predicate.)
They will only contain triples that have the resourceURI as subject and a literal with one of the numeric datatypes:
See http://www.w3schools.com/xml/schema_dtypes_numeric.asp for a brief overview of the numeric datatypes.
Introduced new predicate integer field for sortable indexing of integer values in Solr