# RDF and RDFS and a subset of OWL rules

@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix : <http://eulersharp.sourceforge.net/2003/03swap/owl-rules#>.

### Web Ontology Language OWL

owl:AnnotationProperty rdfs:subClassOf rdf:Property.
owl:Class rdfs:subClassOf rdfs:Class; rdfs:subClassOf rdfs:Class.
owl:DataRange rdfs:subClassOf rdfs:Literal.
owl:DatatypeProperty rdfs:subClassOf rdf:Property.
owl:DeprecatedClass rdfs:subClassOf rdfs:Class.
owl:DeprecatedProperty rdfs:subClassOf rdf:Property.
owl:FunctionalProperty rdfs:subClassOf rdf:Property.
owl:InverseFunctionalProperty rdfs:subClassOf owl:ObjectProperty.
owl:Nothing owl:oneOf rdf:nil.
owl:ObjectProperty rdfs:subClassOf rdf:Property.
owl:OntologyProperty rdfs:subClassOf rdf:Property.
owl:Restriction rdfs:subClassOf owl:Class.
owl:SymmetricProperty rdfs:subClassOf owl:ObjectProperty.
owl:Thing rdfs:subClassOf rdfs:Resource; rdfs:subClassOf rdfs:Resource.
owl:TransitiveProperty rdfs:subClassOf owl:ObjectProperty.

owl:allValuesFrom rdfs:domain owl:Restriction; rdfs:range rdfs:Class.
owl:cardinality rdfs:domain owl:Restriction; rdfs:range xsd:nonNegativeInteger; rdfs:subPropertyOf owl:maxCardinality, owl:minCardinality.
owl:complementOf rdfs:domain owl:Class; rdfs:range owl:Class; rdfs:subPropertyOf owl:disjointWith; a owl:SymmetricProperty.
owl:differentFrom rdfs:domain owl:Thing; rdfs:range owl:Thing; a owl:SymmetricProperty.
owl:disjointWith rdfs:domain owl:Class; rdfs:range owl:Class; a owl:SymmetricProperty.
owl:distinctMembers rdfs:domain owl:AllDifferent; rdfs:range rdf:List.
owl:hasValue rdfs:domain owl:Restriction; rdfs:range rdfs:Resource.
owl:intersectionOf rdfs:domain owl:Class; rdfs:range rdf:List.
owl:inverseOf rdfs:domain owl:ObjectProperty; rdfs:range owl:ObjectProperty; a owl:SymmetricProperty.
owl:maxCardinality rdfs:domain owl:Restriction; rdfs:range xsd:nonNegativeInteger.
owl:minCardinality rdfs:domain owl:Restriction; rdfs:range xsd:nonNegativeInteger.
owl:onProperty rdfs:domain owl:Restriction; rdfs:range rdf:Property.
owl:oneOf rdfs:domain rdfs:Class; rdfs:range rdf:List.
owl:someValuesFrom rdfs:domain owl:Restriction; rdfs:range rdfs:Class.
owl:unionOf rdfs:domain owl:Class; rdfs:range rdf:List.

owl:backwardCompatibleWith rdfs:domain owl:Ontology; rdfs:range owl:Ontology; a owl:OntologyProperty.
owl:imports rdfs:domain owl:Ontology; rdfs:range owl:Ontology; a owl:OntologyProperty.
owl:incompatibleWith rdfs:domain owl:Ontology; rdfs:range owl:Ontology; a owl:OntologyProperty.
owl:priorVersion rdfs:domain owl:Ontology; rdfs:range owl:Ontology; a owl:OntologyProperty.
owl:versionInfo rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource; a owl:AnnotationProperty.

rdfs:comment a owl:AnnotationProperty.
rdfs:isDefinedBy a owl:AnnotationProperty.
rdfs:label a owl:AnnotationProperty.
rdfs:seeAlso a owl:AnnotationProperty.

### inference rules for Web Ontology Language OWL

{?P owl:inverseOf ?Q. ?S ?P ?O} => {?O ?Q ?S}.
{?P owl:inverseOf ?Q. } => {?Q owl:inverseOf ?P}.

{?P rdf:type owl:SymmetricProperty. ?S ?P ?O} => {?O ?P ?S}.

{?P rdf:type owl:TransitiveProperty. ?X ?P ?O. ?S ?P ?X} => {?S ?P ?O}.

