Michel,

 

As you debug queries, the best approach to use is to start with a SELECT query 
that returns all the variables you need in the (eventual) CONSTRUCT. 

 

Then, you can play with the query to see what it actually returns, changing 
WHERE clause and what you are selecting as needed. Once you are happy with the 
result, you can move to a CONSTRUCT.

 

Regards,

 

Irene

 

From: [email protected] [mailto:[email protected]] 
On Behalf Of Bohms, H.M. (Michel)
Sent: Thursday, May 15, 2014 5:20 PM
To: '[email protected]'
Subject: RE: [topbraid-users] No inferences

 

Still no inferences…

What I have:

5 buildings (and a battery) all having several Complex Properties amoung which 
one that is a ProfileProperty that has a set of TimePointProperty where a Time 
Point Property has two things: a ref to a specific value , here e-Production 
and a timestamp (24 hourly values for each building).

All that data is explicitly asserted in the ontology

 

Now I want to generate a new complex property with the same structure for my 
one existing neighbourhood individual where in the end it holds a similar 
profile where for each timestampe the e-Production values are the sum of all 
e-Production values on the same timestamp of all its parts (here the buildings)

 

Note that in the current ontology I just have the Neighbourhood  individual and 
not any intermediate thing (like an empty complex property for that 
neighbourhood, I want to construct those too)

 

 

 

 

 

 

 

 

 

From: [email protected] [mailto:[email protected]] 
On Behalf Of Scott Henninger
Sent: donderdag 15 mei 2014 22:57
To: [email protected]
Subject: Re: [topbraid-users] No inferences

 

Michel;  To count a set of values, you'll need to use GROUP BY to group your 
results by the item you want to aggregate and sum the object values.  Looking 
at your data I'm guessing you want to sum all of the values from the 
depc:hasTimePointProperty where the value is found in the 
depc:TimePointProperty instances.  Given these assumptions, the sub-select will 
look something like the below:

SELECT ?part ((SUM(xsd:float(?eProduction2))) AS ?eProduction1)
WHERE {
            ?this dcterms:hasPart ?part .
            ?part depc:hasComplexProperty ?ProfileProperty2 .
            ?ProfileProperty2 depc:hasTimePointProperty ?TimePointProperty1 .
            ?TimePointProperty2 depc:e-Production ?eProduction2 .
            ?TimePointProperty2 depc:timeStamp ?timeStamp1 .
}  GROUP BY ?part

See if that give you the results you are looking for.  The general idea is to 
group by the thing you need to aggregate, then perform the count/sum/etc. on 
the object with the desired values.

-- Scott

On 5/15/2014, 3:16 PM, Bohms, H.M. (Michel) wrote:

Hi Scot,

 

Thx for the latest query. Inow understand but still see no inferences.

 

Current query:

CONSTRUCT {

    ?this depc:hasComplexProperty ?ProfileProperty1 .

    ?ProfileProperty1 a depc:ProfileProperty .

    ?ProfileProperty1 depc:hasTimePointProperty ?TimePointProperty1 .

    ?TimePointProperty1 a depc:TimePointProperty .

    ?TimePointProperty1 depc:e-Production ?eProduction1 .

    ?TimePointProperty1 depc:timeStamp ?timeStamp1 .

}

WHERE {

    {

        SELECT ((SUM(?eProduction2)) AS ?eProduction1)

        WHERE {

            ?this dcterms:hasPart ?part .

            ?part depc:hasComplexProperty ?ProfileProperty2 .

            ?ProfileProperty2 depc:hasTimePointProperty ?TimePointProperty1 .

            ?TimePointProperty2 depc:e-Production ?eProduction2 .

            ?TimePointProperty2 depc:timeStamp ?timeStamp1 .

        }

    } .

}

 

What I try to do is derived for the Neighbourhood individual a value for its 
total energy production as sum of the existing energy productions of its parts 
(for which values are given). (one value for each dateTimeStamp).

 

Any hint to my thinking error is very welcome! (maybe the path in the construct 
should be generated differently?)

Michel




Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet 
de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden, wordt u 
verzocht dat aan de afzender te melden en het bericht te verwijderen. TNO 
aanvaardt geen aansprakelijkheid voor de inhoud van deze e-mail, de wijze 
waarop u deze gebruikt en voor schade, van welke aard ook, die verband houdt 
met risico's verbonden aan het elektronisch verzenden van berichten.

 

This message may contain information that is not intended for you. If you are 
not the addressee or if this message was sent to you by mistake, you are 
requested to inform the sender and delete the message. TNO accepts no liability 
for the content of this e-mail, for the manner in which you use it and for 
damage of any kind resulting from the risks inherent to the electronic 
transmission of messages.

-- 
-- 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 Insight, 
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
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

 

-- 
-- 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 Insight, 
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
 <mailto:[email protected]> [email protected]
To unsubscribe from this group, send email to
 <mailto:[email protected]> 
[email protected]
For more options, visit this group at
 <http://groups.google.com/group/topbraid-users?hl=en> 
http://groups.google.com/group/topbraid-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
-- 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 Insight, 
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
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
-- 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 Insight, 
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
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to