Thx Richard
We will experiment!
Greetings Michel





Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist


T +31888663107
M +31630381220
E [email protected]<mailto:[email protected]>

Location<https://www.google.com/maps/place/TNO+-+Locatie+Delft+-+Stieltjesweg/@52.000788,4.3745183,17z/data=!3m1!4b1!4m5!3m4!1s0x47c5b58c52869997:0x56681566be3b8c88!8m2!3d52.000788!4d4.376707>



[cid:[email protected]]<http://www.tno.nl/>

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.









Van: [email protected] <[email protected]> Namens 
Richard Cyganiak
Verzonden: Tuesday, November 19, 2019 10:11 AM
Aan: topbraid-users list <[email protected]>
CC: Bektas, K.E. (Esra) <[email protected]>
Onderwerp: Re: [topbraid-users] contsruct query question for sheets




On 19 Nov 2019, at 08:12, 'Bohms, H.M. (Michel)' via TopBraid Suite Users 
<[email protected]<mailto:[email protected]>> wrote:

?dataCell ss:row ?x
?dataCell ss :column ?y.
?dataCell ss:cellContents ?dataValue
?propertyCell ss:row 1.
?propertyCell ss :column ?y.
?propertyCell ss:cellContents ?propertyValue
?unitCell ss:row 1.
?unitCell ss :column ?y.
?unitCell ss:cellContents ?unitValue
?datatypeCell ss:row 1.
?datatypeCell ss :column ?y.
?datatypeCell ss:cellContents ?datatypeValue

FILTER (?x > 3)

This looks good, except you need 1/2/3 for the three ss:row patterns instead of 
the 1/1/1 you have there.

Despite your hints I struggle with the actual construct part (instantiation of 
the row-instances).

Try doing a simple SELECT first, with this graph pattern instead of the ... 
part:

    SELECT ?x ?propertyValue ?dataValue ?unitValue ?datatypeValue
    WHERE {
        ...
    }

Each result row should now have all the ingredients that you need to construct 
one triple.

The next step is to turn it into a CONSTRUCT:

    CONSTRUCT {
        ?s ?p ?o
    }
    WHERE {
        ...
        BIND (subjectExpr AS ?s)
        BIND (predicateExpr AS ?p)
        BIND (objectExpr AS ?o)
    }

But the three xxxExpr parts still need to be replaced with real expressions 
that create the appropriate RDF nodes. Something like:

    subjectExpr: IRI(CONCAT(STR(<http://example.com/item/>, STR(?x)))
    predicateExpr: IRI(CONCAT(STR(<http://example.com/property/>, 
STR(?propertyValue)))
    objectExpr: STRDT(?dataValue, xsd:string)

These should work as a starting point, but the real expressions are probably 
going to be more complicated than that. The objectExpr will need to do 
something appropriate with ?unitValue and ?datatypeValue.

If the expressions become too complicated, it might be best to turn the 
expressions into SPIN functions. That way, the complexity is contained in one 
place, and the SPIN function can be re-used in other queries.

If extra triples are needed in the output, like an rdf:type triple for each 
subject, then it's probably easiest to make a separate query that produces only 
those extra triples.

Hope that helps,
Richard

--
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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/9E0CA9F7-2D4D-4604-9164-4FD010B8866B%40topquadrant.com<https://groups.google.com/d/msgid/topbraid-users/9E0CA9F7-2D4D-4604-9164-4FD010B8866B%40topquadrant.com?utm_medium=email&utm_source=footer>.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/5a28c6a84c2e4672a35b4cb0c8f4955f%40tno.nl.

Reply via email to