I'm using TopBraid Composer Free Edition to compose ontologies and SPIN rules. I'm loading my ontologies into Sesame OpenRDF Workbench using an RDF file saved from TopBraid Composer Free Edition.
I have an application for SPIN rules (more precisely, SPIN constructors) which is dynamic in terms of which of hundreds of rules should apply. I would like to find a way to add a concept of "active" or "inactive" to SPIN rules. I'm willing to add a check to each rule in the WHERE
clause so that only "active" rules. To illustrate, suppose that I create two sub-properties of SPIN:constructor, call them myPrefix:activeConstructor
and myPrefix:inactiveConstuctor
.
Now I want to add to the WHERE clause of my constructors a triple of the form:
?thisConstructorURI a myPrefix:activeConstructor .
This approach hinges on defining ?thisConstuctorURI
. SPIN sets ?this
to the current instance of the class associated with the rule. Is there something similar for the URI of the rule itslef.
I also believe that at present, the rules reside at blank nodes. For example, the constructors for my sxxicc:Pub7Proposal class have the following triples for 13 constructors as viewed in Sesame/OpenRDF Workbench:
SUBJECT PREDICATE OBJECT
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14591
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14638
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14710
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14787
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14841
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox14927
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15002
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15088
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15114
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15195
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15257
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15336
sxxicc:Pub7Proposal spin:constructor _:node1anlqmpiox15377
What I really need (I think) is
- rules to be able to reference themselves (my
?thisConstructorURI
idea) - to be able to name rules when I write them (e.g.
sxxicci:Pub7ProposalSecurityClassificationConsistencyCheck
)
This is all so that I can activate/deactivate the rules one-by-one (or by simple extension in arbitrary named groups). Any ideas on how to do this?
Satisfying 1. above is similar to the spin:violationSource
already supported for constraints which can be included in a spin:ConstraintViolation
. However, I'm quite deliberately using constructors instead of constraints primarily because I do not want to block instantiation of a class even if it has violations.
I'm afraid the answer is that the current SPIN standard and implementations do not support this and that it would require altering the supporting implementation to extend the standard to do this.