Scott, Hereby an adapted example made as simple as possible (subset of 
earlier). 

In case attachemnts does not work (maybe it does not only when in web 
interface...):

Ontology:

<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    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="http://www.tno.nl/mapping3#";
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
    xmlns:spl="http://spinrdf.org/spl#";
  xml:base="http://www.tno.nl/mapping3";>
  <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:about="#IfcProfileDef">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  </owl:Class>
  <owl:Class rdf:ID="IfcDirection">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  </owl:Class>
  <owl:Class rdf:ID="IfcExtrudedAreaSolid">
    <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";
                >IfcRectangleProfileDef</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="SweptArea"/>
            </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";
                >XDim</sp:varName>
              </rdf:Description>
            </sp:object>
            <sp:predicate>
              <owl:DatatypeProperty rdf:ID="XDim"/>
            </sp:predicate>
            <sp:subject rdf:nodeID="A0"/>
          </rdf:Description>
          <rdf:Description>
            <sp:object>
              <rdf:Description rdf:nodeID="A2">
                <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:nodeID="A0"/>
          </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 rdf:resource="#lenght"/>
            <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>
          <sp:Let>
            <sp:expression rdf:nodeID="A3"/>
            <sp:variable rdf:nodeID="A1"/>
          </sp:Let>
          <sp:Let>
            <sp:expression rdf:nodeID="A4"/>
            <sp:variable rdf:nodeID="A2"/>
          </sp:Let>
        </sp:where>
      </sp:Construct>
    </spin:rule>
    <rdfs:subClassOf>
      <owl:Class rdf:ID="IfcSweptAreaSolid"/>
    </rdfs:subClassOf>
    <owl:equivalentClass>
      <owl:Class rdf:ID="Wall"/>
    </owl:equivalentClass>
  </owl:Class>
  <owl:Class rdf:about="#IfcSweptAreaSolid">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty>
          <owl:DatatypeProperty rdf:about="#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:ID="IfcRectangleProfileDef">
    <rdfs:subClassOf rdf:resource="#IfcParameterizedProfileDef"/>
  </owl:Class>
  <owl:Class rdf:about="#Wall">
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
  </owl:Class>
  <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="#width">
    <rdfs:domain rdf:resource="#Wall"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:ID="length">
    <rdfs:domain rdf:resource="#Wall"/>
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#XDim">
    <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="#SweptArea">
    <rdfs:domain rdf:resource="#IfcSweptAreaSolid"/>
    <rdfs:range rdf:resource="#IfcProfileDef"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="#YDim">
    <rdfs:range rdf:resource="#IfcPositiveLengthMeasure"/>
  </owl:DatatypeProperty>
  <Wall rdf:ID="Muur_3">
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >11</width>
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >22</length>
  </Wall>
  <Wall rdf:ID="Muur_1">
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >20</length>
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >30</width>
  </Wall>
  <Wall rdf:ID="Muur_2">
    <length rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >2</length>
    <width rdf:datatype="http://www.w3.org/2001/XMLSchema#float";
    >3</width>
  </Wall>
</rdf:RDF>

<!-- Created with TopBraid Composer -->


Inference config:

# Saved by TopBraid on Sun Mar 01 19:32:21 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       <http://spinrdf.org/spin#TopSPIN> ;
                composite:index "1"^^xsd:int
              ] ;
      composite:child
              [ a       inference:SwiftOWLIMEngine ;
                composite:index "0"^^xsd:int
              ] .


 
 
 

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Scott Henninger
Sent: 01 March 2009 16:56
To: TopBraid Composer Users
Subject: [tbc-users] Re: Trying to CONSTRUCT a graph involving more than 1 
triple template (TBC version 3.0.0.62)


Michel;  Yes you can do owl:same as inferences with SPIN.  The following is a 
spin:rule that will infer all of the properties that make instances equivalent:
CONSTRUCT
{  ?this ?aprop ?value .
    ?arsc ?aprop2 ?value2 .
}
WHERE
{   ?this owl:sameAs ?arsc .
    ?arsc ?aprop ?value .
    ?this ?aprop2 ?value2 .
}

If you don't want, for example, type triples to be inferred, you can filter 
these with  FILTER ((?aprop2 != rdf:type) && (?aprop != rdf:type)).  In this 
way it is more flexible than OWL semantics.

Also, in your script, you have the following in your
IfcExtrudedAreaSoliddefinition:

CONSTRUCT {
    ?this :Depth ?Depth .
    ?this :SweptArea ?IfcRectangleProfileDef .
    ?IfcRectangleProfileDef :XDim ?XDim .
    ?IfcRectangleProfileDef :YDim ?YDim .
}
WHERE {
    ?this :height ?height .
    ?this :lenght ?length .
    ?this :width ?width .
    LET (?Depth := ?height) .
    LET (?XDim := ?length) .
    LET (?YDim := ?width) .
}

This fail to construct any triples because ?IfcRectangleProfileDef  is not 
bound to avalue.

-- Scott

On Mar 1, 5:09 am, "Bohms, H.M. (Michel)" <[email protected]> wrote:
> Hi Scot,
>
> - unfort. TopSpin first doesn't solve the problem.
> - I have OWLIM in to do the inference of the equivalent instances... 
> (assuming TopSpin does not do this...maybe wrong...)
>
> Cheers, Michel
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Scott 
> Henninger
> Sent: 26 February 2009 16:10
> To: TopBraid Composer Users
> Subject: [tbc-users] Re: Trying to CONSTRUCT a graph involving more 
> than 1 triple template (TBC version 3.0.0.62)
>
> Michel; Thanks for sending both the ontology and .tbc file!  I took a look at 
> the SPIN rules and don't see a obvious issues.  I'm unclear on what what role 
> the OWLIM inference plays in your inferences, but it seems to me that 
> reversing the order of inference engines may work.
> I.e. running TopSPIN first, then OWLIM.
>
> -- Scott
>
> On Feb 26, 6:45 am, Michel Bohms <[email protected]> wrote:
> > 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"
>
> ...
>
> read more »

This e-mail and its contents are subject to the DISCLAIMER at 
http://www.tno.nl/disclaimer/email.html

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: mapping3.owl
Description: mapping3.owl

Attachment: mapping3.owl.tbc
Description: mapping3.owl.tbc

Reply via email to