SELECT COUNT(?known_dim)
WHERE {
?known_dim a ?dtype .
}
where ?dtype is an argument to the function, and I call this in a SPARQL window, it works fine (answer for the test enumeration was 8). If I call like this:
SELECT ?cnt
WHERE {
BIND (fonm:DimensionType AS ?dtype) .
BIND (behaviorspin:countEnumItems(?dtype) AS ?cnt) .
}
I get some bizarrely huge number., like 20000. There are no hidden subclasses on this type so the answer really is 8, so the variable ?dtype is not getting bound. Why is that?
SELECT COUNT(?result)
WHERE {
BIND (emech:SandTable_DW01Axle_M01Axle_FixedConnection-Restrain AS ?arg1) .
BIND (fonm:AlongLength AS ?dim) .
?arg1 behaviorswa:allRestrainRestrainedDimensions ?restDims .
BIND (behaviorspin:dimMemberOf(?dim, ?restDims) AS ?result) .
FILTER (?result = false) .}
The resulting value is 3. Here is the function call that doesn't work:
SELECT ?cnt
WHERE {
BIND (emech:SandTable_DW01Axle_M01Axle_FixedConnection-Restrain AS ?arg1) .
BIND (fonm:AlongLength AS ?dim) .
?arg1 behaviorswa:allRestrainRestrainedDimensions ?restDims .
BIND (behaviorspin:countMatchingDimInRestDims(?dim, ?restDims) AS ?cnt) .
}
In this case I get 3 results (each with the value 1). The content of the SPIN function is just the 2 lines in the first example, and a COUNT(?result).
I do not understand either of these situations, and suspect that the root is a basic misunderstanding of how SPIN is working. Any clarification would be appreciated.
Jack
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
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 topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
SELECT *
WHERE {
BIND (fonm:DimensionType AS ?arg1) .
?cls rdfs:subClassOf* ?arg1 .
BIND (behaviorspin:countEnumItems(?cls) AS ?cnt) .
FILTER (?cls = fonm:DimensionType) .
}
Thanks again. Now back to my list differences problem...
Jack
Long and short of this question is that doing something that would have cost me about 5 minutes in Java or some other language is taking a long time in SPARQL.
Here is some sample code that works fine:
SELECT COUNT(?result)WHERE {BIND (emech:SandTable_DW01Axle_M01Axle_FixedConnection-Restrain AS ?arg1) .BIND (fonm:AlongLength AS ?dim) .?arg1 behaviorswa:allRestrainRestrainedDimensions ?restDims .BIND (behaviorspin:dimMemberOf(?dim, ?restDims) AS ?result) .FILTER (?result = false) .}
The resulting value is 3. Here is the function call that doesn't work:
SELECT ?cntWHERE {BIND (emech:SandTable_DW01Axle_M01Axle_FixedConnection-Restrain AS ?arg1) .BIND (fonm:AlongLength AS ?dim) .?arg1 behaviorswa:allRestrainRestrainedDimensions ?restDims .BIND (behaviorspin:countMatchingDimInRestDims(?dim, ?restDims) AS ?cnt) .
}