> On 19 Nov 2019, at 08:12, 'Bohms, H.M. (Michel)' via TopBraid Suite Users
> <[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/
<http://example.com/item/>>, STR(?x)))
predicateExpr: IRI(CONCAT(STR(<http://example.com/property/
<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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/9E0CA9F7-2D4D-4604-9164-4FD010B8866B%40topquadrant.com.