Semantic Annotation for Process Models: - Department of Computer ...

Semantic Annotation for Process Models: - Department of Computer ... Semantic Annotation for Process Models: - Department of Computer ...

21.01.2014 Views

194 APPENDIX D. ALGORITHM FOR GOAL ANNOTATION Algorithm 5 Goal Annotation Algorithm for Case C Require: weight parameters ε, ζ initialize value of weight f oractoronto, weight f oractorname as 0 Arrayar[] is a set of actor-roles associated with av through has_Actor-role for each ar in ar[] do onto = OD(ar) {OD(ar) gets the domain ontological concept annotated to ar} for each target role ar ′ of a g in goal ontology do r = SR(ar, onto) {SR(ar, onto) gets the semantic relationship between ar and onto} initialize σ, τ as 0 if onto equals ar ′ then if r is "same_as" then σ = 1 else if r is "kind_of" then σ = 0.8 else if r is "phase_of" then σ = 0.5 end if end if weight f oractoronto = weight f oractoronto+σ if ar.name equals ar ′ .name by string match then τ = 1 else if ar.name partly equals ar ′ .name by string match then τ = 0.5 end if weight f oractorname = weight f orartorname+τ end for end for return ε ∗ weight f orarti f actonto+ζ ∗ weight f orarti f actname

195 Algorithm 6 Goal Annotation Algorithm for Case D Require: weight parameters ε, ζ initialize value of weight f orprecondition, weight f orpostcondition, weight f orexception as 0 Arraypre[] is a set of preconditions associated with av through has_Precondition initialize σ, τ as 0 for each precon in pre[] do for each target constraint c ′ of a g in goal ontology do if precon.name equals c ′ .name by string match then τ = 1 else if precon.name partly equals c ′ .name by string match then τ = 0.5 end if weight f orprecondition = weight f orprecondition+τ end for end for Arraypost[] is a set of postconditions associated with av through has_Postcondition initialize σ, τ as 0 for each postcon in post[] do for each target constraint c ′ of a g in goal ontology do if postcon.name equals c ′ .name by string match then τ = 1 else if postcon.name partly equals c ′ .name by string match then τ = 0.5 end if weight f orpostcondition = weight f orpostcondition+τ end for end for Arrayexc[] is a set of exceptions associated with av through has_Exception initialize σ, τ as 0 for each exception in exc[] do for each target constraint c ′ of a g in goal ontology do if exception.name equals c ′ .name by string match then τ = 1 else if exception.name partly equals c ′ .name by string match then τ = 0.5 end if weight f orexception = weight f orexception+ τ end for end for return η ∗ (weight f orprecondition + weight f orpostcondition + weight f orexception)

195<br />

Algorithm 6 Goal <strong>Annotation</strong> Algorithm <strong>for</strong> Case D<br />

Require: weight parameters ε, ζ<br />

initialize value <strong>of</strong> weight f orprecondition, weight f orpostcondition,<br />

weight f orexception as 0<br />

Arraypre[] is a set <strong>of</strong> preconditions associated with av through has_Precondition<br />

initialize σ, τ as 0<br />

<strong>for</strong> each precon in pre[] do<br />

<strong>for</strong> each target constraint c ′ <strong>of</strong> a g in goal ontology do<br />

if precon.name equals c ′ .name by string match then<br />

τ = 1<br />

else if precon.name partly equals c ′ .name by string match then<br />

τ = 0.5<br />

end if<br />

weight f orprecondition = weight f orprecondition+τ<br />

end <strong>for</strong><br />

end <strong>for</strong><br />

Arraypost[] is a set <strong>of</strong> postconditions associated with av through has_Postcondition<br />

initialize σ, τ as 0<br />

<strong>for</strong> each postcon in post[] do<br />

<strong>for</strong> each target constraint c ′ <strong>of</strong> a g in goal ontology do<br />

if postcon.name equals c ′ .name by string match then<br />

τ = 1<br />

else if postcon.name partly equals c ′ .name by string match then<br />

τ = 0.5<br />

end if<br />

weight f orpostcondition = weight f orpostcondition+τ<br />

end <strong>for</strong><br />

end <strong>for</strong><br />

Arrayexc[] is a set <strong>of</strong> exceptions associated with av through has_Exception<br />

initialize σ, τ as 0<br />

<strong>for</strong> each exception in exc[] do<br />

<strong>for</strong> each target constraint c ′ <strong>of</strong> a g in goal ontology do<br />

if exception.name equals c ′ .name by string match then<br />

τ = 1<br />

else if exception.name partly equals c ′ .name by string match then<br />

τ = 0.5<br />

end if<br />

weight f orexception = weight f orexception+ τ<br />

end <strong>for</strong><br />

end <strong>for</strong><br />

return η ∗ (weight f orprecondition + weight f orpostcondition + weight f orexception)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!