Package com.clarkparsia.pellet.rules

Examples of com.clarkparsia.pellet.rules.DatavaluePropertyBindingHelper


  @Test
  public void testDataRangeBindingHelper() {
    DatavaluedPropertyAtom pattern = new DatavaluedPropertyAtom(dp2, x, z);
    DataRangeAtom atom = new DataRangeAtom(ATermUtils.makeTermAppl(Namespaces.XSD + "integer"), z);

    BindingHelper patternHelper = new DatavaluePropertyBindingHelper(kb.getABox(), pattern);
    BindingHelper rangeHelper = new DataRangeBindingHelper(kb.getABox(), atom);
    BindingGenerator gen = new BindingGeneratorImpl(kb.getABox(), new VariableBinding(kb.getABox()), Arrays
                    .asList(new BindingHelper[] { patternHelper, rangeHelper, }));

    VariableBinding expectedBinding = new VariableBinding(kb.getABox());
View Full Code Here


  @Test
  public void testDatavalueBindingGeneratorChained() {
    DatavaluedPropertyAtom pattern1 = new DatavaluedPropertyAtom(dp2, x, z);
    DatavaluedPropertyAtom pattern2 = new DatavaluedPropertyAtom(dp2, y, z);

    BindingHelper genHelper1 = new DatavaluePropertyBindingHelper(kb.getABox(), pattern1);
    BindingHelper genHelper2 = new DatavaluePropertyBindingHelper(kb.getABox(), pattern2);
    BindingGenerator gen = new BindingGeneratorImpl(kb.getABox(), new VariableBinding(kb.getABox()), Arrays
                    .asList(new BindingHelper[] { genHelper1, genHelper2 }));

    List<VariableBinding> expected = new LinkedList<VariableBinding>();
    VariableBinding binding;
View Full Code Here

  @Test
  public void testDatavalueBindingGeneratorChainedSubject() {
    DatavaluedPropertyAtom pattern1 = new DatavaluedPropertyAtom(dp2, x, new AtomDConstant(data2));
    DatavaluedPropertyAtom pattern2 = new DatavaluedPropertyAtom(dp2, y, new AtomDConstant(data2));

    BindingHelper genHelper1 = new DatavaluePropertyBindingHelper(kb.getABox(), pattern1);
    BindingHelper genHelper2 = new DatavaluePropertyBindingHelper(kb.getABox(), pattern2);
    BindingGenerator gen = new BindingGeneratorImpl(kb.getABox(), new VariableBinding(kb.getABox()), Arrays
                    .asList(new BindingHelper[] { genHelper1, genHelper2 }));

    List<VariableBinding> expected = new LinkedList<VariableBinding>();
    VariableBinding binding;
View Full Code Here

  @Test
  public void testDatavalueBindingGeneratorObjects() {
    DatavaluedPropertyAtom pattern = new DatavaluedPropertyAtom(dp2, new AtomIConstant(mary), z);

    BindingHelper genHelper = new DatavaluePropertyBindingHelper(kb.getABox(), pattern);
    BindingGenerator gen = new BindingGeneratorImpl(kb.getABox(), new VariableBinding(kb.getABox()), Collections
                    .singletonList(genHelper));
    assertIteratorValues(new BindingToMapIterator(gen.iterator()), new Object[] {
                    Collections.singletonMap(z, data1), Collections.singletonMap(z, data2), });
View Full Code Here

  @Test
  public void testDatavalueBindingGeneratorSubjects() {
    DatavaluedPropertyAtom pattern = new DatavaluedPropertyAtom(dp2, x, new AtomDConstant(data2));

    BindingHelper genHelper = new DatavaluePropertyBindingHelper(kb.getABox(), pattern);
    BindingGenerator gen = new BindingGeneratorImpl(kb.getABox(), new VariableBinding(kb.getABox()), Collections
                    .singletonList(genHelper));

    assertIteratorValues(new BindingToMapIterator(gen.iterator()), new Object[] {
                    Collections.singletonMap(x, mary), Collections.singletonMap(x, robert), });
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.rules.DatavaluePropertyBindingHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.