Inference rules for RDF(S) and OWL in N3Logic

by   Dominik Tomaszuk, et al.

This paper presents inference rules for Resource Description Framework (RDF), RDF Schema (RDFS) and Web Ontology Language (OWL). Our formalization is based on Notation 3 Logic, which extended RDF by logical symbols and created Semantic Web logic for deductive RDF graph stores. We also propose OWL-P that is a lightweight formalism of OWL and supports soft inferences by omitting complex language constructs.



There are no comments yet.


page 1

page 2

page 3

page 4


Logical Foundations of RDF(S) with Datatypes

The Resource Description Framework (RDF) is a Semantic Web standard that...

SHACL Constraints with Inference Rules

The Shapes Constraint Language (SHACL) has been recently introduced as a...

Defeasible RDFS via Rational Closure

In the field of non-monotonic logics, the notion of Rational Closure (RC...

A Framework for Parallelizing OWL Classification in Description Logic Reasoners

In this paper we report on a black-box approach to parallelize existing ...

Interpretations of the Web of Data

The emerging Web of Data utilizes the web infrastructure to represent an...

From 9-IM Topological Operators to Qualitative Spatial Relations using 3D Selective Nef Complexes and Logic Rules for bodies

This paper presents a method to compute automatically topological relati...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

Resource Description Framework (RDF) is a general method for conceptual description or modeling of information that is implemented in web resources. RDF Schema (RDFS) extends RDF to classes providing basic elements for the description of vocabularies. OWL adds more vocabulary for describing properties and classes i.e. relations between classes, cardinality, and richer typing of properties. Unfortunately, OWL has high worst-case complexity results for key inference problems. To overcome this problem we propose a lightweight OWL profile called OWL-P.

A rule is perhaps one of the most understandable notion in computer science. It consists of the condition and the conclusion. If some condition that is checkable in some dataset holds, then the conclusion is processed. In the same way RDF(S) and OWL entailments work.

The paper is constructed according to sections. Section II presents RDF and Notation 3 Logic concepts. In Section III we present inference rules for RDF. RDFS and OWL in N3Logic. Section IV is devoted to related work. The paper ends with conclusions.

Ii Preliminaries

The RDF data model rests on the concept of creating web-resource statements in the form of subject-predicate-object expressions, which in the RDF terminology, are referred to as triples (or statements).

An RDF triple comprises a subject, a predicate, and an object. In [28], the meaning of subject, predicate and object is explained. The subject denotes a resource, the object fills the value of the relation, the predicate refers to the resource’s characteristics or aspects and expresses a subject – object relationship. The predicate denotes a binary relation, also known as a property.

Following [28], we provide definitions of RDF triples below.

Definition 1 (RDF triple).

Assume that is the set of all Internationalized Resource Identifier (IRI) references, (an infinite) set of blank nodes, the set of literals. An RDF triple is defined as a triple where is called the subject, is called the predicate and is called the object.

The elemental constituents of the RDF data model are RDF terms that can be used in reference to resources: anything with identity. The set of RDF terms is divided into three disjoint subsets: IRIs, literals, and blank nodes.

Definition 2 (IRIs).

IRIs serve as global identifiers that can be used to identify any resource.

Definition 3 (Literals).

Literals are a set of lexical values. It can be a set of plain strings, such as "Apple", optionally with an associated language tag, such as "Apple"@en.

Remark 1.

In RDF 1.1 literals comprise a lexical string and a datatype, such as "1"^^

Remark 2.

In literals datatypes are identified by IRIs, where RDF borrows many of the datatypes defined in XML Schema 1.1 [26].

Definition 4 (Blank nodes).

Blank nodes are defined as existential variables used to denote the existence of some resource for which an IRI or literal is not given.

Remark 3.

Blank nodes are inconstant or stable identifiers and are in all cases locally scoped to the RDF store or the RDF file.

A collection of RDF triples intrinsically represents a labeled directed multigraph. The nodes are the subjects and objects of their triples. RDF is often referred to as being graph structured data where each triple can be interpreted as an edge .

Definition 5 (RDF graph).

Let and , then is a finite subset of RDF triples, which is called RDF graph.

On the other hand, in the Semantic Web environment there is a Notation3 format, which offers a new human-readable serialization of RDF model but it also extended RDF by logical symbols and created a new Semantic Web logic called Notation3 Logic (N3Logic). Following [2], we provide definitions of N3Logic below.

Definition 6 (N3Logic alphabet).

A N3Logic alphabet consists of the following disjoint classes of symbols:

  1. a set of IRI symbols beginning with < and ending with >,

  2. a set of literals beginning and ending with ",

  3. a set of variables, , where is a set of existential variables (blank nodes in RDF-sense) start with _: and is a set of universal variables start with ?,

  4. brackets {, },

  5. a logical implication =>,

  6. a period .,

  7. a period @false.

Remark 4.

Notation3 allows to abbreviate IRIs by using prefixes. Instead of writing <>, we can write ex:.

Remark 5.

Each IRI, variable and literal is an expression.

Remark 6.

{} is an expression called formula.

Remark 7.

=> is a formula called implication.

In Notation3 literals, IRIs, variables or even formula expressions can be subjects, objects or predicates.

Iii Inference rules

In this section, we introduce inference rules for RDF, RDFS and OWL. Inference rules connected with RDF(S) and OWL are basis of the deductive RDF graph stores.

Definition 7 (Deductive RDF graph store).

A deductive RDF graph store is an entity which remembers RDF triples and can generate new ones under certain conditions through deduction or inference. It can answer queries about the combined given and inferred triples.

Iii-a RDF and RDFS

In Table I we present patterns which hold by RDF and RDFS entailments. All rules are tested in reasoning engines such as FuXi111 and cwm222

Conditions Conclusions
{?S ?P ?O} => {?P rdf:type rdf:Property}.
{?P rdfs:domain ?C. ?S ?P ?O} => {?S rdf:type ?C}.
{?P rdfs:range ?C. ?S ?P ?O} => {?O rdf:type ?C}.
{?S ?P ?O} => {?S rdf:type rdfs:Resource}.
{?S ?P ?O} => {?O rdf:type rdfs:Resource}.
{?Q rdfs:subPropertyOf ?R. ?P rdfs:subPropertyOf ?Q} => {?P rdfs:subPropertyOf ?R}.
{?Q rdf:type rdf:Property} => {?Q rdfs:subPropertyOf ?Q}.
{?P rdfs:subPropertyOf ?R. ?S ?P ?O} => {?S ?R ?O}.
{?C rdf:type rdfs:Class} => {?C rdfs:subClassOf rdfs:Resource}.
{?A rdfs:subClassOf ?B. ?S rdf:type ?A} => {?S rdf:type ?B}.
{?Q rdf:type rdfs:Class} => {?Q rdfs:subClassOf ?Q}.
{?B rdfs:subClassOf ?C. ?A rdfs:subClassOf ?B} => {?A rdfs:subClassOf ?C}.
{?X rdf:type rdfs:ContainerMembershipProperty} => {?X rdfs:subPropertyOf rdfs:member}.
{?X rdf:type rdfs:Datatype} => {?X rdfs:subClassOf rdfs:Literal}.
TABLE I: Inference rules for RDF and RDFS

Iii-B Owl

In Table II we analyze existing proposals for different OWL2 profiles: RDFS++ [1], L2 [6], RDF 3.0/OWLPrime [10], OWLSIF/pD* [27], OWL-LD [7] and OWL-RL [20]. We check which terms are most commonly used and propose a new version of OWL 2 called OWL-P. We also considered time complexity for detecting a required rule application and frequently used vocabulary terms in our corpus. The snapshot (Table III) is built by [13] and use seeds from [24].

This profile of OWL2 is simpler that OWL-RL. It drops support for restriction and cardinality classes, class relationships and list-based axioms. In the Table IV, Table V and we present inference rules of OWL-P.

OWLPrime pD*
TABLE II: Comparison of OWL profiles
voc terms
owl:AllDifferent 111
owl:AllDisjointClasses 21
owl:AllDisjointProperties 13
owl:allValuesFrom 126330
owl:assertionProperty 0
owl:AsymmetricProperty 0
owl:cardinality 23910
owl:complementOf 873
owl:DatatypeProperty 27471
owl:differentFrom 784
owl:disjointUnionOf 0
owl:disjointWith 3743
owl:equivalentClass 29708
owl:equivalentProperty 201
owl:FunctionalProperty 3730
owl:hasKey 5
owl:hasSelf 3
owl:hasValue 1877
owl:intersectionOf 2681
owl:InverseFunctionalProperty 94
owl:inverseOf 1341
owl:IrreflexiveProperty 0
owl:maxCardinality 257371
owl:minCardinality 455203
owl:ObjectProperty 40330
owl:oneOf 853
owl:propertyChainAxiom 68
owl:propertyDisjointWith 4
owl:qualifiedCardinality 109
owl:qualifiedMaxCardinality 2
owl:qualifiedMinCardinality 20
owl:sameAs 3967150
owl:someValuesFrom 4446
owl:sourceIndiviual 0
owl:SymmetricProperty 194
owl:targetIndividual 0
owl:targetValue 11
owl:TransitiveProperty 267
owl:unionOf 53735
rdfs:domain 111865
rdfs:range 59252
rdfs:subClassOf 1339391
rdfs:subPropertyOf 13416
TABLE III: Vocabulary terms used in LOD snapshot 2015
Conditions Conclusions
{?S ?P ?O} => {?S owl:sameAs ?S. ?P owl:sameAs ?P.
?O owl:sameAs ?O}.
{?S owl:sameAs ?O} => {?O owl:sameAs ?S}.
{?Q owl:sameAs ?R. ?R owl:sameAs ?P} => {?Q owl:sameAs ?P}.
{?S owl:sameAs ?S2. ?S ?P ?O} => {?S2 ?P ?O}.
{?P owl:sameAs ?P2. ?S ?P ?O} => {?S ?P2 ?O}.
{?O owl:sameAs ?O2. ?S ?P ?O} => {?S ?P ?O2}.
{?Q owl:sameAs ?R. ?Q owl:differentFrom ?R} => {@false}.
{?P rdf:type owl:FunctionalProperty.
?Q ?P ?R1. ?Q ?P ?R2} => {?R1 owl:sameAs ?R2}.
{?P rdf:type owl:InverseFunctionalProperty.
?Q1 ?P ?R. ?Q2 ?P ?R} => {?Q1 owl:sameAs ?Q2}.
{?P rdf:type owl:IrreflexiveProperty. ?Q ?P ?Q} => {@false}.
{?P rdf:type owl:SymmetricProperty. ?Q ?P ?R} => {?R ?P ?Q}.
{?P rdf:type owl:AsymmetricProperty. ?Q ?P ?R. ?R ?P ?Q } => {@false}.
{?P rdf:type owl:TransitiveProperty. ?Q ?P ?R. ?R ?P ?P} => {?Q ?P ?P}.
{?P1 owl:equivalentProperty ?P2. ?Q ?P1 ?R} => {?Q ?P2 ?R}.
{?P1 owl:equivalentProperty ?P2. ?Q ?P2 ?R} => {?Q ?P1 ?R}.
{?P1 owl:propertyDisjointWith ?P2. ?Q ?P1 ?R. ?Q ?P2 ?R} => {@false}.
{?P1 owl:inverseOf ?P2. ?Q ?P1 ?R} => {?R ?P2 ?Q}.
{?P1 owl:inverseOf ?P2 . ?Q ?P2 ?R} => {?R ?P1 ?Q}.
TABLE IV: Inference rules for OWL-P properties
Conditions Conclusions
{?A owl:equivalentClass ?B . ?x rdf:type ?A} => {?x a ?B}.
{?A owl:equivalentClass ?B . ?x rdf:type ?B} => {?x a ?A}.
{?A owl:disjointWith ?B.
{ ?x rdf:type ?A. ?x rdf:type ?B} => {@false}
{?C rdf:type owl:Class} => {?C rdfs:subClassOf ?C. ?C owl:Thing.
?C owl:equivalentClass ?C.
owl:Nothing rdfs:subClassOf ?C}.
{?A owl:equivalentClass ?B} => {?A rdfs:subClassOf ?B. ?B rdfs:subClassOf ?A}.
{?A rdfs:subClassOf ?B.
?B rdfs:subClassOf ?A} => {?A owl:equivalentClass ?B}.
{?P rdf:type owl:ObjectProperty} => {?P rdfs:subPropertyOf ?P.
?P owl:equivalentProperty ?P}.
{?P rdf:type owl:DatatypeProperty} => {?P rdfs:subPropertyOf ?P.
?P owl:equivalentProperty ?P}.
{?P owl:equivalentProperty ?R} => {?P rdfs:subPropertyOf ?R.
?R rdfs:subPropertyOf ?P}.
{?P rdfs:subPropertyOf ?R.
?R rdfs:subPropertyOf ?P} => {?P owl:equivalentProperty ?R}.
TABLE V: Inference rules for OWL-P classes

Iv Related Work

One of the most important general purpose logic programming language is Prolog

[4]. It is declarative, which means that the program logic is declared in terms of relations, represented as facts and rules. Yet anoder declarative language is Datalog [5], which is syntactically a subset of Prolog. Apart from the Notation3, there are other rule-based inference engines formats for the Semantic Web, such as: FOL-RuleML [8], SWRL [12], RIF [14], R-DEVICE [3], TRIPLE [25], Jena rule333 and SPIN [17].

FOL-RuleML (First-order Logic Rule Markup Language) [8] is a rule language for expressing first-order logic for the web. It is a sublanguage of RuleML [9]. In FOL-RuleML each of rules consists of a set of statements called an atom. The atom is a form which consists of objects which are individuals or variables, and a relation between them.

SWRL (Semantic Web Rule Language) [12] is based on OWL [21] and Unary/Binary Datalog RuleML, which sublanguage of the RuleML. It extends the set of OWL axioms to include Horn-like rules. Logical operators and quantifications supports of SWRL are the same as in RuleML. Moreover, RuleML contents can be parts of SWRL content. Axioms may consist of OWL, RDF and rule axioms. A relation can be an IRI, a data range, an OWL property or a built-in relation. An object can be a variable, an individual, a literal value or a blank node.

RIF (Rule Interchange Format) [14] is a standard for exchanging rules among disparate systems. It focused on exchange rather than developing a single one-fits-all rule language. It can be separated into a number of parts, RIF-core [23] which is the common core of all RIF dialects, RIF-BLD (Basic Logic Dialect) [15] comprising basic dialects (i.e. Horn rules) for writing rules, RIF-PRD [18] (Production Rule Dialect) for representing production rules and RIF-DTB (Datatypes and Built-in Functions) [22] comprising a set of datatypes and built-in functions.

R-DEVICE [3] is a deductive rule language for reasoning about RDF data. In R-DEVICE resources are represented as objects and RDF properties are realized as multi-slots. It supports a second-order syntax, where variables can range over classes and properties. It provides a RuleML-like syntax.

TRIPLE [25] is an RDF rule (query, inference, and transformation) language, with a layered and modular nature. It is based on Horn Logic [11] and F-Logic [16]. Rules in TRIPLE are used for transient querying and cannot be used for defining and maintaining views.

SPIN (SPARQL Inferencing Notation) [17] is a constraint and SPARQL-based rule language for RDF. It can link class with queriesto capture constraints and rules which describe the behavior of those classes. SPIN is also a method to represent queries as templates. It can represent SPARQL statement as RDF triples. That proposal allows to declare new SPARQL functions.

Jena rule is a rule format used only by inference engine in the Jena framework [19]. The rule language syntax is based on RDF. It uses the triple representation, which is similar to Notation3 except that a rule name can be specified in a rule. There are not any formula notation, and built-in functions are written in function terms.

V Conclusions

This paper define how knowledge and logic might be handled on the Semantic Web environment. We present inference rules RDF, RDF Schema and OWL. All rules are tested in reasoning engines. Our formalization is based on Notation 3 Logic, which extended RDF by logical symbols and created a new Semantic Web logic. Moreover, we propose a lightweight OWL profile called OWL-P. Our proposed rule will be useful for deductive RDF graph stores.


  • [1] Overview of rdfs++. Accessed: 2016-01-06.
  • [2] Dörthe Arndt, Ruben Verborgh, Jos De Roo, Hong Sun, Erik Mannens, and Rik Van de Walle. Semantics of Notation3 Logic: A solution for implicit quantification. In Proceedings of the 9th International Web Rule Symposium, August 2015.
  • [3] Nick Bassiliades and Ioannis Vlahavas. R-device: A deductive rdf rule language. In Rules and Rule Markup Languages for the Semantic Web, pages 65–80. Springer, 2004.
  • [4] William Clocksin and Christopher S Mellish. Programming in PROLOG. Springer Science & Business Media, 2003.
  • [5] Thomas Eiter, Georg Gottlob, and Heikki Mannila. Disjunctive datalog. ACM Transactions on Database Systems (TODS), 22(3):364–418, 1997.
  • [6] Florian Fischer, Gulay Unel, Barry Bishop, and Dieter Fensel. Towards a scalable, pragmatic knowledge representation language for the web. In Perspectives of Systems Informatics, pages 124–134. Springer, 2010.
  • [7] Birte Glimm, Aidan Hogan, Markus Krotzsch, and Axel Polleres. Owl ld: Entailment ruleset and implementational notes.
  • [8] Mike Dean Benjamin Grosof Michael Sintek Bruce Spencer Said Tabet Harold Boley and Gerd Wagner. FOL RuleML: The First-Order Logic Web Language. Technical report, November 2004.
  • [9] Tara Athan Adrian Paschke Adrian Giurca Nick Bassiliades Guido Governatori Monica Palmirani Adam Wyner Gen Zou Harold Boley and Zhili Zhao. Specification of Deliberation RuleML 1.01. Technical report, 2012.
  • [10] Jim Hendler. Rdfs 3.0. In W3C Workshop – RDF Next Steps. World Wide Web, 2010.
  • [11] Alfred Horn. On sentences which are true of direct unions of algebras. The Journal of Symbolic Logic, 16(01):14–21, 1951.
  • [12] Ian Horrocks, Peter F Patel-Schneider, Harold Boley, Said Tabet, Benjamin Grosof, Mike Dean, et al. SWRL: A semantic web rule language combining OWL and RuleML. W3C member submission, World Wide Web Consortium, May 2004.
  • [13] Robert Isele, Jürgen Umbrich, Chris Bizer, and Andreas Harth. LDSpider: An open-source crawling framework for the web of linked data. In Proceedings of 9th International Semantic Web Conference (ISWC 2010) Posters and Demos, 2010.
  • [14] Michael Kifer. Rule interchange format: The framework. In Web reasoning and rule systems, pages 1–11. Springer, 2008.
  • [15] Michael Kifer and Harold Boley. RIF Basic Logic Dialect (Second Edition). W3C recommendation, World Wide Web Consortium, February 2013.
  • [16] Michael Kifer and Georg Lausen. F-logic: a higher-order language for reasoning about objects, inheritance, and scheme. In ACM SIGMOD Record, volume 18, pages 134–146. ACM, 1989.
  • [17] Holger Knublauch, James A. Hendle, and Kingsley Idehen. SPIN - Overview and Motivation. W3C member submission, World Wide Web Consortium, February 2011.
  • [18] Christian de Sainte Marie, Adrian Paschke, and Gary Hallmark. RIF Production Rule Dialect (Second Edition). W3C recommendation, World Wide Web Consortium, February 2013.
  • [19] Brian McBride. Jena: A semantic web toolkit. IEEE Internet computing, (6):55–59, 2002.
  • [20] Boris Motik, Bernardo Cuenca Grau, Ian Horrocks, Achille Fokoue, and Zhe Wu. OWL 2 web ontology language profiles (second edition). W3C recommendation, World Wide Web Consortium, December 2012.
  • [21] Bijan Parsia, Sebastian Rudolph, Markus Krötzsch, Peter Patel-Schneider, and Pascal Hitzler. OWL 2 Web Ontology Language Primer (Second Edition). W3C recommendation, World Wide Web Consortium, December 2012.
  • [22] Axel Polleres, Michael Kifer, and Harold Boley. RIF Datatypes and Built-Ins 1.0 (Second Edition). W3C recommendation, World Wide Web Consortium, February 2013.
  • [23] Dave Reynolds, Michael Kifer, Axel Polleres, Harold Boley, Adrian Paschke, and Gary Hallmark. RIF Core Dialect (Second Edition). W3C recommendation, World Wide Web Consortium, February 2013.
  • [24] Max Schmachtenberg, Christian Bizer, and Heiko Paulheim. Adoption of the linked data best practices in different topical domains. In The Semantic Web–ISWC 2014, pages 245–260. Springer, 2014.
  • [25] Michael Sintek and Stefan Decker. TRIPLE-An RDF Query, Inference, and Transformation Language. In INAP, pages 47–56, 2001.
  • [26] Michael Sperberg-McQueen, Ashok Malhotra, Paul V. Biron, Sandy Gao, Henry Thompson, and David Peterson. W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes. W3C recommendation, World Wide Web Consortium, April 2012.
  • [27] Herman J ter Horst. Completeness, decidability and complexity of entailment for rdf schema and a semantic extension involving the owl vocabulary. Web Semantics: Science, Services and Agents on the World Wide Web, 3(2):79–115, 2005.
  • [28] David Wood, Markus Lanthaler, and Richard Cyganiak. RDF 1.1 Concepts and Abstract Syntax. W3C recommendation, World Wide Web Consortium, February 2014.