Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.SWRLRule


                df.getOWLDatatype(XSDVocabulary.STRING.getIRI()), y));
        Set<SWRLAtom> head = new TreeSet<>();
        head.add(df.getSWRLClassAtom(a, x));
        OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(),
                df.getOWLLiteral("test", ""));
        SWRLRule rule = df.getSWRLRule(body, head, singleton(ann));
        ontology.getOWLOntologyManager().addAxiom(ontology, rule);
        OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                df.getOWLDatatype(IRI.create("urn:mydatatype")),
                df.getOWLDatatypeMaxExclusiveRestriction(200D),
                singleton(df.getOWLAnnotation(df.getRDFSLabel(),
View Full Code Here


        if (!tok.equals("-")) {
            throw createException("-", ",");
        }
        consumeToken(">");
        List<SWRLAtom> head = parseRuleAtoms();
        SWRLRule rule = dataFactory.getSWRLRule(new LinkedHashSet<SWRLAtom>(body), new LinkedHashSet<SWRLAtom>(head));
        Set<OntologyAxiomPair> pairs = new HashSet<OntologyAxiomPair>();
        for (OWLOntology ont : ontologies) {
            pairs.add(new OntologyAxiomPair(ont, rule));
        }
        return pairs;
View Full Code Here

        Set<SWRLAtom> antecedent = Collections.emptySet();
        IRI ruleBodyIRI = consumer.getResourceObject(mainNode, SWRLVocabulary.BODY.getIRI(), true);
        if (ruleBodyIRI != null) {
            antecedent = listTranslator.translateToSet(ruleBodyIRI);
        }
        SWRLRule rule = null;
        if (!consumer.isAnonymousNode(mainNode)) {
            rule = consumer.getDataFactory().getSWRLRule(antecedent, consequent);
        }
        else {
            rule = consumer.getDataFactory().getSWRLRule(antecedent, consequent);
View Full Code Here

    @Override
  public boolean equals(Object obj) {
        if (!(obj instanceof SWRLRule)) {
            return false;
        }
        SWRLRule other = (SWRLRule) obj;
        return other.getBody().equals(body) && other.getHead().equals(head);
    }
View Full Code Here

    }


    @Override
  protected int compareObjectOfSameType(OWLObject object) {
        SWRLRule other = (SWRLRule) object;

        int diff = compareSets(getBody(), other.getBody());
        if (diff == 0) {
            diff = compareSets(getHead(), other.getHead());
        }
        return diff;

    }
View Full Code Here

                  }
                  log.debug("Recipe is: {}", recipe);
                  RuleList ruleList = recipe.getkReSRuleList();
                  log.debug("RuleList is: {}",ruleList);
                  for(org.apache.stanbol.rules.base.api.Rule r : ruleList ){
                      SWRLRule swrl = r.toSWRL(OWLManager.getOWLDataFactory());
                      log.debug("Prepared rule: {}",swrl);
                      rules.add(swrl);
                  }
              } catch (NoSuchRecipeException e) {
                  log.error("Recipe {} does not exists", recipeId);
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.SWRLRule

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.