You can't directly express a disjunction in the rule body the way that you'd like to, unfortunately, but there are some workarounds. The most direct solution is to write two rules:
Person(?x), Age(?x,?age), ?age < 10 -> blah(?x)
Person(?x), Age(?x,?age), ?age > 30 -> blah(?x)
SWRL does support the use of class expressions (see more in Martin Kuba's OWL 2 and SWRL Tutorial), so you could do this:
Person(?x), ((some Age xsd:integer[< 10]) or (some Age xsd:integer[> 30]))(?x) -> blah(?x)
but you won't be able to enter that rule in Protege, even though if you write it in some other ontology editor, or write it by hand, Protege can display it correctly. You could simply that even more and do this:
Person(?x), ((some Age (xsd:integer[< 10] or xsd:integer[> 30]))(?x) -> blah(?x)
or even father and do this:
(Person and (some Age (xsd:integer[< 10] or xsd:integer[> 30])))(?x) -> blah(?x)
Of course, at this point, depending on what blah(?x) is, you might be able to just use a general class axiom that Protege will accept. E.g., if blah is actually a class, Not10To30YearOldPerson, you can use an axiom like:
Person and (age some (xsd:integer[< 10] or xsd:integer[> 30]))
subClassOf not TenToThirtyYearOldPerson
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…