Tripod can accept rdf:type as literals
Closed this issue · 3 comments
In tripod we can easily add an rdf:type as a literal value, but the view generation is expecting all rdf:types to be a resource:
https://github.com/talis/tripod-php/blob/master/src/mongo/delegates/Views.class.php#L320
This is throwing a PHP Notice error, and also means that it's not possible to have a viewspec against a type which is literal.
I think tripod should be throwing an exception if it attempts to save an rdf:type as a literal, given that it is specially handled in tripod.
Actually, on second thought, that would mean incompatibility with any graphs which may already be setting this to a literal. Is that something we would want to accept, or should we be instead be making the view regeneration handle literal types?
We shouldn't be setting rdf:type as a literal. I don't think Tripod should be tasked with RDF schema validation.
(To put another way, it's the responsibility of the client application to ensure that their data is valid RDF)