Dear all,

I try to use SPIN/Sparql for mapping from one ontology to another,
actually from a semantic ontology featuring a Wall with a length,
width and height to two alternative, derived representations: one in
the form of a BoundingBox, one in the form of a ExtrudedAreaSolid.

The first one is quite simple and is easily inferred with combo of
Swift/TopSpin (the spin:rule is also trivial)
The second is giving me problems since the CONTRUCT graph is more
complex here.

Currently I cannot find many examples for such situations so maybe I
am making some sparql mistake in my spin:rule.

For the moment the base mapping is started by making Wall and the two
reps. equivalent classes (so that SWIFT starts to infer/construct the
reps first; maybe I change this later in "no equivalence+adapted
rules" ie construct the rep classes first in my CONSTRUCT after adding
an objectproperty like "representation" for Wall, but this aside).
Next I try to construct via my rule the properties of the
ExtrudedAreaSolid. Since this is an objectproperty ("SweptArea") I
also want to construct properties "further in the graph".

After inferring however, the are not even instances of the SweptArea
range class (being "IfcRectangleProfileDef", let alone values for its
properties calculated via the LET clauses (XDim and YDim).

What I can think of is that the reasoners have problems with the
underlying types of the involved datatype properties, not being simple
floats, but user-defined datatypes (PostiveLengthMeasures). However,
guess this cause is unlikely.

Any help very much appreciated! (when I get this one to work I have
the feeling I get get 'anything' to work with SPIN/Sparql ...:)

Michel Bohms

ps
I hope the attachments work

mu .owl.tbc file content:
# Saved by TopBraid on Thu Feb 26 13:23:15 CET 2009
# baseURI: null

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix inference:  <http://www.topbraid.org/2007/06/inference.owl#> .
@prefix visual:  <http://topbraid.org/visual#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix forms:   <http://www.topbraid.org/2007/01/forms.owl#> .
@prefix composite:  <http://www.topbraid.org/2007/05/composite.owl#> .

[]    a       inference:Configuration ;
      composite:child
              [ a       inference:SwiftOWLIMEngine ;
                composite:index "0"^^xsd:int
              ] ;
      composite:child
              [ a       <http://spinrdf.org/spin#TopSPIN> ;
                composite:index "1"^^xsd:int
              ] .


my ontology (cannot find how to have attachments to this mail...):

<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns="http://www.tno.nl/mapping2#";
    xmlns:spin="http://spinrdf.org/spin#";
    xmlns:sp="http://spinrdf.org/sp#";
    xmlns:owl="http://www.w3.org/2002/07/owl#";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#";
    xmlns:owl11="http://www.w3.org/2006/12/owl11#";
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
    xmlns:spl="http://spinrdf.org/spl#";
  xml:base="http://www.tno.nl/mapping2";>
  <owl:Ontology rdf:about="">
    <owl:versionInfo rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
    >Created with TopBraid Composer</owl:versionInfo>
    <owl:imports rdf:resource="http://spinrdf.org/spin"/>
  </owl:Ontology>
  <owl:Class rdf:ID="IfcParameterizedProfileDef">
    <rdfs:subClassOf>
      <owl:Class rdf:ID="IfcProfileDef"/>
    </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:ID="Wall">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
  </owl:Class>
  <owl:Class rdf:ID="IfcBoundingBox">
    <owl:equivalentClass rdf:resource="#Wall"/>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
    <spin:rule>
      <sp:Construct>
        <sp:templates rdf:parseType="Collection">
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A0">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >XDim</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="XDim"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A1">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >YDim</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="YDim"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A2">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >ZDim</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="ZDim"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
        </sp:templates>
        <sp:where rdf:parseType="Collection">
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A3">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >length</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="length"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A4">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >width</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="width"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A5">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >height</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="height"/>
            </sp:predicate>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
          </rdf:Description>
          <sp:Let>
            <sp:expression rdf:nodeID="A3"/>
            <sp:variable rdf:nodeID="A0"/>
          </sp:Let>
          <sp:Let>
            <sp:expression rdf:nodeID="A4"/>
            <sp:variable rdf:nodeID="A1"/>
          </sp:Let>
          <sp:Let>
            <sp:expression rdf:nodeID="A5"/>
            <sp:variable rdf:nodeID="A2"/>
          </sp:Let>
        </sp:where>
      </sp:Construct>
    </spin:rule>
  </owl:Class>
  <owl:Class rdf:ID="IfcSweptAreaSolid">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty>
          <owl:DatatypeProperty rdf:ID="SweptArea"/>
        </owl:onProperty>
        <owl:cardinality rdf:datatype="http://www.w3.org/2001/
XMLSchema#int"
        >1</owl:cardinality>
      </owl:Restriction>
    </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:about="#IfcProfileDef">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
  </owl:Class>
  <owl:Class rdf:ID="IfcRectangleProfileDef">
    <rdfs:subClassOf rdf:resource="#IfcParameterizedProfileDef"/>
  </owl:Class>
  <owl:Class rdf:ID="IfcDirection">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty>
          <owl:DatatypeProperty rdf:ID="DirectionRatios"/>
        </owl:onProperty>
        <owl:cardinality rdf:datatype="http://www.w3.org/2001/
XMLSchema#int"
        >3</owl:cardinality>
      </owl:Restriction>
    </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:ID="IfcExtrudedAreaSolid">
    <owl:equivalentClass rdf:resource="#Wall"/>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/
owl#Thing"/>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty>
          <owl:ObjectProperty rdf:ID="ExtrudedDirection"/>
        </owl:onProperty>
        <owl:cardinality rdf:datatype="http://www.w3.org/2001/
XMLSchema#int"
        >1</owl:cardinality>
      </owl:Restriction>
    </rdfs:subClassOf>
    <rdfs:subClassOf rdf:resource="#IfcSweptAreaSolid"/>
    <spin:rule>
      <sp:Construct>
        <sp:where rdf:parseType="Collection">
          <rdf:Description>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:about="#height"/>
            </sp:predicate>
            <sp:object>
              <rdf:Description rdf:nodeID="A6">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >height</sp:varName>
              </rdf:Description>
            </sp:object>
          </rdf:Description>
          <rdf:Description>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
            <sp:predicate rdf:resource="#lenght"/>
            <sp:object>
              <rdf:Description rdf:nodeID="A7">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >length</sp:varName>
              </rdf:Description>
            </sp:object>
          </rdf:Description>
          <rdf:Description>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:about="#width"/>
            </sp:predicate>
            <sp:object>
              <rdf:Description rdf:nodeID="A8">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >width</sp:varName>
              </rdf:Description>
            </sp:object>
          </rdf:Description>
          <sp:Let>
            <sp:variable>
              <rdf:Description rdf:nodeID="A9">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >Depth</sp:varName>
              </rdf:Description>
            </sp:variable>
            <sp:expression rdf:nodeID="A6"/>
          </sp:Let>
          <sp:Let>
            <sp:variable>
              <rdf:Description rdf:nodeID="A10">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >XDim</sp:varName>
              </rdf:Description>
            </sp:variable>
            <sp:expression rdf:nodeID="A7"/>
          </sp:Let>
          <sp:Let>
            <sp:variable>
              <rdf:Description rdf:nodeID="A11">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >YDim</sp:varName>
              </rdf:Description>
            </sp:variable>
            <sp:expression rdf:nodeID="A8"/>
          </sp:Let>
        </sp:where>
        <sp:templates rdf:parseType="Collection">
          <rdf:Description>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="Depth"/>
            </sp:predicate>
            <sp:object rdf:nodeID="A9"/>
          </rdf:Description>
          <rdf:Description>
            <sp:subject rdf:resource="http://spinrdf.org/spin#_this"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:about="#SweptArea"/>
            </sp:predicate>
            <sp:object>
              <rdf:Description rdf:nodeID="A12">
                <sp:varName rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
                >IfcRectangleProfileDef</sp:varName>
              </rdf:Description>
            </sp:object>
          </rdf:Description>
          <rdf:Description>
            <sp:subject rdf:nodeID="A12"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:about="#XDim"/>
            </sp:predicate>
            <sp:object rdf:nodeID="A10"/>
          </rdf:Description>
          <rdf:Description>
            <sp:subject rdf:nodeID="A12"/>
            <sp:predicate>
              <owl:DatatypeProperty rdf:about="#YDim"/>
            </sp:predicate>
            <sp:object rdf:nodeID="A11"/>
          </rdf:Description>
        </sp:templates>
      </sp:Construct>
    </spin:rule>
  </owl:Class>
  <owl:ObjectProperty rdf:about="#ExtrudedDirection">
    <rdfs:domain rdf:resource="#IfcExtrudedAreaSolid"/>
    <rdfs:range rdf:resource="#IfcDirection"/>
  </owl:ObjectProperty>
  <owl:DatatypeProperty rdf:ID="ProfileType">
    <rdfs:domain rdf:resource="#IfcProfileDef"/>
    <rdfs:range>
      <owl:DataRange rdf:ID="ProfileTypeEnum">
        <owl11:onDataRange rdf:resource="http://www.w3.org/2001/
XMLSchema#string"/>
        <owl:oneOf rdf:parseType="Resource">
          <rdf:first rdf:datatype="http://www.w3.org/2001/
XMLSchema#string"
          >CURVE" "AREA</rdf:first>
          <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-
syntax-ns#nil"/>
        </owl:oneOf>
      </owl:DataRange>
    </rdfs:range>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#Depth">
    <rdfs:domain rdf:resource="#IfcExtrudedAreaSolid"/>
    <rdfs:range>
      <owl:DataRange rdf:ID="IfcPositiveLengthMeasure">
        <owl11:onDataRange rdf:resource="http://www.w3.org/2001/
XMLSchema#float"/>
        <owl11:minInclusive>0</owl11:minInclusive>
      </owl:DataRange>
    </rdfs:range>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#XDim">
    <rdfs:range rdf:resource="#IfcPositiveLengthMeasure"/>
    <rdfs:domain>
      <owl:Class>
        <owl:unionOf rdf:parseType="Collection">
          <owl:Class rdf:about="#IfcBoundingBox"/>
          <owl:Class rdf:about="#IfcRectangleProfileDef"/>
        </owl:unionOf>
      </owl:Class>
    </rdfs:domain>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#height">
    <rdfs:domain rdf:resource="#Wall"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/
>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#DirectionRatios">
    <rdfs:domain rdf:resource="#IfcDirection"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/
>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#YDim">
    <rdfs:domain>
      <owl:Class>
        <owl:unionOf rdf:parseType="Collection">
          <owl:Class rdf:about="#IfcBoundingBox"/>
          <owl:Class rdf:about="#IfcRectangleProfileDef"/>
        </owl:unionOf>
      </owl:Class>
    </rdfs:domain>
    <rdfs:range rdf:resource="#IfcPositiveLengthMeasure"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#ZDim">
    <rdfs:domain rdf:resource="#IfcBoundingBox"/>
    <rdfs:range rdf:resource="#IfcPositiveLengthMeasure"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#length">
    <rdfs:domain rdf:resource="#Wall"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/
>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#width">
    <rdfs:domain rdf:resource="#Wall"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/
>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#SweptArea">
    <rdfs:domain rdf:resource="#IfcSweptAreaSolid"/>
    <rdfs:range rdf:resource="#IfcProfileDef"/>
  </owl:DatatypeProperty>
  <Wall rdf:ID="Muur_1">
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >20</length>
    <height rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >10</height>
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >30</width>
  </Wall>
  <Wall rdf:ID="Muur_3">
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >22</length>
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >11</width>
    <height rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >33</height>
  </Wall>
  <Wall rdf:ID="Muur_2">
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >2</length>
    <height rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >1</height>
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >3</width>
  </Wall>
</rdf:RDF>

<!-- Created with TopBraid Composer -->





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to