Error upon using a count in magic properties

24 views
Skip to first unread message

Tanya

unread,
Jan 13, 2014, 10:26:50 AM1/13/14
to topbrai...@googlegroups.com
Hello,

I am currently trying to use a count in a magic properties, however I am getting errors. I was wondering if someone would be able to assist me.

Thank you kindly,
Tanya


Errors:
- SELECT with expressions not supported in magic properties
- Function definition does not contain a valid body

Magic Properties Function:
SELECT COUNT(DISTINCT ?e) COUNT(DISTINCT ?e2)
WHERE {
    ( ?d1 ) :getFnc ( ?e ) .
    ( ?d2 ) :getFnc ( ?e2 ) .}

Contraints: ?d1, ?d2


Error message: Failed to execute operation
Exception Stack Trace:
java.lang.reflect.InvocationTargetException
    at org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:286)
    at org.topbraidcomposer.core.change.TBCChangeEngine.access$0(TBCChangeEngine.java:1)
    at org.topbraidcomposer.core.change.TBCChangeEngine$2.run(TBCChangeEngine.java:163)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
    at org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:272)
    ... 3 more
Caused by: java.lang.IllegalStateException: we failed to create the object: java.lang.NullPointerException: Failed to identify source graph (statement found but not identified)
    at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:53)
    at org.topbraid.core.change.ChangeOperation.execute(ChangeOperation.java:105)
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
    ... 4 more
Caused by: java.lang.NullPointerException: Failed to identify source graph (statement found but not identified)
    at org.topbraidcomposer.change.lib.AbstractReplaceObjectChange.replaceObject(AbstractReplaceObjectChange.java:116)
    at org.topbraidcomposer.change.lib.AbstractReplaceObjectChange.replaceObject(AbstractReplaceObjectChange.java:100)
    at org.topbraidcomposer.change.lib.ReplaceObjectChange.execute(ReplaceObjectChange.java:49)
    ... 6 more

Session data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_45
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA
Framework arguments:  -product org.eclipse.epp.package.rcp.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.rcp.product


Holger Knublauch

unread,
Jan 13, 2014, 8:46:46 PM1/13/14
to topbrai...@googlegroups.com
Hi Tanya,

the message means what it states: it is not possible to define a magic property that has an expression (such as COUNT) as result variable. Given that it only returns one value, why don't you just implement it as a normal spin:Function?

The exception below that seems unrelated, and I would need more information on why this happened.

HTH
Holger
--
-- 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
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
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 topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Tanya Hiebert

unread,
Jan 14, 2014, 12:01:34 PM1/14/14
to topbrai...@googlegroups.com
Thank you for your assistance. I have implemented it as normal, and it works now.

Tanya


You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/7zraqIn5dYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages