On 29/12/10 13:15, Benson Margulies wrote:
because it's used in a UNION:
Let me see if I've got this:
?entity hasAnInstrument "Trumpet"
{ BIND(?entity AS ?s)}
My mistake - this will do nothing as ?entity isn't bound (SPARQL
evaluation is bottom-up, functional evaluation, not as-you-read-it
top-to-bottom of the query.
More deviousness needed to cover the 3 cases of no steps of owl:sameAs,
forward owl;sameAs and backward owl:sameAs ....
CONSTRUCT{ ?s ?p ?o }
WHERE
{
GRAPH x-arq:UnionGraph {
{ ?s rex:hasNormalizedText "Kerr" }
UNION
{ ?entity rex:hasNormalizedText "Kerr" . ?s owl:sameAs ?entity }
UNION
{ ?entity rex:hasNormalizedText "Kerr" . ?entity owl:sameAs ?s }
?s ?p ?o .
}
}
but the property path way is still better, because it treats owl:sameAs
as symmetric and transitive:
GRAPH x-arq:UnionGraph {
?entity rex:hasNormalizedText "Kerr" .
?entity (owl:sameAs|^owl:sameAs)* ?s
?s ?p ?o
}
Andy