Reasoning SWRL does not work

Dear all,

I have been struggled with this problem for a while, where it seems that Stardog cannot infer SWRL rules. I implemented my ontology in Protege first and I also put some rules in (e.g. when a certain value is over the threshold, give a warning). Pellet reasoner can do the job properly and display whether there is a warning or not (inferred contents would have the yellow background). I put everything in Stardog but it did not work. Is there any way to achieve the same result as Pellet did?

Thank you!

If you check stardog.log you should see some warnings in there. You probably need to set the reasoning level to DL instead of SL.

Thanks! There are some warnings indeed in the log file. I set the reasoning level to DL and also enabled ICV. However, it still cannot infer the expected result :frowning:

I apologize, I shouldn't have suggested DL as it doesn't include SWRL. What are the errors that you're seeing?

You might want to take a look at the rule limitations listed in the documentation Home | Stardog Documentation Latest

I do not think there exists any error anymore. Here is the log:

INFO  2017-06-07 14:51:43,140 [main] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:syncCache(166): Initializing R2RML registry
INFO  2017-06-07 14:51:43,155 [main] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:syncCache(175): Loaded R2RML registry with 0 sources
INFO  2017-06-07 14:51:43,873 [main] com.complexible.stardog.StardogKernel:start(2200): Initializing Stardog
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(228): Memory options
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(229): Min Heap Size: 6.0G
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(230): Max Heap Size: 5.8G
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(231): Max Direct Mem: 5.0G
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(232): Max Mapped Mem: 691M
INFO  2017-06-07 14:51:44,918 [main] com.complexible.stardog.cli.impl.ServerStart:call(233): System Memory: 7.9G

Can you send the log warnings you’re seeing when running under SL?

Hi,

Here is the log when running under SL:

INFO  2017-06-05 15:13:14,273 [main] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:syncCache(166): Initializing R2RML registry
INFO  2017-06-05 15:13:14,293 [main] com.complexible.stardog.virtual.DefaultVirtualGraphRegistry:syncCache(175): Loaded R2RML registry with 0 sources
INFO  2017-06-05 15:13:15,884 [main] com.complexible.stardog.StardogKernel:start(2200): Initializing Stardog
INFO  2017-06-05 15:13:16,615 [main] com.complexible.stardog.cli.impl.ServerStart:call(228): Memory options
INFO  2017-06-05 15:13:16,616 [main] com.complexible.stardog.cli.impl.ServerStart:call(229): Min Heap Size: 2.0G
INFO  2017-06-05 15:13:16,616 [main] com.complexible.stardog.cli.impl.ServerStart:call(230): Max Heap Size: 1.9G
INFO  2017-06-05 15:13:16,616 [main] com.complexible.stardog.cli.impl.ServerStart:call(231): Max Direct Mem: 1.0G
INFO  2017-06-05 15:13:16,616 [main] com.complexible.stardog.cli.impl.ServerStart:call(232): Max Mapped Mem: 138M
INFO  2017-06-05 15:13:16,616 [main] com.complexible.stardog.cli.impl.ServerStart:call(233): System Memory: 7.9G
INFO  2017-06-05 15:22:07,529 [XNIO-1 task-29] com.complexible.stardog.StardogKernel:write(77): Bulk loading data to new database SSO.
INFO  2017-06-05 15:22:11,281 [XNIO-1 task-29] com.complexible.stardog.docs.db.StardocsConnectableFactory:createDocumentStore(117): Creating document store for SSO at file:///C:\data\stardog\SSO\docs
INFO  2017-06-05 15:22:11,306 [XNIO-1 task-29] com.complexible.stardog.StardogKernel:write(77): Loaded 415,095 triples to SSO from 1 file(s) in 00:00:03.846 @ 107.9K triples/sec.
INFO  2017-06-05 15:22:11,306 [XNIO-1 task-29] com.complexible.stardog.StardogKernel:write(77): Successfully created database 'SSO'.
ERROR 2017-06-05 15:28:26,362 [XNIO-1 task-19] com.complexible.annex.api.GraphHandler:getCollection(708): Error trying to create IRI from String 'using'
java.lang.IllegalArgumentException: No separator character found in the URI: using
	at com.complexible.common.rdf.model.StardogIRI.getLocalNameIndex(StardogIRI.java:59) ~[stardog-utils-rdf-5.0-RC1.jar:?]
	at com.complexible.common.rdf.model.StardogIRI.<init>(StardogIRI.java:32) ~[stardog-utils-rdf-5.0-RC1.jar:?]
	at com.complexible.common.rdf.model.StardogValueFactory.createIRI(StardogValueFactory.java:223) ~[stardog-utils-rdf-5.0-RC1.jar:?]
	at com.complexible.common.rdf.model.Values.iri(Values.java:51) ~[stardog-utils-rdf-5.0-RC1.jar:?]
	at com.complexible.jsonld.types.JsonIRI.<init>(JsonIRI.java:34) ~[stardog-webconsole-annex-5.0-RC1.jar:?]
	at com.complexible.annex.api.GraphHandler.getCollection(GraphHandler.java:703) ~[stardog-webconsole-annex-5.0-RC1.jar:?]
	at com.complexible.annex.api.GraphHandler.getLDObject(GraphHandler.java:436) ~[stardog-webconsole-annex-5.0-RC1.jar:?]
	at com.complexible.annex.api.GraphHandler.getResource(GraphHandler.java:221) ~[stardog-webconsole-annex-5.0-RC1.jar:?]
	at com.complexible.stardog.protocols.http.annex.GraphService.getResource(GraphService.java:204) ~[stardog-webconsole-annex-5.0-RC1.jar:?]
	at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0-RC1.jar:?]
	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
	at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0-RC1.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
