Menu

[r3]: / py_top_engine_utest / test-parser1.trd  Maximize  Restore  History

Download this file

94 lines (68 with data), 2.6 kB

############################################################################
# test rule syntax
#
############################################################################

############################################################################
# schema section
#
############################################################################
*schema-begin*
	
	m          = resource("m_m")
	has_gender = resource("has_gender")
	male       = resource("male")
	female     = resource("female")
	has        = resource("has")
	
	text1 = text("some text here!")
	text2 = text("some multi-line "		\
				 "text here!")
	text3 = text("some \"quoted\" multi-line \""		\
				 "text here!\"")
	
	l100  = uint("100")
	l_m10  = int ("-10")
	l_22_5 = real("22.5")

	6   = int("6")
	10  = int("10")
	
	one_hour = duration("1:00:00")
	time1 = time("2007-01-30 16:00:00")
	date1 = date("2007-01-30")


*schema-end*
############################################################################


############################################################################
# knowledge base section
#
############################################################################
*knowledge-base-begin*
	
	default-explain = false
	default-optimization = true

*knowledge-base-end*
############################################################################


############################################################################
# knowledge rules section
#
############################################################################
*knowledge-rules-begin*
	
	# another one with long name for attribute keys - they can be mixed as well
	rule1:																\
		(?s1 has ?age) . [ ( ?age >= 6)  and (?age < 10)].				\
		not(?s1 has male) .												\
		(?s2 has "2007-02-03")											\
		-> 																\
		(?s1 has (?age < 10 ) ) .										\
		(?s2 has male)


	
	# another one with long name for attribute keys - they can be mixed as well
	rule2:																\
		(?s1 has male)													\
		<- 																\
		(?s1 has ?age).[(?age >= 6)  and (?age < 10)].					\
		not(?s1 has male).												\
		(?s1 has "2007-02-03")											

	
	query2:  SELECT ?s1 ?s3  FROM 									\
		(?s1 has ?age).[(?age >= 6)  and (?age < 10)].					\
		not(?s1 has male).												\
		(?s3 has "2007-02-03")											
	
	query3:  SELECT *  FROM 											\
		(?s1 has ?age).[(?age >= 6)  and (?age < 10)].					\
		not(?s1 has male).												\
		(?s2 has "2007-02-03")											


	
*knowledge-rules-end*
############################################################################

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.