TableX URI resolving for sample aggregation
Can the table plugin resolve any URI with label if aggregated via SAMPLE ? I understand it's difficult for concatenations but shouldn't be for a single URI (maybe also min, max)
Can the table plugin resolve any URI with label if aggregated via SAMPLE ?
No, because this is on the Sparnatural query generation side. A query with URI and label looks like:
SELECT ?person ?person_label
So if we do a SAMPLE, it is either on ?person (the URi variable) ?person_label (the label variable), or on both. But if we do a SAMPLE on both (example SELECT (SAMPLE (?person) AS ?person_sample) (SAMPLE(?person_label) AS ?person_label_sample) then we would not have any garantee that the value sampled for ?person and the value sampled for ?person_label actually correspond to each other.
To achieve this we would require a subquery (which Sparnatural does not support - yet (?) ) :
SELECT ?person_sample ?person_sample_label
WHERE {
{
SELECT (SAMPLE(?person) AS ?person_sample)
WHERE {
// ....
}
}
?person_sample rdfs:label ?person_sample_label
}
Makes sense!