WARN  2017-06-05 15:36:26,938 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: Domain(time:hasTRS,or(time:GeneralDateTimeDescription, time:GeneralDurationDescription, time:TimePosition)) 
WARN  2017-06-05 15:36:26,938 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: Domain(time:unitType,or(time:Duration, time:GeneralDateTimeDescription)) 
WARN  2017-06-05 15:36:26,947 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:QuantityKind,and(max(qu:scale,1,qu:Scale), cardinality(qu:name,1,xsd:string), cardinality(qu:symbol,1,xsd:string), max(qu:definitionURI,1,xsd:string), max(qu:description,1,xsd:string))) 
WARN  2017-06-05 15:36:26,952 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:Unit,and(max(qu:quantityKind,1,qu:QuantityKind), cardinality(qu:name,1,xsd:string), cardinality(qu:symbol,1,xsd:string), max(qu:definitionURI,1,xsd:string), max(qu:description,1,xsd:string))) 
WARN  2017-06-05 15:36:26,959 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:Dimension,and(all(qu:dimensionFactor,qu:DimensionFactor), cardinality(qu:symbolicExpression,1,xsd:string))) 
WARN  2017-06-05 15:36:26,959 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:DimensionFactor,cardinality(qu:baseDimension,1,qu:QuantityKind)) 
WARN  2017-06-05 15:36:26,960 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:Prefix,and(cardinality(qu:name,1,xsd:string), cardinality(qu:symbol,1,xsd:string), cardinality(qu:unitMultipleFactor,1,xsd:double))) 
WARN  2017-06-05 15:36:26,960 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:QuantityKindFactor,and(cardinality(qu:factorQuantityKind,1,qu:QuantityKind), cardinality(qu:exponent,1,xsd:double))) 
WARN  2017-06-05 15:36:26,960 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:ScaleValueDefinition,and(cardinality(qu:description,1,xsd:string), cardinality(qu:numericalValue,1,xsd:double))) 
WARN  2017-06-05 15:36:26,961 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:SpecializedQuantityKind,cardinality(qu:generalQuantityKind,1,qu:QuantityKind)) 
WARN  2017-06-05 15:36:26,961 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:SystemOfQuantities,and(some(qu:dimension,qu:Dimension), some(qu:quantityComponent,qu:QuantityKind), all(qu:baseQuantityKind,qu:QuantityKind), cardinality(qu:name,1,xsd:string), cardinality(qu:symbol,1,xsd:string), max(qu:definitionURI,1,xsd:string), max(qu:description,1,xsd:string))) 
WARN  2017-06-05 15:36:26,961 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:UnitFactor,and(cardinality(qu:unit,1,qu:Unit), cardinality(qu:exponent,1,xsd:double))) 
WARN  2017-06-05 15:36:26,961 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:GeneralDateTimeDescription,cardinality(time:hasTRS,1,owl:Thing)) 
WARN  2017-06-05 15:36:26,961 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:GeneralDateTimeDescription,cardinality(time:unitType,1,owl:Thing)) 
WARN  2017-06-05 15:36:26,962 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:Duration,cardinality(time:unitType,1,owl:Thing)) 
WARN  2017-06-05 15:36:26,962 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:Duration,cardinality(time:numericDuration,1,rdfs:Literal)) 
WARN  2017-06-05 15:36:26,962 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:GeneralDurationDescription,cardinality(time:hasTRS,1,owl:Thing)) 
WARN  2017-06-05 15:36:26,963 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:TimePosition,or(cardinality(time:nominalPosition,1,rdfs:Literal), cardinality(time:numericPosition,1,rdfs:Literal))) 
WARN  2017-06-05 15:36:26,963 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:TimePosition,cardinality(time:hasTRS,1,owl:Thing)) 
WARN  2017-06-05 15:36:26,974 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:ConversionBasedUnit,cardinality(qu:referenceUnit,1,qu:Unit)) 
WARN  2017-06-05 15:36:26,974 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:GeneralConversionUnit,cardinality(qu:expression,1,xsd:string)) 
WARN  2017-06-05 15:36:26,975 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:LinearConversionUnit,cardinality(qu:conversionFactor,1,xsd:double)) 
WARN  2017-06-05 15:36:26,975 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:PrefixedUnit,cardinality(qu:prefix,1,qu:Prefix)) 
WARN  2017-06-05 15:36:26,975 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(qu:SystemOfUnits,and(some(qu:unitComponent,qu:Unit), all(qu:baseUnit,qu:Unit), all(qu:prefix,qu:Prefix), all(qu:systemOfQuantities,qu:SystemOfQuantities), cardinality(qu:name,1,xsd:string), cardinality(qu:symbol,1,xsd:string), max(qu:definitionURI,1,xsd:string), max(qu:description,1,xsd:string))) 
WARN  2017-06-05 15:36:26,976 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:FeatureOfInterest,or(DUL:Event, DUL:Object)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,min(ssn:observationResultTime,0,owl:Thing)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,min(ssn:observationSamplingTime,0,owl:Thing)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,min(ssn:qualityOfObservation,0,owl:Thing)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,cardinality(ssn:featureOfInterest,1,ssn:FeatureOfInterest)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,cardinality(ssn:observedBy,1,ssn:Sensor)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,cardinality(ssn:observedProperty,1,ssn:Property)) 
WARN  2017-06-05 15:36:26,977 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(ssn:Observation,cardinality(ssn:sensingMethodUsed,1,ssn:Sensing)) 
WARN  2017-06-05 15:36:26,984 [XNIO-1 task-20] com.clarkparsia.blackout.ProfileFilterBase:apply(39): Not a valid SL axiom: SubClassOf(time:TemporalEntity,or(time:Instant, time:Interval)) 
INFO  2017-06-05 15:36:27,833 [XNIO-1 task-20] com.complexible.stardog.reasoning.equality.DefaultEqualityIndex:<init>(645): Starting sameAs inference materialization
INFO  2017-06-05 15:36:28,253 [XNIO-1 task-20] com.complexible.stardog.reasoning.equality.DefaultEqualityIndex:report(650): Phase 1 of 3 complete in 00:00:00.420
INFO  2017-06-05 15:36:28,255 [XNIO-1 task-20] com.complexible.stardog.reasoning.equality.DefaultEqualityIndex:report(650): Phase 2 of 3 complete in 00:00:00.001
INFO  2017-06-05 15:36:28,255 [XNIO-1 task-20] com.complexible.stardog.reasoning.equality.DefaultEqualityIndex:report(650): Phase 3 of 3 complete in 00:00:00.000
INFO  2017-06-05 15:36:28,255 [XNIO-1 task-20] com.complexible.stardog.reasoning.equality.DefaultEqualityIndex:finish(656): Finished sameAs inference materialization in 00:00:00.421

