w3c / sparql-dev

SPARQL dev Community Group
https://w3c.github.io/sparql-dev/
Other
124 stars 19 forks source link

directSubClassOf, directType, directSubPropertyOf #124

Open VladimirAlexiev opened 4 years ago

VladimirAlexiev commented 4 years ago

(This is an addition to the RDFS vocab not a SPARQL feature, but I still think this group is an appropriate forum to post such addition.)

Why?

rdfs:subClassOf, rdfs:subPropertyOf are reflexive and transitive, and rdf:type is transitive over subClassOf.

But reflexivity is most often useless, and having the direct (step, non-transitive) variants of such properties is useful in many situations, eg:

Previous work

Workarounds


But this doesn't work in some situations:
- if a transitive relation is inserted explicitly (I'm not sure whether directSubClassOf eliminates such relation instance, either)
- in Q2, if rdf:type itself is inferred (eg from rdfs:domain)

## Proposed solution

It would increase interoperability if this group can pick a w3c namespace for such properties and standardize the names, and rdf4j and jena agree to expose their props under these standard names

## Considerations for backward compatibility

It would be best if rdf4j and jena continue to support these props under both their current names, and the unified names. I hope that such "aliasing" of magic props is easy to achieve.
afs commented 4 years ago

@afs are there RDF props to access these?

There is a general mechanism to get direct forms:

urn:x-hp-direct-predicate:http_//www.w3.org/2000/01/rdf-schema#subClassOf

It can be used via a prefix.

Often it is done by having the inference and base data graphs available in the same dataset so it is a matter of using GRAPH.

VladimirAlexiev commented 4 years ago

Often it is done by having the inference and base data graphs available

I described this as a Workaround above (Q2). Let me clarify: given these triples

:x :p :y.
:p rdfs:domain :a.
:a rdfs:subClassOf :b.

An RDFS inferencer will infer:

:x rdf:type :a. # domain
:x rdf:type :b. # subclass
:a rdfs:subClassOf :a. # reflexivity
:b rdfs:subClassOf :b. # reflexivity

But I'd like only these as "direct":

:x sesame:directType :a. # domain
:a sesame:directSubClassOf :b. # explicit