Hello Guil; I'm having a bit of trouble with the question. The initial paragraph talks about aggregates, but the rest seems to be a non-standard representation of OWL restrictions.
In terms of "for each", the key is to understand how SPARQL works. Given a graph pattern in the WHERE clause, a SPARQL engine will produce a result for each match of the graph pattern. In particular, this means the "for each" is built into the SPARQL standard to start with. With that understanding, you may end up reformulating your approach, so be sure to post any follow-on questions you may have. BTW, the OWL standard specifies a way of representing OWL restrictions. So that's also already available - see Help > How to? > Create a local restriction, and look at the source code sub-tab. Choose the Turtle text serialization and you will see how OWL restrictions are represented in RDF. -- Scott On Mar 3, 6:07 pm, Guilherme Scomparim <[email protected]> wrote: > Hi all, > > I was wondering if there is a way to manipulate “recordsets” when > building a spin:construct > > I am not sure if I am doing this in the proper way. Since I have not > found “For each” functionality in SPIN, I am trying to create > different queries using different filters that require count() and > group by to create different constructs based on the data in the > “recordsets” and this is not possible following the message “Aggregate > expression not legal at this point” > > To help understand my problem, I have a class called State that > relates to another class called StateRestriction via a particular > property. This relationship defines the restriction criterion for each > State as defined below. > > pmda:State a owl:Class . > pmda:StateRestriction a owl:Class . > pmda:hasRestriction rdfs:domain pmda:State . > pmda:hasRestriction rdfs:range pmda:StateRestriction . > pmda:restrictionSequence rdfs:domain pmda:StateRestriction . > pmda:restrictionOpenBracket rdfs:domain pmda:StateRestriction . > pmda:restrictionOnProperty rdfs:domain pmda:StateRestriction . > pmda:restrictionType rdfs:domain pmda:StateRestriction . > pmda:restrictionValue rdfs:domain pmda:StateRestriction . > pmda:restrictionCloseBracket rdfs:domain pmda:StateRestriction . > pmda:restrictionConjunctionDisjuntion rdfs:domain > pmda:StateRestriction . > > I already create a construct that creates a restriction class for each > instance of the pmda:State. > > Now I need to create the Intersections and Unions of the restrictions > that are defined as many instances of the pmda:StateRestriction for > each pmda:State. > > This requires me to deal with a list of State Restrictions that are > related to a unique State and I am really not sure how to do that. > > Thanks in Advance, > Guil -- 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