That’s somewhat odd. You’re getting an ERROR with SL but no error when using DL. It looks like it’s trying to parse the string “using” as a URI. I don’t think you should expect to see any warnings about your SWRL rules until you issued a query that triggered them. At least it looks like you’re not using any axioms outside of the SL profile.

That is why I struggle right now as it seems no way to trigger them via the web console. However, I tried to make the query via command line and it works! But it cannot finish the query and returns following errors:
ERROR 2017-06-07 19:10:24,761 [XNIO-1 task-36] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(228): An unexpected exception was handled by the server org.openrdf.query.QueryEvaluationException: Query execution cancelled: Execution time exceeded query timeout 300000 at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:81) ~[stardog-utils-rdf-5.0-RC1.jar:?] at org.openrdf.query.QueryResults.report(QueryResults.java:158) ~[sesame-query-4.0.0.jar:?] at org.openrdf.query.resultio.QueryResultIO.writeTuple(QueryResultIO.java:449) ~[sesame-queryresultio-api-4.0.0.jar:?] at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:470) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at com.complexible.stardog.protocols.http.server.ProtocolUtils.executeReadQuery(ProtocolUtils.java:441) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at com.complexible.stardog.protocols.http.server.SPARQLProtocol.executeQuery(SPARQLProtocol.java:133) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at com.complexible.stardog.protocols.http.server.SPARQLProtocol.get(SPARQLProtocol.java:81) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3] at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3] at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0-RC1.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] Caused by: com.complexible.stardog.plan.eval.operator.OperatorException: Query execution cancelled: Execution time exceeded query timeout 300000 at com.complexible.stardog.plan.eval.operator.impl.AbstractOperator.checkCanceled(AbstractOperator.java:139) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.reasoning.equality.CanonicalizeOperator.computeNext(CanonicalizeOperator.java:128) ~[stardog-reasoning-core-5.0-RC1.jar:?] at com.complexible.stardog.reasoning.equality.CanonicalizeOperator.computeNext(CanonicalizeOperator.java:39) ~[stardog-reasoning-core-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.SimpleEquiJoinKeyIterator.hasNext(SimpleEquiJoinKeyIterator.java:93) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.ResetableEquiJoinIterator.hasNext(ResetableEquiJoinIterator.java:105) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.CrossProductIterator$InnerJoinCrossProductIterator.hasNext(CrossProductIterator.java:251) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.MergeJoinOp._nextCross(MergeJoinOp.java:175) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.MergeJoinOp.computeNext(MergeJoinOp.java:249) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.MergeJoinOp.computeNext(MergeJoinOp.java:29) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:85) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:83) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:33) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LoopJoin.computeNext(LoopJoin.java:196) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LoopJoin.computeNext(LoopJoin.java:25) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LoopJoin.computeNext(LoopJoin.java:196) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LoopJoin.computeNext(LoopJoin.java:25) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:82) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:85) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.UnionOp.computeNext(UnionOp.java:22) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at java.util.Iterator.forEachRemaining(Iterator.java:115) ~[?:1.8.0_121] at com.complexible.stardog.plan.eval.operator.impl.OrderOp.sort(OrderOp.java:150) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.OrderOp.computeNext(OrderOp.java:137) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.OrderOp.computeNext(OrderOp.java:31) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:83) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.SingleProjectionOp.computeNext(SingleProjectionOp.java:33) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LazyUnsortedGroupify$1.computeNext(GroupifyAlgorithms.java:146) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.LazyUnsortedGroupify$1.computeNext(GroupifyAlgorithms.java:137) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.AbstractGroupOp.computeNext(AbstractGroupOp.java:140) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.AbstractGroupOp.computeNext(AbstractGroupOp.java:31) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.DistinctOp.computeNext(DistinctOp.java:53) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.impl.DistinctOp.computeNext(DistinctOp.java:21) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:112) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.util.AutoCloseOperator.computeNext(AutoCloseOperator.java:25) ~[stardog-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.tryToComputeNext(AbstractSkippingIterator.java:143) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.common.collect.AbstractSkippingIterator.hasNext(AbstractSkippingIterator.java:130) ~[stardog-utils-common-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:110) ~[stardog-5.0-RC1.jar:?] at com.complexible.stardog.plan.eval.operator.util.OpBasedBindingSetIteration.computeNext(OpBasedBindingSetIteration.java:34) ~[stardog-5.0-RC1.jar:?] at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-18.0.jar:?] at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-18.0.jar:?] at com.complexible.common.rdf.query.IteratorAsTupleQueryResult.hasNext(IteratorAsTupleQueryResult.java:77) ~[stardog-utils-rdf-5.0-RC1.jar:?] ... 13 more

