Search code examples
owlontologysemantic-webrdfsturtle-rdf

What does rdfs:domain and rdfs:range mean?


I simply do not understand what either rdfs:domain and rdfs:range mean.

I have read what is says here, but it isn't clear enough.

If someone could explain it with an example, that would be great.


Solution

  • If you have an object property related with domain Class1 and range Class2, it will infer that whenever 2 individuals x,y are related via related, then x will be inferred to be of type Class1 and y will be inferred to be of type Class2.

    DomainRangeExample:related rdf:type owl:ObjectProperty ;
                               rdfs:domain DomainRangeExample:Class1 ;
                               rdfs:range DomainRangeExample:Class2 .
    
    DomainRangeExample:Class1 rdf:type owl:Class .
    
    DomainRangeExample:Class2 rdf:type owl:Class .
    
    DomainRangeExample:x rdf:type owl:NamedIndividual ;
                                   DomainRangeExample:related DomainRangeExample:y .
    
    DomainRangeExample:y rdf:type owl:NamedIndividual .