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

directSubClassOf, directType, directSubPropertyOf #124

Open
VladimirAlexiev opened this issue Oct 14, 2020 · 2 comments
Open

directSubClassOf, directType, directSubPropertyOf #124

VladimirAlexiev opened this issue Oct 14, 2020 · 2 comments

Comments

@VladimirAlexiev
Copy link
Contributor

VladimirAlexiev commented Oct 14, 2020

(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

  • One could hack it with complex and inefficient queries like this:
select * {
  ?x rdfs:subClassOf ?y
  filter (?x != ?y && 
    !exists {?x rdfs:subClassOf ?z. ?z rdfs:subClassOf ?y. 
      filter(?x != ?z && ?z != ?y)})}
  • an approximation is also possible by using Entailment Regimes or vendor specific mechanisms like onto:explicit, eg
# Q1
select * from onto:explicit {
  ?x rdfs:subClassOf ?y
}
# Q2
select * from onto:explicit {
  ?x rdf:type ?y
}

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
Copy link
Collaborator

afs commented Oct 14, 2020

@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
Copy link
Contributor Author

VladimirAlexiev commented Oct 15, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants