Targeting all subjects & objects regardless of predicate

Hello,

I asked a question on SO (
https://stackoverflow.com/questions/60993789/targeting-all-nodes-for-validation
) regarding how to verify that every node in my graph had a rdf:type and
that the type was ultimately either a rdfs:Class or rdf:Property. The
response I received was that it was impossible with SHACL because:

The problem is that none of the four built-in target types is sufficient to
reach all subject/objects regardless of predicate.

I was just wondering why such a target type does not exist or if there were
plans to include such a target type in the future...?

I was able to do what I needed to do with SPARQL with the following query:

                    {
                        ?s rdf:type+ ?o .
                        FILTER NOT EXISTS {
                            ?s rdf:type+ ?c .
                            FILTER(?c IN (rdfs:Class, rdf:Property))
                        }
                    }

but, I would have preferred to use SHACL.

Regards,
James

Received on Friday, 10 April 2020 20:21:30 UTC