1. Property가 Data type인경우만 Literal을 보이도록한다.
2. Property에 해당 하는 Data type의 regex를 본다.
3. Property에 해당 하는 regex에 맞지 않으면 에러 처리
4. Rule로 변한 Regex를 반영한다.
1. Property가 Data type인경우만 Literal을 보이도록한다.
2. Property에 해당 하는 Data type의 regex를 본다.
3. Property에 해당 하는 regex에 맞지 않으면 에러 처리
4. Rule로 변한 Regex를 반영한다.
PARSER_BEGIN(OwlPathParser)
package Grammar;
public class OwlPathParser{}
PARSER_END(OwlPathParser)
SKIP :
{
" "
| "\t"
| "
"
| "
"
| < "//" (~[ "
", "
" ])*
(
"
"
| "
"
| "
"
) >
| < "/*" (~[ "*" ])* "*"
(
~[ "/" ] (~[ "*" ])* "*"
)*
"/" >
} /* ROOT */
SimpleNode Start() : {} { Sentence() EndOfSentence() < EOF > { return jjtThis; } }
void Sentence() : {} { Phrase() ( ( "," Conjunction() ) Phrase() )* }
void Phrase() : {} { NounPhrase() VerbPhrase() ( Conjunction() VerbPhrase())* }
void NounPhrase() : {} { Subject() ( RelativePronoun() (VerbPhrase() | TypePredicate() Class()))? }
void VerbPhrase() : {} { Predicate() ObjectPhrase() }
void ObjectPhrase() : {} { Object() ( RelativePronoun() (VerbPhrase() | TypePredicate() Class()))? }
void Subject(): {} { Individual() | Pronoun() | DefiniteIndividual() | Identifier() }
void Predicate(): {} { Property() }
void Object(): {} { Individual() | Pronoun() | DefiniteIndividual() }
void DefiniteIndividual (): {} { Article() Individual() }
select (SELECT sum(writetime/1339410394624.0) FROM word,report where word.report_seq = report.seq and report.template_seq = 1 and word.word='hasPreExistingAdenoma')*0.3 + (SELECT sum(writetime/1339410394624.0) FROM word,report where word.report_seq = report.seq and report.template_seq = 1 and word.word='hasPreExistingAdenoma' and report.patient_seq = 7)*0.3 + (SELECT sum(writetime/1339410394624.0) FROM word,report where word.report_seq = report.seq and report.template_seq = 1 and word.word='hasPreExistingAdenoma' and report.clinician_seq = 2)*0.3;
[남겨 둘 것]
hasEntity 추가
[한계]
Rule들이 상충하는 경우 이를 보정할 수 없다.
같은 class를 range로 사용하는 경우 의도치 않게 변경될 수 있으니
규칙 작성시 여러 property가 하나의 class를 range로 갖지 않도록 해야한다.