Package org.mindswap.pellet

Examples of org.mindswap.pellet.Individual


  public AlphaFixedSubjectEdgeNode(ABox abox, Role role, ATermAppl subjectName) {
      super(abox, role, subjectName);
    }
 
  public boolean activate(Edge edge) {
    Individual subject = initNode();
    EdgeDirection dir = edgeMatches(edge);
    if (dir != null && (dir == EdgeDirection.FORWARD ? edge.getFrom() : edge.getTo()).isSame(subject)) {
      activate(WME.createEdge(edge, dir));
      return true;
    }
View Full Code Here


  public Iterator<WME> getMatches(int argIndex, Node arg) {
    if (argIndex != 1) {
      throw new UnsupportedOperationException()
    }
   
    Individual subject = initNode();
    return getMatches(subject, role, arg);
  }
View Full Code Here

    Individual subject = initNode();
    return getMatches(subject, role, arg);
  }

  public Iterator<WME> getMatches() {
    Individual subject = initNode();
    return toWMEs(subject.getOutEdges().getEdges(role), EdgeDirection.FORWARD);
  }
View Full Code Here

  }
 
  public boolean activate(Individual ind, ATermAppl type, DependencySet ds) {
    assert predicate.equals(type);
    if (name != null) {
      Individual node = initNode();
      if (!ind.isSame(node)) {
        return false;
      }
    }
   
View Full Code Here

      result = createNodeProvider(variable, processed, lastWME);
    }

    public void visit(AtomIConstant constant) {
      abox.copyOnWrite();
      Individual individual = abox.getIndividual(constant.getValue());
//      if (individual.isMerged()) {
//        dependency = individual.getMergeDependency(true);
//        individual = individual.getSame();
//      }
View Full Code Here

    ATermAppl[] names = new ATermAppl[] { mary, robert, victor };
    ATermAppl[] values = new ATermAppl[] { data1, data2, data3, data4 };
    for (ATermAppl xName : names) {
      for (ATermAppl yName : names) {
        for (ATermAppl zValue : values) {
          Individual xNode = kb.getABox().getIndividual(xName);
          Individual yNode = kb.getABox().getIndividual(yName);
          Literal zNode = kb.getABox().addLiteral(zValue);

          if (kb.hasPropertyValue(xName, dp2, zValue) && kb.hasPropertyValue(yName, dp2, zValue)) {
            binding = new VariableBinding(kb.getABox());
            binding.set(x, xNode);
View Full Code Here

    List<VariableBinding> expected = new LinkedList<VariableBinding>();
    VariableBinding binding;
    ATermAppl[] names = new ATermAppl[] { mary, robert };
    for (ATermAppl xName : names) {
      for (ATermAppl yName : names) {
        Individual xNode = kb.getABox().getIndividual(xName);
        Individual yNode = kb.getABox().getIndividual(yName);

        binding = new VariableBinding(kb.getABox());
        binding.set(x, xNode);
        binding.set(y, yNode);
        expected.add(binding);
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.Individual

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.