3

Is there some way to state in RDF/RDFs, that any resource that has a given property is a subclass of a specific class? (or the other case with the object not the subject)

rdfs:domain (respectively range) is close to that but the definition of domain includes "instance", not "subclass":

rdfs:domain is an instance of rdf:Property that is used to state that any resource that has a given property is an instance of one or more classes. RDF Schema 1.1

As an example szenario where this is needed (as range, not domain), imagine that you want to express that :John :likes :Vegetable, where :Vegetable is a subclass of food.

:likes rdfs:range owl:Class would cover the example but it would be too general.

:likes rdfs:range :Food would be incorrect, because :Vegetable is not an instance of :Food but a subclass.

Something like :likes rdfs:range Powerset(:Food) would be better but I don't know how to specify that using RDF and RDFs.

In Java, it would be:

public abstract class Person
{
    public static class Food {}

    abstract Class<? extends Food> likes();
}

One could model that using OWL axioms with universal quantification but I wonder if that is possible without OWL, because I have large amount of statments that I want to upload to a SPARQL endpoint and expressing OWL axioms in RDF increases the amount of triples by a large amount and makes practical use such as SPARQL queries more complex.

Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
  • 2
    With RDFS, this is not doable. RDFS is rather limited and cannot express lots of things that are quite desirable. OWL can help but what you ask is problematic for OWL because you are talking about a class of classes, which you express by using `Powerset(:Foot)`. OWL with the RDF-based semantics can help, but existing reasoners would struggle (read "be incapable") with this kind of situation. Rule-based languages on top of RDFS could probably solve your modelling issue. You could also try to approximate would you want in different ways, relying on some custom code to fill the gaps. – Antoine Zimmermann Oct 07 '19 at 20:20
  • Thank you for the explanation! I don't use a reasoner so I will probably just approximate it as you suggested and use custom code if it ever presents a problem for my applications or to generate a more correct but less efficient model for publications. – Konrad Höffner Oct 08 '19 at 12:56

0 Answers0