Search in sources :

Example 1 with Const

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);
}
Also used : SlotFrameType(org.w3._2007.rif.SlotFrameType) ActionVar(org.w3._2007.rif.Do.ActionVar) Var(org.w3._2007.rif.Var) Const(org.w3._2007.rif.Const)

Example 2 with Const

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;
}
Also used : Target(org.w3._2007.rif.Assert.Target) Assert(org.w3._2007.rif.Assert) Instance(org.w3._2007.rif.Instance) ActionVar(org.w3._2007.rif.Do.ActionVar) Var(org.w3._2007.rif.Var) Const(org.w3._2007.rif.Const) Member(org.w3._2007.rif.Member)

Example 3 with Const

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;
}
Also used : Formula(org.w3._2007.rif.Formula) Instance(org.w3._2007.rif.Instance) ActionVar(org.w3._2007.rif.Do.ActionVar) Var(org.w3._2007.rif.Var) Const(org.w3._2007.rif.Const) Member(org.w3._2007.rif.Member)

Example 4 with Const

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);
}
Also used : SlotFrameType(org.w3._2007.rif.SlotFrameType) ActionVar(org.w3._2007.rif.Do.ActionVar) Var(org.w3._2007.rif.Var) Const(org.w3._2007.rif.Const)

Example 5 with Const

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);
}
Also used : SlotFrameType(org.w3._2007.rif.SlotFrameType) Const(org.w3._2007.rif.Const)

Aggregations

Const (org.w3._2007.rif.Const)7 ActionVar (org.w3._2007.rif.Do.ActionVar)6 Var (org.w3._2007.rif.Var)6 SlotFrameType (org.w3._2007.rif.SlotFrameType)3 Instance (org.w3._2007.rif.Instance)2 Member (org.w3._2007.rif.Member)2 ArgsUNITERMType (org.w3._2007.rif.ArgsUNITERMType)1 Assert (org.w3._2007.rif.Assert)1 Target (org.w3._2007.rif.Assert.Target)1 Atom (org.w3._2007.rif.Atom)1 ContentFORMULAType (org.w3._2007.rif.ContentFORMULAType)1 Equal (org.w3._2007.rif.Equal)1 ExternalFORMULAType (org.w3._2007.rif.ExternalFORMULAType)1 Formula (org.w3._2007.rif.Formula)1 Left (org.w3._2007.rif.Left)1 Op (org.w3._2007.rif.Op)1 Right (org.w3._2007.rif.Right)1