John; The essential difference here is that unlike SPIN, which will
execute against a class and all of its "subclasses" (i.e. {?subc
rdfs:subClassOf* :Class}), SPARQL will not do any RDFS or OWL
entailments. Part of the SPARQL 1.1 working committee is looking into
including entailment regimes in standard SPARQL, but until then you
have a couple of choices. One is to run OWL inferences before
execution your query. The other is to use SPARQL 1.1 property paths
to do the subclass entailments you want.
For the latter, I assume you have asserted the triple
{publishedBooks:Electrical rdfs:subClassOf publishedBooks:Book}. If
that is the case then the following should get you what you need:
CONSTRUCT
{ ?book ?p ?o .
}
WHERE
{ ?subc rdfs:subClassOf* publishedBooks:Book .
?book a ?subc .
?book ?p ?o .
}
Note the rdfs:subClassOf* property path gets publishedBooks:Book and
all subclasses. The {?book a ?subc} triple pattern then look for all
instances of those classes. The result is the same as running an OWL/
RDFS inference engine first, except that the "inference" (really just
following the property paths) is focused solely on subclasses of a
specific class.
HTH
-- Scott
On Sep 21, 1:48 pm, John Perdoni <[email protected]> wrote:
> Scott
>
> Dont worry about it too much , I have put a spin:rule on the Book class,
> which works fine, but if you do get a chance to give me some feedback where
> my knowledge is lacking then please do
>
> John
>
>
>
>
>
>
>
> On Thursday, 20 September 2012 22:02:53 UTC+1, John Perdoni wrote:
>
> > Hi again,
>
> > I thought I had a reasonable grasp on inferencing, but back to newbie
> > status lol.
>
> > I had a classhttp://example.com/library/publishedBooks#Bookwith 2
> > instances which i ran the following script on
>
> > CONSTRUCT {
> > ?book a publishedBooks:Book .
> > ?book ?p ?o .
> > }
> > WHERE {
> > ?book a publishedBooks:Book .
> > ?book ?p ?o .
> > }
>
> > All good up until now
>
> > Thinking about the future I decided to add a subclass/es to try and
> > classify the type of book ie
> >http://example.com/library/publishedBooks#Electrical which is a
> > rdfs:subClassOf example.com:Book and moved the instances to this subClass
>
> > This is where my so called knowledge (or lack of it) gets blown out of the
> > window as running the same rule now provides no results.
>
> > I was under the impression that when running owl-max inferencing with
> > TopSpin(Sparql rules) on the above two instances would infer the following
>
> > ie CONSTRUCT {?instance rdf:type ?book}
> > WHERE{?sub rdfs:subclassOf ?book.
> > ?instance rdf:type ?sub}
>
> > and would result in
>
> > ?instance a ?Book
>
> > I can only achieve this result if I i tick the compleMode check box under
> > inferencing configuration, but this is not something I thought I should do.
>
> > Stangely this has never been an issue in the past and is not an issue if i
> > run owl-max inferencing with the same data on a Sesame repository
>
> > Sorry if this yet again is lack of knowledge
>
> > John
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages 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