You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Shaw, Ryan" <ry...@unc.edu> on 2022/11/19 19:13:35 UTC
"Safe" flag for riot RDFS inference?
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/>
ex:louie ex:birthdate "2022-08-11" .
```
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" 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, so as to avoid errors when subsequently processing the output with tools that don't accept generalized RDF.
Re: "Safe" flag for riot RDFS inference?
Posted by Andy Seaborne <an...@apache.org>.
Hi Ryan,
Would you create an issue for this so it doesn't get lost? (Even better
- with a PR)
https://github.com/apache/jena/issues
I'm not convinced it right either:
ex:louie ex:birthdate "2022-08-11" .
It's an xsd:string, not a xsd:date. SHACL would notice.
Andy
On 19/11/2022 19:13, Shaw, Ryan wrote:
> 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/>
>
> ex:louie ex:birthdate "2022-08-11" .
> ```
>
> 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" 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, so as to avoid errors when subsequently processing the output with tools that don't accept generalized RDF.
>
>