SELECT (SUM(?fl) AS ?totFlow)
WHERE {:H1 ^ont:fedBy+/ont:flowConsumption ?fl}
ont:feeds a owl:ObjectProperty ,
owl:TransitiveProperty ;
owl:inverseOf ont:fedBy .
ont:indirectConsumption a owl:DataTypeProperty ;
owl:propertyChainAxiom ( ont:feeds ont:flowConsumption ) .
Is it true that inverse property paths and arbitrary length matches are not supported when writing rules?
On the attached graph the following query gives me the total flow in hub H1:SELECT (SUM(?fl) AS ?totFlow)WHERE {:H1 ^ont:fedBy+/ont:flowConsumption ?fl}Returns totFlow = 8.
For now I just wanted to infer the indirect consumptions by the following rule:
IF {?p ^ont:fedBy+/ont:flowConsumption ?fc .}THEN {?p ont:indirectConsumption ?fc .}
which doesn't return any results.I know I can do this by adding the following to my ontology (see flow_simple2.pdf), but I wanted to do it with a rule:
ont:feeds a owl:ObjectProperty ,
owl:TransitiveProperty ;
owl:inverseOf ont:fedBy .ont:indirectConsumption a owl:DataTypeProperty ;
owl:propertyChainAxiom ( ont:feeds ont:flowConsumption ) .
--For the summation, I am kind of lost no matter if I have the indirect flow consumptions added to the node or not.
-- --
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+unsubscribe@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.
Stardog Rule Syntax has the same expressivity of SWRL which means the SPARQL features allowed in rules are limited. Specifically, a triple pattern in a rule should be in one of the following forms:
a) term1 rdf:type
class-uri
b) term1 prop-uri term2
where class-uri is a URI referring to a user-defined class and prop-uri is a URI referring to a user-defined property.[30]
Only type of property paths allowed in rules are inverse paths (^p
), sequence paths (p1 / p2
) and alternative paths (p1 | p2
) but these paths should not violate the above conditions. For example, the property path rdf:type/rdfs:label
is not valid because according to the SPARQL spec this would mean the object of a rdf:type
triple pattern is a variable and not a user-defined class.
Rule body (IF
) and only rule body may optionally contain UNION
, BIND
or FILTER
clauses. However, functions EXISTS
, NOT EXISTS
, or NOW()
cannot be used in rules. User-defined functions (UDF) may be used in rules but if the UDF is not a pure function then the results are undefined.
Other SPARQL features are not allowed in rules.
SELECT ?p (SUM(?fl) AS ?totFlow)
WHERE {
?p ^ont:fedBy+/ont:flowConsumption ?fl
}
GROUP BY (?p)
INSERT { ?p ont:flow ?totFlow }
--
-- --
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
--
-- --
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