Examples of ClassAtom


Examples of com.clarkparsia.pellet.rules.model.ClassAtom

    ATermAppl f = TermFactory.literal("f");

    AtomIVariable x = new AtomIVariable("x");
    AtomDVariable y = new AtomDVariable("y");

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new DatavaluedPropertyAtom(p, new AtomIConstant(b), y),
            new BuiltInAtom(SWRLB + "equal", y, new AtomDConstant(TermFactory.literal(true))));
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(t)));
    kb.addRule(new Rule(head, body));

    body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new DatavaluedPropertyAtom(p, new AtomIConstant(b), y),
            new BuiltInAtom(SWRLB + "equal", y, new AtomDConstant(TermFactory.literal(false))));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.ClassAtom

    ATermAppl f = TermFactory.literal("f");

    AtomIVariable x = new AtomIVariable("x");
    AtomIVariable y = new AtomIVariable("y");

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new IndividualPropertyAtom(r, y, new AtomIConstant(b)),
            new DatavaluedPropertyAtom(p, y, new AtomDConstant(TermFactory.literal(true))));
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(t)));
    kb.addRule(new Rule(head, body));

    body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new IndividualPropertyAtom(r, y, new AtomIConstant(b)),
            new DatavaluedPropertyAtom(p, y, new AtomDConstant(TermFactory.literal(false))));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));
View Full Code Here

Examples of com.clarkparsia.pellet.rules.model.ClassAtom

    List<RuleAtom> body = Arrays.<RuleAtom> asList(
            new DatavaluedPropertyAtom(p, x, y),
            new BuiltInAtom( SWRLB + "pow", z, y, new AtomDConstant(TermFactory.literal(2))),
            new BuiltInAtom( SWRLB + "lessThan", z, new AtomDConstant(TermFactory.literal(100)))
            );
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new ClassAtom(A, x));
    kb.addRule(new Rule(head, body));

    assertIteratorValues(kb.getInstances(A).iterator(), a, b);
  }
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

    String argument1 = "";
    String argument2 = "";

    for (Atom atom : outputModel.getAtoms()) {
      if (atom instanceof ClassAtom) {
        ClassAtom classAtom = (ClassAtom)atom;
       
        // creating a blank node
        r = model.createResource();
        if (classAtom.getClassPredicate().getPrefix() != null && classAtom.getClassPredicate().getNs() != null)
          model.setNsPrefix(classAtom.getClassPredicate().getPrefix(), classAtom.getClassPredicate().getNs());
        predicateUri = classAtom.getClassPredicate().getUri();
       
        // creating the class resource
        Resource classResource = model.getResource(predicateUri);
        if (classResource == null)
          classResource = model.createResource(predicateUri);

        argument1 = classAtom.getArgument1().getId();
        outputVariablesToResource.put(argument1, r);

        r.addProperty(rdf_type, classResource);
      }
    }
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

    }
   
    Label predicateName = new Label(predicateUri, predicateNs, predicatePrefix);
    Argument arg1 = new Argument(argument1Id, argument1Id, argument1Type);
   
    ClassAtom classAtom = new ClassAtom(predicateName, arg1);

    return classAtom;

  }
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

   
    Label featurePredicatName = new Label(geoOntology + "Feature", geoOntology, "geo");
    Label latPredicatName = new Label(geoOntology + "lat", geoOntology, "geo");
    Label lngPredicatName = new Label(geoOntology + "long", geoOntology, "geo");
   
    ClassAtom c1 = new ClassAtom(featurePredicatName, new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE));
    IndividualPropertyAtom p1 = new IndividualPropertyAtom(latPredicatName,
        new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE),
        new Argument("arg2", "arg2", ArgumentType.ATTRIBUTE));
    IndividualPropertyAtom p2 = new IndividualPropertyAtom(lngPredicatName,
        new Argument("arg1", "arg1", ArgumentType.ATTRIBUTE),
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

    resource.addProperty(has_model, my_model);

    if (semanticModel != null) {
      for (Atom atom : semanticModel.getAtoms()) {
        if (atom instanceof ClassAtom) {
          ClassAtom classAtom = (ClassAtom)atom;

          Resource r = model.createResource();
          r.addProperty(rdf_type, class_atom_resource);

          if (classAtom.getClassPredicate().getPrefix() != null && classAtom.getClassPredicate().getNs() != null)
            model.setNsPrefix(classAtom.getClassPredicate().getPrefix(), classAtom.getClassPredicate().getNs());
          Resource className = model.createResource(classAtom.getClassPredicate().getUri());
          r.addProperty(class_predicate, className);

          Resource arg1 = model.getResource(baseNS + classAtom.getArgument1().getAttOrVarId());
          r.addProperty(has_argument1, arg1);

          my_model.addProperty(has_atom, r);
        }
        else if (atom instanceof IndividualPropertyAtom) {
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

      if (vertexIdToArgument.get(n.getId()) == null)
        continue;
     
      Label classPredicate = new Label(n.getLabel().getUri(), n.getLabel().getNs(), n.getLabel().getPrefix());

      ClassAtom classAtom = new ClassAtom(classPredicate, vertexIdToArgument.get(n.getId()));
      m.getAtoms().add(classAtom);
    }
   
    for (LabeledLink e : steinerTree.getLabeledSteinerTree().edgeSet()) {
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

        continue;
     
     
      Label classPredicate = new Label(n.getLabel().getUri(), n.getLabel().getNs(), n.getLabel().getPrefix());

      ClassAtom classAtom = new ClassAtom(classPredicate, vertexIdToArgument.get(n.getId()));
      m.getAtoms().add(classAtom);
    }
   
    for (LabeledLink e : treeModel.edgeSet()) {
     
View Full Code Here

Examples of edu.isi.karma.rep.model.ClassAtom

      if (vertexIdToArgument.get(n.getId()) == null)
        continue;
     
      Label classPredicate = new Label(n.getLabel().getUri(), n.getLabel().getNs(), n.getLabel().getPrefix());

      ClassAtom classAtom = new ClassAtom(classPredicate, vertexIdToArgument.get(n.getId()));
      m.getAtoms().add(classAtom);
    }
   
    for (LabeledLink e : treeModel.edgeSet()) {
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.