Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Safe" flag for riot RDFS inference #1720

Open
rybesh opened this issue Jan 17, 2023 · 4 comments · May be fixed by #2959
Open

"Safe" flag for riot RDFS inference #1720

rybesh opened this issue Jan 17, 2023 · 4 comments · May be fixed by #2959
Labels
enhancement Incrementally add new feature

Comments

@rybesh
Copy link
Contributor

rybesh commented Jan 17, 2023

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?

@rybesh rybesh added the enhancement Incrementally add new feature label Jan 17, 2023
@afs
Copy link
Member

afs commented Jan 18, 2023

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.

@justin2004
Copy link

It seems that riot --rdfs is follwing RDFS 1.1 instead of OWL (which redefines rdfs:range).

@justin2004
Copy link

do we have a solution for this?

@afs
Copy link
Member

afs commented Sep 20, 2024

There hasn't been a PR. Here's hoping!

Or do you mean RDFS vs OWL? What's the difference? because in RDFS (rule rdfs3, RDF Semantics) is giving “generalized” RDF.

The link given above says "OWL1 Lite" has a restriction on the use of rdfs:range - not OWL in general.
For OWL2, see https://www.w3.org/TR/owl2-rdf-based-semantics/#table-semcond-rdfs.

afs added a commit to afs/jena that referenced this issue Jan 18, 2025
@afs afs linked a pull request Jan 18, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Incrementally add new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants