Hi Guil,

I guess even creating rdf:Lists that are needed for OWL intersections are 
difficult to represent in SPARQL CONSTRUCT alone. Sounds more like a job for 
SPARQLMotion or some custom modules in Java. I don't see a simple solution here.

Holger


On Mar 4, 2011, at 12:59 PM, Guilherme Scomparim wrote:

> Hi Scott,
> 
>  Sorry to confuse things. To make easier, forget about the
> aggregation issue for now.
> 
>  Based on the triples that I sent before, I am already able to create
> the construct below and it creates all the restrictions correctly.
> 
> CONSTRUCT {
>    ?thing a owl:Class .
>    ?thing rdfs:subClassOf owl:Thing .
>    ?thing owl:equivalentClass _:b0 .
>    _:b0 owl:onProperty ?OP .
>    _:b0 owl:minCardinality ?Number .
> }
> WHERE {
>    ?thing a pmda:State .
>    ?thing pmda:hasRestriction ?Restr .
>    ?Restr pmda:restrictionOpenBracket ?OB .
>    ?Restr pmda:restrictionCloseBracket ?CB .
>    ?Restr pmda:restrictionNumber ?Number .
>    ?Restr pmda:restrictionOnProperty ?OP .
>    ?Restr pmda:restrictionSequence ?Seq .
>    ?Restr pmda:restrictionType ?Typ .
> }
> 
> My problem is that this construct cannot create the intersections and
> unions required for some of these restrictions.
> 
>  In order to do that I need to understand how to use “For each” in
> SPARQL to manipulate more than one record in the same construct like
> pmda:restrictionOpenBracket[1] and pmda:restrictionCloseBracket[2]
> 
> Any help in understanding better how to use For Each in SPARQL is
> what I really need now.
> 
>  Thanks again,
> Guil
> 
> 
> On Mar 4, 12:59 pm, Scott Henninger <[email protected]>
> wrote:
>> 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- Hide quoted text -
>> 
>> - Show quoted text -
> 
> -- 
> 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