#
#	SAN Example:	Decorators (a SAN with decorators)
#
     @prefix : <http://www.test.com/test1#> .
     @prefix log: <http://www.w3.org/2000/10/swap/log#> .
     @prefix owl: <http://www.w3.org/2002/07/owl#> .
     @prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> .
     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
     @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
     @prefix san: <http://imu.ntua.gr/ontologies/san/2011/06/01/san.rdf#> .
     @prefix swrl: <http://www.w3.org/2003/11/swrl#> .
     @prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
     @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
     @prefix xsp: <http://www.owl-ontologies.com/2005/08/07/xsp.owl#> .
        
    
    :RootGoal_1     a san:RootGoal;
        san:name "g1"^^xsd:string;
        san:hasSituation :Situation_1;
        san:hasContextCondition :ContextCondition_1;
#		san:hasAction :Print_Deco_1 .
#		san:hasAction :Break_Deco_1 .
#		san:hasAction :Success_Deco_1 .
#		san:hasAction :Failure_Deco_1 .
#		san:hasAction :Loop_Deco_1 .
#		san:hasAction :Count_Deco_1 .
#		san:hasAction :Timer_Deco_1 .
#		san:hasAction :Exception_Deco_1 .
		san:hasAction :Condition_Deco_1 .

    
    :Situation_1     a san:Situation ;
        san:name "s1"^^xsd:string ;
		san:dialect "EP-SPARQL"^^xsd:string ;
		san:defined-by "+++++++++++++++++++++++++"^^xsd:string .
    
    :ContextCondition_1     a san:ContextCondition;
        san:name "c1"^^xsd:string ;
		san:dialect "default"^^xsd:string ;
		san:defined-by "true"^^xsd:string .

# Print Decorator		
	:Print_Deco_1	a	san:PrintDecorator ;
		san:name "a DEBUG PRINT decorator "^^xsd:string ;
		san:message "A Dummy Debug Print Message"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Break Decorator		
	:Break_Deco_1	a	san:BreakDecorator ;
		san:name "a DEBUG BREAK decorator "^^xsd:string ;
		san:message "A Dummy Debug Break Message"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Success Decorator		
	:Success_Deco_1	a	san:SuccessDecorator ;
		san:name "a SUCCESS decorator "^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Failure Decorator		
	:Failure_Deco_1	a	san:FailureDecorator ;
		san:name "a FAILURE decorator "^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Loop Decorator		
	:Loop_Deco_1	a	san:LoopDecorator ;
		san:name "a LOOP decorator "^^xsd:string ;
		san:loop-condition-dialect "default"^^xsd:string ;
		san:loop-condition-defined-by "true"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Count Decorator		
	:Count_Deco_1	a	san:CounterDecorator ;
		san:name "a COUNTER decorator "^^xsd:string ;
		san:counter-variable "global : COUNTER_VAR"^^xsd:string ;
		san:counter-start "100"^^xsd:string ;
		san:counter-step "10"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Timer Decorator		
	:Timer_Deco_1	a	san:TimerDecorator ;
		san:name "a TIMER decorator "^^xsd:string ;
		san:timeout "5000"^^xsd:string ;			# timeout in millis
#		san:return-code "SUCCESS"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Exception Handler Decorator		
# Uncomment the appropriate line in :Dummy_Action_1 specification
	:Exception_Deco_1	a	san:ExceptionHandlerDecorator ;
		san:name "a EXCEPTION HANDLER decorator "^^xsd:string ;
		san:exception-type "java.lang.RuntimeException"^^xsd:string ;
		san:failover-job "http://www.test.com/test1#Failover_Action_1"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Condition Decorator		
	:Condition_Deco_1	a	san:ConditionDecorator ;
		san:name "a CONDITION decorator "^^xsd:string ;
		san:condition-dialect "default"^^xsd:string ;
		san:condition-defined-by "true"^^xsd:string ;
		san:hasAction :Dummy_Action_1 .
	
# Decorator Action
	:Dummy_Action_1     a san:PrimitiveAction ;
      san:name "dummy-action-ONE"^^xsd:string ;
	  san:order "1"^^xsd:integer ;
#
# For use with all Decorators except Exception Handler Decorator
	  san:command "DELAY 2 SUCCESS"^^xsd:string .
# Uncomment for use with EXCEPTION HANDLER DECORATOR
#	  san:command "THROW RUNTIME"^^xsd:string .
    
# Exception Handler Decorator FAILOVER Action
	:Failover_Action_1     a san:PrimitiveAction ;
      san:name "FAILOVER-action"^^xsd:string ;
	  san:command "FAILOVER SUCCEEDED!!!"^^xsd:string .
    
#END