{?R owl:onProperty ?P; owl:hasValue ?Y. ?X a ?R} => {?X ?P ?Y}.

{?P rdf:type owl:InverseFunctionalProperty. ?X ?P ?O. ?Y ?P ?O} => {?X owl:sameAs ?Y}.
{?P rdf:type owl:FunctionalProperty. ?S ?P ?X. ?S ?P ?Y} => {?X owl:sameAs ?Y}.

{?X log:notEqualTo ?Y. ?A owl:distinctMembers ?L. ?L :item ?X, ?Y} => {?X owl:differentFrom ?Y}.
{?A  owl:disjointWith ?B. ?X a ?A. ?Y a ?B } => {?X owl:differentFrom ?Y}.

{?A rdfs:subPropertyOf ?B. ?B rdfs:subPropertyOf ?A} => {?A owl:equivalentProperty ?B}.

{?A owl:inverseOf ?C. ?B owl:inverseOf ?C} => {?A rdfs:subPropertyOf ?B}.

## rdfs

### Resource Description Framework RDF(S)

rdf:Alt rdfs:subClassOf rdfs:Container.
rdf:Bag rdfs:subClassOf rdfs:Container.
rdfs:ContainerMembershipProperty rdfs:subClassOf rdf:Property.
rdfs:Datatype rdfs:subClassOf rdfs:Class.
rdf:Seq rdfs:subClassOf rdfs:Container.
rdf:XMLLiteral rdfs:subClassOf rdfs:Literal; a rdfs:Datatype.

rdfs:comment rdfs:domain rdfs:Resource; rdfs:range rdfs:Literal.
rdfs:domain rdfs:domain rdf:Property; rdfs:range rdfs:Class.
rdf:first rdfs:domain rdf:List; rdfs:range rdfs:Resource; a owl:FunctionalProperty.
rdfs:isDefinedBy rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource; rdfs:subPropertyOf rdfs:seeAlso.
rdfs:label rdfs:domain rdfs:Resource; rdfs:range rdfs:Literal.
rdfs:member rdfs:domain rdfs:Container; rdfs:range rdfs:Resource.
rdf:object rdfs:domain rdf:Statement; rdfs:range rdfs:Resource.
rdf:predicate rdfs:domain rdf:Statement; rdfs:range rdf:Property.
rdfs:range rdfs:domain rdf:Property; rdfs:range rdfs:Class.
rdf:rest rdfs:domain rdf:List; rdfs:range rdf:List; a owl:FunctionalProperty.
rdfs:seeAlso rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource.
rdfs:subClassOf rdfs:domain rdfs:Class; rdfs:range rdfs:Class.
rdfs:subPropertyOf rdfs:domain rdf:Property; rdfs:range rdf:Property.
rdf:subject rdfs:domain rdf:Statement; rdfs:range rdfs:Resource.
rdf:type rdfs:domain rdfs:Resource; rdfs:range rdfs:Class.
rdf:value rdfs:domain rdfs:Resource; rdfs:range rdfs:Resource.

rdf:nil a rdf:List.

### inference rules for RDF(S)

{?S ?P ?O} => {?P a rdf:Property}.
{?S ?P ?O} => {?S a rdfs:Resource}.
{?S ?P ?O} => {?O a rdfs:Resource}.

{?P rdfs:domain ?C. ?S ?P ?O} => {?S a ?C}.
{?P rdfs:range ?C. ?S ?P ?O} => {?O a ?C}.

{?Q rdfs:subPropertyOf ?R. ?P rdfs:subPropertyOf ?Q} => {?P rdfs:subPropertyOf ?R}.
{?P rdfs:subPropertyOf ?R. ?S ?P ?O} => {?S ?R ?O}.

{?C a rdfs:Class} => {?C rdfs:subClassOf rdfs:Resource}.

{?A rdfs:subClassOf ?B. ?S a ?A} => {?S a ?B}.
{?B rdfs:subClassOf ?C. ?A rdfs:subClassOf ?B} => {?A rdfs:subClassOf ?C}.

{?X a rdfs:ContainerMembershipProperty} => {?X rdfs:subPropertyOf rdfs:member}.

{?X a rdfs:Datatype} => {?X rdfs:subClassOf rdfs:Literal}.
