/** * Gets a SWRL rule which is not named with a URI - i.e. that is anonymous. * * @param nodeID * @param body * @param head */ public SWRLRule getSWRLRule(NodeID nodeID, Set<? extends SWRLAtom> body, Set<? extends SWRLAtom> head) { Set<OWLAnnotation> annos = new HashSet<OWLAnnotation>(2); annos.add(getOWLAnnotation(getOWLAnnotationProperty(IRI.create("http://www.semanticweb.org/owlapi#nodeID")), getOWLStringLiteral(nodeID.toString()))); return new SWRLRuleImpl(this, body, head, annos); }
/** * Gets a SWRL rule which is named with a URI * * @param iri * @param body * @param head */ public SWRLRule getSWRLRule(IRI iri, Set<? extends SWRLAtom> body, Set<? extends SWRLAtom> head) { Set<OWLAnnotation> annos = new HashSet<OWLAnnotation>(2); annos.add(getOWLAnnotation(getOWLAnnotationProperty(IRI.create("http://www.semanticweb.org/owlapi#iri")), getOWLStringLiteral(iri.toQuotedString()))); return new SWRLRuleImpl(this, body, head, annos); }