"Safe" flag for riot RDFS inference
Version
4.7.0
Feature
Currently, riot RDFS inference outputs “generalized” RDF which may not be parsable by other tools (including various Jena CLI tools). For example:
data.ttl
PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ex:louie ex:birthdate "2022-08-11”^^xsd:date .
vocab.ttl
PREFIX ex: <http://example.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ex:birthdate rdfs:range xsd:date .
Output of riot --rdfs=vocab.ttl data.ttl
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
"2022-08-11”^^xsd:date rdf:type xsd:date .
… which is generalized RDF due to the literal in the subject position.
It would be nice if there were a flag to filter out such triples (using SafeGraph), so as to avoid errors when subsequently processing the output with tools that don't accept generalized RDF.
I’m interested in contributing a solution, but would need some pointers as to where in the codebase this should go.
Are you interested in contributing a solution yourself?
Perhaps?
Is it only excluding generalised triples that have literals as subjects?
The RDF expansion is done by RDFSFactory.streamRDFS so adding a legality testing StreamRDF around that would work.