use of org.w3._2007.rif.Const in project hale by halestudio.
the class ModelRifToRifTranslator method createAssignmentSlot.
private void createAssignmentSlot(PropertyMapping mapping, Frame frame) {
SlotFrameType slot = factory.createSlotFrameType();
// $NON-NLS-1$
slot.setOrdered("yes");
Const const1 = factory.createConst();
const1.getContent().add(mapping.getTarget().getPropertyName());
// $NON-NLS-1$
const1.setType("rif:iri");
slot.getContent().add(const1);
Var var1 = factory.createVar();
var1.getContent().add(mapping.getSource().getName());
slot.getContent().add(var1);
frame.getSlot().add(slot);
}
use of org.w3._2007.rif.Const in project hale by halestudio.
the class ModelRifToRifTranslator method createTargetInstanceMembershipFormula.
private Assert createTargetInstanceMembershipFormula(Actions actions, ModelSentence sentence, RifVariable instanceVariable) {
Assert assert1 = factory.createAssert();
Target target = factory.createAssertTarget();
Member member = factory.createMember();
Instance instance = factory.createInstance();
Var var = factory.createVar();
var.getContent().add(instanceVariable.getName());
instance.setVar(var);
member.setInstance(instance);
org.w3._2007.rif.Class clazz = factory.createClass();
Const const1 = factory.createConst();
// $NON-NLS-1$
const1.setType("rif:iri");
const1.getContent().add(instanceVariable.getClassName());
clazz.setConst(const1);
member.setClazz(clazz);
target.setMember(member);
assert1.setTarget(target);
return assert1;
}
use of org.w3._2007.rif.Const in project hale by halestudio.
the class ModelRifToRifTranslator method createSourceInstanceMembershipFormula.
private Formula createSourceInstanceMembershipFormula(ModelSentence sentence, RifVariable instanceVariable) {
Formula result = factory.createFormula();
Member member = factory.createMember();
Instance instance = factory.createInstance();
Var var = factory.createVar();
String name = sentence.getSourceClass().getName();
var.getContent().add(name);
Const const1 = factory.createConst();
// $NON-NLS-1$
const1.setType("rif:iri");
const1.getContent().add(instanceVariable.getClassName());
org.w3._2007.rif.Class clazz = factory.createClass();
instance.setVar(var);
clazz.setConst(const1);
member.setInstance(instance);
member.setClazz(clazz);
result.setMember(member);
return result;
}
use of org.w3._2007.rif.Const in project hale by halestudio.
the class ModelRifToRifTranslator method createBindingSlot.
private void createBindingSlot(RifVariable child, Frame frame) {
SlotFrameType slot = factory.createSlotFrameType();
// $NON-NLS-1$
slot.setOrdered("yes");
Const const1 = factory.createConst();
const1.getContent().add(child.getPropertyName());
// $NON-NLS-1$
const1.setType("rif:iri");
slot.getContent().add(const1);
Var var1 = factory.createVar();
var1.getContent().add(child.getName());
slot.getContent().add(var1);
frame.getSlot().add(slot);
}
use of org.w3._2007.rif.Const in project hale by halestudio.
the class ModelRifToRifTranslator method createStaticAssignmentSlot.
private void createStaticAssignmentSlot(StaticAssignment staticAssignment, Frame frame) {
SlotFrameType slot = factory.createSlotFrameType();
// $NON-NLS-1$
slot.setOrdered("yes");
Const const1 = factory.createConst();
const1.getContent().add(staticAssignment.getTarget().getPropertyName());
// $NON-NLS-1$
const1.setType("rif:iri");
slot.getContent().add(const1);
Const const2 = factory.createConst();
// $NON-NLS-1$
const2.setType("http://www.w3.org/2001/XMLSchema#string");
const2.getContent().add(staticAssignment.getContent());
slot.getContent().add(const2);
frame.getSlot().add(slot);
}
Aggregations