W3C home > Mailing lists > Public > public-owl-dev@w3.org > October to December 2007

Defining cross products in OWL-1.1

From: Michael Schneider <schneid@fzi.de>
Date: Fri, 12 Oct 2007 13:14:38 +0200
Message-ID: <0EF30CAA69519C4CB91D01481AEA06A04A8204@judith.fzi.de>
To: "Owl Dev" <public-owl-dev@w3.org>
Cc: "Peter F. Patel-Schneider" <pfps@research.bell-labs.com>

[CC'ed Peter Patel-Schneider, because I cite him in this mail] 

Hi list!

I have started to stroll around a little through the OWL-1.1 issues list
this week, and I found this interesting one (issue 30) yesterday evening:

  "Need a role descrption based on the "cross product" of two concepts"

  (Sorry, I cannot find out who the original author "kashyap.vipul" was.)

After reading this I was not really sure if this issue is about specifying
cross products in general, or just about realizing a specific scenario, with
or without the use of a cross product. But IMHO it /is/ certainly a
noteworthy question if cross products can be specified in OWL or not. I can
see that Peter Patel-Schneider has just commented on this issue: 

  "You are asking for the ability to define roles.

  A similar definition would be
     brother = sibling INTERSECTION range(Male)
  using range(x) as a shorthand for crossProduct(owl:Thing,x)

  This expands expressive power (I'm pretty sure).  
  I don't know whether there is a reasoning algorithm 
  for this construct."

I'm not quite clear if Peter means by "this construct" either the problem of
specifying a cross product in OWL-1.1, or something else? Assuming the first
of these options has motivated me to try out if I am able to specify a cross
product in OWL-1.1. It really seems to work - with some restrictions
discussed below.

Task: For given classes A and B give an OWL-1.1 axiom set, by which a
property pAXB is specified to be equivalent to the cross product A X B.


  (A0) ClassAssertion(w owl:Thing)
  (A1) SubClassOf(A ObjectHasValue(pA w))
  (A2) SubClassOf(B ObjectHasValue(pB w))
  (A3) SubObjectPropertyOf(
         SubObjectPropertyChain(pA InverseObjectProperty(pB))
         pAXB )
  (A4) ObjectPropertyDomain(pAXB A)
  (A5) ObjectPropertyRange(pAXB B)

Axiom (A0) demands the existence of /some/ arbitrary individual w. I will
use this as a "glue instance" to connect two roles in a sub property chain.

Axioms (A1) and (A2) introduce roles 'pA' and 'pB', which are intended to
represent the classes A and B, respectively. The domain of role pA covers
class A (i.e. class A is a sub class of domain(pA)). The right hand side of
a role instance of pA is /always/ the "glue instance" w. Analog for role

Axiom (A3) makes role pAXB into a /super/ role of the cross product A X B:
Let x and y be two instances for which A(x) and B(y) both hold. According to
axioms (A1) and (A2), pA(x,w) and pB(y,w) both hold. Thus, the inverse role
instance pB^-1(w,y) is true, too. Hence, by applying axiom (A3), pAXB(x,y)

Axioms (A4) and (A5) obviously make role pAXB into a /sub/ role of the cross
product A X B = domain(pAXB) X range(pAXB).

So we finally receive pAXB = A X B.

There are a several points which need some further discussion here:

First: Is the above set of axioms allowed at all? I have checked the
"non-structural restrictions" given in [1]. Role pAXB is certainly a
"non-simple" role, as it appears as a super role of a sub role chain. So
certain axioms, in which pAXB occurs, will not be allowed. But the global
'domain' and 'range' restrictions, as given by axioms (A4) and (A5), are not
listed as forbidden restrictions in [1]. So this seems to be ok! (?) 

Second: About the "glue instance" w. The only real requirement was that
there is /some/ instance in the universe (denoted by owl:Thing), because
this alone suffices to use such an instance for glueing pA and pB^-1
together in the above sub role chain. Even the two 'ObjectHasValue' axioms
do not seem to put a dangerous restriction on 'w'. So it seems to be
possible for instance that I can reuse w for specifing the "glue instance"
of a second role rCXD for other classes C and D without any problem. Also,
if w occurs in other axioms of the ontology, this shouldn't be a big
problem, because it does not affect the fact that such a w /exists/. Of
course, it must not happen that in the ontology's remaining axioms one of
the "helper roles" 'pA' and 'pB' appears, but this can always be avoided in
practice AFAICS. So the only thing which might be considered to be at least
a /theoretical/ problem is that it will not be possible anymore to interpret
such an OWL ontology over the /empty/ universe. But in practice, no one will
really care about this lacking, and I am not even certain if doing so is
allowed at all in OWL. 

Third: What are the ramifications for using role 'pAXB'? Being a non-simple
role according to [1], pAXB suffers from not being allowed to appear in
certain kinds of axioms. This is generally a problem, because it means that
I cannot freely "play around" with pAXB, I always have to check first. On
the other hand, from a pragmatical point of view, I do not see immediate
applications for specifying cardinality restrictions on this cross product
role. Also, making a cross product into a functional or inverse functional
role will perhaps not happen too often, because it would have strong
implicit consequenses on the pair of original classes A and B. Same for
irreflexivity and asymmetry axioms. So the axiom set above might really be
of value for a large set of application scenarios.

You can find below an example ontology "crossproduct.owl" together with some
Jena/Pellet demo code. The ontology contains the axioms above, together with
the following assertions:

  * A(a1)
  * A(a2)
  * B(b1)
  * B(b2)

Also, I have made A a subclass of another class AA, and B a subclass of
another class BB, and included the following additional assertions:

  * AA(aNOT)
  * BB(bNOT)

The demo code checks if all possible combinations of instances of A and B
exist with property pAXB, while no tuple containing aNOT or bNOT as one of
its components must exist with property pAXB. The result of running the demo

  *** allowed tuples MUST occur in pAXB ***
  Exists tuple (a1,b1)? true
  Exists tuple (a1,b2)? true
  Exists tuple (a2,b1)? true
  Exists tuple (a2,b2)? true
  *** un-allowed tuples must NOT occur in pAXB ***
  Exists tuple (aNOT,b1)? false
  Exists tuple (aNOT,b2)? false
  Exists tuple (a1,bNOT)? false
  Exists tuple (a2,bNOT)? false
  Exists tuple (aNOT,bNOT)? false


[1] http://www.webont.org/owl/1.1/owl_specification.html#7

===== ontology "crossproduct.owl" =====

<?xml version="1.0"?>
  <owl:Ontology rdf:about="">
    <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >Created with TopBraid Composer</owl:versionInfo>
  <owl:Class rdf:ID="A">
          <owl:Thing rdf:ID="w"/>
          <owl:ObjectProperty rdf:ID="pA"/>
      <owl:Class rdf:ID="AA"/>
  <owl:Class rdf:about="#AA">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  <owl:Class rdf:ID="B">
        <owl:hasValue rdf:resource="#w"/>
          <owl:ObjectProperty rdf:ID="pB"/>
      <owl:Class rdf:ID="BB"/>
  <owl:Class rdf:about="#BB">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  <owl:ObjectProperty rdf:ID="pAXB">
    <rdfs:range rdf:resource="#B"/>
    <rdfs:domain rdf:resource="#A"/>
  <owl:ObjectProperty rdf:ID="inv_pB">
    <owl:inverseOf rdf:resource="#pB"/>
  <BB rdf:ID="bNOT"/>
  <A rdf:ID="a2"/>
  <A rdf:ID="a1"/>
  <B rdf:ID="b1"/>
  <AA rdf:ID="aNOT"/>
    <rdfs:subPropertyOf rdf:resource="#pAXB"/>
    <rdf:rest rdf:parseType="Collection">
      <owl:ObjectProperty rdf:about="#inv_pB"/>
    <rdf:first rdf:resource="#pA"/>
  <B rdf:ID="b2"/>

<!-- Created with TopBraid Composer -->

===== Demo code in Java, using Jena and Pellet (>=1.5) ===============

import org.mindswap.pellet.jena.PelletReasonerFactory;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.vocabulary.OWL;
import com.hp.hpl.jena.vocabulary.RDF;

import java.io.FileInputStream;

 * Demo code for the "crossproduct" ontology: checks if pAXB = A X B.
 * @author Michael Schneider (m_schnei@gmx.de)
public class Owl11CrossProductDemo {
    public static void main(String[] args) {
        String ONT_FILENAME = "crossproduct.owl"; // put in project-toplevel
        String BASE_URI = "http://example.org/crossproduct.owl";
        try {
            OntModel ontModel =
            ontModel.read(new FileInputStream(ONT_FILENAME), BASE_URI);
            // check that all allowed tuples ARE in pAXB
                String[][] allowedTuples = {
                        {"a1", "b1"},
                        {"a1", "b2"},
                        {"a2", "b1"},
                        {"a2", "b2"},
                System.out.println("*** allowed tuples MUST occur in pAXB
                for (String[] tuple : allowedTuples) {
                    System.out.println("Exists tuple
("+tuple[0]+","+tuple[1]+")? " +
            // check that unallowed triples are NOT in pAXB
                String[][] unAllowedTuples = {
                        {"aNOT", "b1"},
                        {"aNOT", "b2"},
                        {"a1", "bNOT"},
                        {"a2", "bNOT"},
                        {"aNOT", "bNOT"},
                System.out.println("*** un-allowed tuples must NOT occur in
pAXB ***");
                for (String[] tuple : unAllowedTuples) {
                    System.out.println("Exists tuple
("+tuple[0]+","+tuple[1]+")? " +
        } catch (Throwable e) {


Dipl.-Inform. Michael Schneider
FZI Forschungszentrum Informatik Karlsruhe
Abtl. Information Process Engineering (IPE)
Tel  : +49-721-9654-726
Fax  : +49-721-9654-727
Email: Michael.Schneider@fzi.de
Web  : http://www.fzi.de/ipe/eng/mitarbeiter.php?id=555

FZI Forschungszentrum Informatik an der Universität Karlsruhe
Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe
Tel.: +49-721-9654-0, Fax: +49-721-9654-959
Stiftung des bürgerlichen Rechts
Az: 14-0563.1 Regierungspräsidium Karlsruhe
Vorstand: Rüdiger Dillmann, Michael Flor, Jivka Ovtcharova, Rudi Studer
Vorsitzender des Kuratoriums: Ministerialdirigent Günther Leßnerkraus
Received on Friday, 12 October 2007 11:14:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:16 UTC