Sesame ClassCastException?

0 views
Skip to first unread message

Asa Calow

unread,
Jan 30, 2014, 11:05:35 AM1/30/14
to sta...@clarkparsia.com
Hi all,

Having added some data, I'm getting the following error from Stardog: 

java.lang.ClassCastException: org.openrdf.model.impl.CalendarLiteralImpl cannot be cast to org.openrdf.model.Resource.

The controversial triple (which leads to the error) is this:

 Slightly more odd is that this query is fine:


Whereas this query fails:


After some poking around it looks like this is a Sesame issue, but if anyone could shed some light on the matter it would be massively appreciated.

Thanks,

Asa 

Evren Sirin

unread,
Jan 31, 2014, 11:01:45 AM1/31/14
to Stardog
It is hard to tell what is going on without additional information. If
you could provide a minimal dataset to reproduce the problem that
would be great. With just one triple you mention, the describe query
seems to work fine. Also were you trying the query with a reasoning
level? Which version of Stardog?

Best,
Evren
> --
> -- --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Laurent Pierre

unread,
Feb 4, 2014, 11:22:26 AM2/4/14
to stardog
Hi, 

I have a problem with a rule that doesn’t fire since in may opinion it should (in file RuleSimplified2.ttl line 57).
I test the context with a sparql query :

PREFIX meteo: <http://www.meteo.org#>

SELECT  ?hs ?mp ?ec ?tu ?com ?s ?a ?v ?ec
WHERE {
    ?c :clientId "lambert"^^xsd:string .
    ?t :hasYear 2010 .

    ?c :livesIn ?h .

    ?h :hasSituation ?hs .
    ?hs :takesPlaceIn ?t .

    ?hs :hasContractMaxPower ?mp .
    ?hs :hasElectricityConsumption ?ec .
    ?hs :hasTimeOfUse ?tu .

    ?h :isLocatedIn ?com .
    ?com meteo:hasStation ?s .
    ?s meteo:hasAverageDegreesByDay ?a .
    ?a meteo:onYear 2010 .
    ?a meteo:val ?v .

    ?hs :hasStandardElectricityConsumption ?ec .


}


which works fine until I add the red condition. This condition is what should be computed in the rule line 57 and seems not to be ‘present'.

I join the ontologies, the rule file, the sparql file and a script to construct the database.

Have you any clue of what’s happening here ?

Thanks.

Laurent 
C&P.zip

Héctor Pérez-Urbina

unread,
Feb 4, 2014, 6:59:57 PM2/4/14
to stardog
Thank you for your email. I'll take a look at this tomorrow.


--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en







--
Best,
Héctor

Héctor Pérez-Urbina

unread,
Feb 5, 2014, 10:59:55 AM2/5/14
to stardog
Laurent,

Playing with your query I found out that


and


According to your query, the electricity consumption and the standard electricity consumption should be the same; therefore we get no results. Did you mean to use another variable for the standard one? Should these two be the same?
--
Best,
Héctor

Laurent Pierre

unread,
Feb 6, 2014, 5:22:36 AM2/6/14
to stardog
Dear Hector,

Thank you, I made a mistake when writing the query.  So I went further with my queries and I found another problem with this one :


SELECT  ?tprev ?previousYearCons  ?t ?currentYearCons
WHERE {
    ?c :clientId "lambert"^^xsd:string .
    ?t :hasYear 2010 .

    ?c :livesIn ?h .

    ?h :hasSituation ?hs .
    ?hs :takesPlaceIn ?t .
    ?h :hasSituation ?hsprev .
    ?hsprev :takesPlaceIn ?tprev .

    ?tprev :precedes ?t .

    ?hs :hasStandardElectricityConsumption ?currentYearCons .
    ?hsprev :hasStandardElectricityConsumption ?previousYearCons .

}

I get no answer, but when I withdraw either one of the 2 last clause (written in bold), I get the correct answer for  ?previousYearCons or 
?currentYearCons.

It’s a bit strange isn’t it ?

Best 

Laurent


To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Héctor Pérez-Urbina

unread,
Feb 10, 2014, 11:06:48 AM2/10/14
to stardog
Yes. This looks quite strange. I'll take a closer look today and let you know what I find.
Reply all
Reply to author
Forward
0 new messages