Hi Scott,
cls-svf1 is not what I am after.

Compare

# cls-svf1
CONSTRUCT {
    ?u a ?x .
}
WHERE {
    ?x owl:someValuesFrom ?y .
    ?x owl:onProperty ?p .
    ?u ?p ?v .
    ?v a ?y .
}

To what I wrote:

> CONSTRUCT {?this rdfs:subClassOf ?restriction .
>     ?restriction rdf:type owl:Restriction .
>     ?restriction owl:onProperty :isPartOf .
>     ?restriction owl:someValuesFrom ?Var . }
>
> WHERE {
>
>     ?var rdfs:subClassOf ?restriction1 .
>     ?restriction1 rdf:type owl:Restriction .
>     ?restriction1 owl:onProperty :hasPart .
>     ?restriction1 owl:someValuesFrom ?this .
> }
What I want to do is to create a restriction on one property from a
restriction on another. In this case I started with 'haspart' being
restricted to WHEEL and end up with isPart being restricted to auto. Where
Wheel is a subclass of the latter restriction and Auto is a subclass of the
former restriction.

Maybe I can explain it better with some thought.

Thanks again, I am having fun.
LFJ
On Fri, Jul 15, 2011 at 4:23 PM, Scott Henninger <[email protected]
> wrote:

>  See comments inline:
>
> > Hi Scott,
> > Thanks for this. It did not work for me. How is your inferencing
> configured?
>
> I have TopSPIN configured for inferencing.  What didn't work?  The
> queries do use some SPARQL 1.1 features that may not be in earlier
> versions of TBC.  Upgrading to 3.5.x will work, as will replacing IF
> with smf:if and COALESCE with smf:firstBound.
>
> >
> > Also, your rule seems to be constructing a restriction. How does the
> inferencing work such that an individual is classified as a teenager? Does
> the reasoner construct the restriction and then determine that Since the
> individual is a person, and a member of the restriction class, and teenager
> is the intersection of Person and The Restriction, the individul is
> therefore a teenager?
>
> A restriction creates an unnamed node (bnode) that represents a
> class.  In the case of an equivalentClass restriction on a class, the
> restriction is an equivalentClass meaning that all members of the
> restriction are also members of the class.  E.g. suppose we have:
>  :Teenager a owl:Class .
>  <restr> owl:equivalentClass :Teenager
>
> The restriction, such as "Person and (hasAge only xsd:integer[>= 13 ,
> <= 19])" is applied to the class defined by the restriction.  Since it
> is an equivalent class with :Teenager, then all members of the
> restriction are members of :Teenager, and vice-versa.
>
> >
> > I am trying to get a handle on how SPIN works to perform inferences based
> on OWL semantics. Maybe a more general rule would be better.
>
> On its own, it doesn't.  SPIN is a different way to accomplish
> inferences.  It is based on SPARQL, and as such has no inherent
> interactions with OWL (it is rdf-based).  However, one of the OWL 2
> profiles, OWL 2 RL, is defined such that a triple-based rule engine
> can implement it directly.  SPARQL, using CONSTRUCT, is one such
> engine.  When you choose OWL2 RL in the Ontology Home Profile, a set
> of rules implementing OWL 2RL profile are applied when you run
> inferences.
>
> In effect, this imports TopBraid/SPIN/owlrl-all.rdf.  For a listing of
> these rules, see http://topbraid.org/spin/owlrl-all.html.  Compare
> these to the standard,
> http://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules
> ,
> and you'll see this is a direct implementation the profile.
>
> So, as a simpler example, see the cas-sco rule:
>
> CONSTRUCT { ?x a ?c2 .}
> WHERE {
>    ?c1 rdfs:subClassOf ?c2 .
>    ?x a ?c1 .
> }
>
> This is the classic subclassOf inference.  If ?x is a member of ?c1
> and ?c1 is a subClassOf ?c2, then ?x is a member of ?c2.
>
> >
> > So instead of classifying an individual, I tried to do some class level
> reasoning. For example, If I have a class such as Automobile and it is
> defined as a subclass of the restriction on 'Haspart' to some value wheel,
> how would a rule that resulted in "wheel isPartOF some Automobile.
> >
> > So I want to go from
> >
> >  Auto :subClassOf {hasPart some Wheel}
> >
> > To
> >
> > Wheel :subClassOf {isPartOf some Automobile}
>
> someValuesOf restrictions on someValesOf are already included in OWL 2
> RL, so you don't need to re-implement them.  See cls-svf1 and cls-
> svf2.
>
> -- Scott
>
> >
> > My attempt was the following, but I could not get it to work when
> attached to thing, or even the class that I created to test it. Does one use
> '?this' to refer to a class?  Maybe if I understand this easy one, It will
> help with the more difficult rules.
> >
> > CONSTRUCT {?this rdfs:subClassOf ?restriction .
> >     ?restriction rdf:type owl:Restriction .
> >     ?restriction owl:onProperty :isPartOf .
> >     ?restriction owl:someValuesFrom ?Var . }
> >
> > WHERE {
> >
> >     ?var rdfs:subClassOf ?restriction1 .
> >     ?restriction1 rdf:type owl:Restriction .
> >     ?restriction1 owl:onProperty :hasPart .
> >     ?restriction1 owl:someValuesFrom ?this .
> > }
> >
> >
> >
> >
> > On Thu, Jul 14, 2011 at 2:03 PM, Scott Henninger <
> [email protected]> wrote:
> >
> >     Leonard; Attached is an example SPIN rule that is generalized to
> address all datarange restrictions - one or two data range values and all
> four datarange restrictions.  There are some test cases included so you can
> run inferences and experiment with this.  This is just a draft, so see how
> it works for you.
> >
> >     The main part of the example is the rule on the :Person class:
> >
> >     CONSTRUCT {
> >         ?this a ?restriction .
> >     }
> >     WHERE {
> >         ?datatype owl:onDatatype xsd:integer .
> >         ?datatype owl:withRestrictions ?restrList .
> >         ?datatype a rdfs:Datatype .
> >         ?restriction ?restrType ?datatype .
> >
> >         ?restriction a owl:Restriction .
> >         ?restriction owl:onProperty ?datatypeproperty .
> >         ?this ?datatypeproperty ?val .
> >         ?restrList rdf:rest ?restrListRest .
> >         BIND (IF((?restrListRest = rdf:nil), :singleDataRange(?val,
> ?restrList), :doubleDataRange(?val, ?restrList)) AS ?boolResult) .
> >         FILTER (?boolResult) .
> >     }
> >
> >     The {?restrList rdf:rest ?restrListRest .} gets the restriction list.
>  If ?restrListRest = rdf:nil, then there is only one data range to consider.
>  Otherwise there are two.  The BIND statement uses this fact to call
> functions that compute whether the range restriction is met. You can find
> the definitions for these functions by doing a ctl-click in the spin:rule
> for :Person.
> >
> >     The datarange definitions for three classes are included to test this
> out.  The instances of :Person will be classified by rules (the two values
> for :Scott are both lies ;-) but it classifies correctly)
> >
> >     :Child owl:equivalentClass "Person and (hasAge only xsd:integer[<=
> 12])"
> >     :Teenager owl:equivalentClass "Person and (hasAge only xsd:integer[>=
> 13 , <= 19])"
> >     :Adult owl:equivalentClass "Person and (hasAge only xsd:integer[>
> 19])"
> >
> >     -- Scott
> >
> >
> >     On 7/13/11 9:09 AM, Leonard Jacuzzo wrote:
> >>     Hello Topquadrant folks.
> >>
> >>     I have been pulling my hair out in an attempt to construct a SPIN
> rule that is general enough to classify an instance for any datarange
> restriction using maxInclusive and MinInclusive.
> >>
> >>     Going back to the running example. I have defined teenager as being
> equivalent to the intersection of (Person, and hasAge only mininclusive 13,
> and hasAge only maxinclusive 19).
> >>
> >>     I would like to have a person classified as being a teenager...But I
> would like to have a general rule to do any classification of this nature
> and attach it to Thing. Below is what I have come up with so far.
> >>     TBC rejects it based on syntax. Can anyone spot the problem(s)? I
> feel like I am chasing my tail.
> >>
> >>     Here is what I have so far.
> >>
> >>
> >>
> >>     CONSTRUCT {?this a ?P}
> >>
> >>     WHERE {?this a ?B.
> >>
> >>      ?P rdfs:subclassOf ?B.
> >>
> >>      ?P owl:equivalentClass ?A.
> >>      ?A owl:intersectionOf ?B, ?restriction, ?restriction2
> >>      ?datatype owl:onDatatype xsd:float .
> >>      ?datatype owl:withRestrictions ?var .
> >>      ?datatype a rdfs:Datatype .
> >>      ?restriction owl:allValuesFrom ?datatype .
> >>      ?restriction a owl:Restriction .
> >>      ?restriction owl:onProperty ?datatypeproperty .
> >>      ?var rdf:first ?var1 .
> >>      ?var1 xsd:minInclusive ?mval .
> >>      ?x2 ?datatypeproperty ?val .
> >>      ?datatype2 owl:onDatatype xsd:float .
> >>      ?datatype2 owl:withRestrictions ?var .
> >>      ?datatype2 a rdfs:Datatype .
> >>      ?restriction2 owl:allValuesFrom ?datatype .
> >>      ?restriction2 a owl:Restriction .
> >>      ?restriction2 owl:onProperty ?datatypeproperty .
> >>      ?var2 rdf:rest ?var3 .
> >>      ?var3 xsd:maxInclusive ?maval .
> >>      ?x2 ?datatypeproperty ?val2 .
> >>     FILTER (?val >= ?mval) .
> >>     FILTER (?val2 <= ?maval). }
> >>     --
> >>     You received this message because you are subscribed to the Google
> >>     Group "TopBraid Suite Users", the topics of which include TopBraid
> Composer,
> >>     TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> >>     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-users?hl=en
> >     --
> >     You received this message because you are subscribed to the Google
> >     Group "TopBraid Suite Users", the topics of which include TopBraid
> Composer,
> >     TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> >     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-users?hl=en
> >
> >
> > --
>  > You received this message because you are subscribed to the Google
> > Group "TopBraid Suite Users", the topics of which include TopBraid
> Composer,
> > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> > 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-users?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid
> Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> 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-users?hl=en
>

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
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-users?hl=en

Reply via email to