The console also states:
The server returned a partial response. This is likely due to a query timeout.
Fortunately, rules can be inferred at least. A snippet of the result is like (where ?d is inferred based on ?b):

Jingfus-MacBook-Pro:bin Jin$ ./stardog query SSO -r "select ?a ?b ?c ?d where{?a sso:hasQuantityValue ?b; time:xsdDateTime ?c; sso:hasWarning ?d}"
+----------------------------------------+-------+-------------------------------------+-------+
|                   a                    |   b   |                  c                  |   d   |
+----------------------------------------+-------+-------------------------------------+-------+
| sso:WaterLevelMeasurementValue_WL001   | 65.5  | "2017-05-25T18:13:38"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL005   | 79.0  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL006   | 69.0  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL008   | 55.8  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL009   | 63.8  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL010   | 95.8  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL012   | 60.7  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL013   | 91.3  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL014   | 75.8  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL016   | 75.2  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL017   | 60.3  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL018   | 65.7  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL023   | 76.5  | "2017-05-25T18:13:39"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL027   | 55.4  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL029   | 58.3  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL031   | 89.8  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL032   | 68.5  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL033   | 96.7  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL034   | 88.7  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL036   | 78.0  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL037   | 85.4  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL039   | 92.8  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL040   | 90.0  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL041   | 76.9  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL042   | 83.1  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL044   | 64.8  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL046   | 55.7  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL047   | 70.6  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL048   | 94.2  | "2017-05-25T18:13:40"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL051   | 88.1  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL052   | 75.7  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL054   | 81.7  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL055   | 66.9  | "2017-05-25T18:13:41"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL058   | 84.0  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL060   | 59.9  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL062   | 99.3  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL063   | 97.5  | "2017-05-25T18:13:42"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL066   | 75.4  | "2017-05-25T18:13:43"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL067   | 64.0  | "2017-05-25T18:13:43"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL069   | 66.6  | "2017-05-25T18:13:43"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL070   | 65.2  | "2017-05-25T18:13:44"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL071   | 89.8  | "2017-05-25T18:13:44"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL073   | 72.9  | "2017-05-25T18:13:44"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL075   | 54.8  | "2017-05-25T18:13:44"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL080   | 52.7  | "2017-05-25T18:13:43"^^xsd:dateTime | true  |
| sso:WaterLevelMeasurementValue_WL082   | 61.2  | "2017-05-25T18:13:43"^^xsd:dateTime | true  |

It just seems that the query has taken too long. My ontology is fairly big and 20000 results are expected. Can you tell me how to set the timeout value? Thanks!

There is no problem if I do not query sso:hasWarning.

You an set the timeout with the query.timeout option Home | Stardog Documentation Latest

You can set it either through the CLI with stardog-admin metadata ... or the WebConsole after taking the database offline. Setting the value to 0 disables timing out of queries.

I don't know what the expressivity of your ontology is but you may want to try the EL profile (although you don't get SWRL rules) Home | Stardog Documentation Latest

2 Likes

OWL2 EL sounds good for this scenario but I need to add rules to infer based on the value. Plus, my ontology is modified from W3C SSN ontology and the expressivity does not seem satisfied with EL profile. Thanks for your help!

The query can be done now by CLI, which takes about 15 mins. It takes surprisingly long. So I might have to look into something else to tackle this. But the web console still cannot display the expected result.

Are you getting any warnings or anything in the logs when you try to query through the web console?

Slow queries are always of interest to the Stardog folks. Can you include the query plan?

You also might be interested in checking our the blog posts on query optimization and query plans

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.