/** * Gets an annotation * * @param property the annotation property * @param value The annotation value * @return The annotation on the specified property with the specified value */ public OWLAnnotation getOWLAnnotation(OWLAnnotationProperty property, OWLAnnotationValue value) { return getOWLAnnotation(property, value, EMPTY_ANNOTATIONS_SET); }
/** * 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); }
@Override public OWLAnnotation getOWLAnnotation(OWLAnnotationProperty property, OWLAnnotationValue value) { return getOWLAnnotation(property, value, EMPTY_ANNOTATIONS_SET); }
/** * @deprecated Use either * {@link #getSWRLRule(java.util.Set, java.util.Set, java.util.Set)} * or {@link #getSWRLRule(java.util.Set, java.util.Set)} * instead. */ @Override @Deprecated public SWRLRule getSWRLRule(NodeID nodeID, Set<? extends SWRLAtom> body, Set<? extends SWRLAtom> head) { checkNull(head, "head"); checkNull(body, "body"); checkNull(nodeID, "nodeID"); Set<OWLAnnotation> annos = new HashSet<OWLAnnotation>(2); annos.add(getOWLAnnotation(getOWLAnnotationProperty(IRI.create("http://www.semanticweb.org/owlapi#", "nodeID")), getOWLLiteral(nodeID.toString()))); return new SWRLRuleImpl(body, head, annos); }
@Nonnull @Override public OWLAnnotation getOWLAnnotation(OWLAnnotationProperty property, OWLAnnotationValue value) { return getOWLAnnotation(property, value, EMPTY_ANNOTATIONS_SET); }
/** * @deprecated Use either * {@link #getSWRLRule(java.util.Set, java.util.Set, java.util.Set)} * or {@link #getSWRLRule(java.util.Set, java.util.Set)} * instead. Gets a SWRL rule which is named with a URI */ @Override @Deprecated public SWRLRule getSWRLRule(IRI iri, Set<? extends SWRLAtom> body, Set<? extends SWRLAtom> head) { checkNull(iri, "iri"); checkNull(body, "body"); checkNull(head, "head"); Set<OWLAnnotation> annos = new HashSet<OWLAnnotation>(2); annos.add(getOWLAnnotation(getOWLAnnotationProperty(IRI.create("http://www.semanticweb.org/owlapi#", "iri")), getOWLLiteral(iri.toQuotedString()))); return new SWRLRuleImpl(body, head, annos); }
protected Set<OWLAnnotation> makeSingletonDisjoinClassWarningAnnotation( Collection<OWLAnnotation> annotations, OWLClassExpression classExpression, OWLClassExpression addedClass) { Set<OWLAnnotation> modifiedAnnotations = new HashSet<>(annotations.size() + 1); modifiedAnnotations.addAll(annotations); String provenanceComment = String.format("%s on %s", VersionInfo.getVersionInfo().getGeneratedByMessage(), new SimpleDateFormat().format(new Date())); OWLAnnotation provenanceAnnotation = getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(provenanceComment)); Set<OWLAnnotation> metaAnnotations = Collections.singleton(provenanceAnnotation); String changeComment = String.format(DISJOINT_CLASSES_REPLACED, classExpression, classExpression, addedClass); modifiedAnnotations .add(getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(changeComment), metaAnnotations)); return modifiedAnnotations; }
protected Set<OWLAnnotation> makeSingletonDisjoinClassWarningAnnotation( Collection<OWLAnnotation> annotations, OWLClassExpression classExpression, OWLClassExpression addedClass) { Set<OWLAnnotation> modifiedAnnotations = new HashSet<>(annotations.size() + 1); modifiedAnnotations.addAll(annotations); String provenanceComment = String.format("%s on %s", VersionInfo.getVersionInfo().getGeneratedByMessage(), new SimpleDateFormat().format(new Date())); OWLAnnotation provenanceAnnotation = getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(provenanceComment)); Set<OWLAnnotation> metaAnnotations = Collections.singleton(provenanceAnnotation); String changeComment = String.format(DISJOINT_CLASSES_REPLACED, classExpression, classExpression, addedClass); modifiedAnnotations .add(getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(changeComment), metaAnnotations)); return modifiedAnnotations; }
protected Set<OWLAnnotation> makeSingletonDisjoinClassWarningAnnotation( Collection<OWLAnnotation> annotations, OWLClassExpression classExpression, OWLClassExpression addedClass) { Set<OWLAnnotation> modifiedAnnotations = new HashSet<>(annotations.size() + 1); modifiedAnnotations.addAll(annotations); String provenanceComment = String.format("%s on %s", VersionInfo.getVersionInfo().getGeneratedByMessage(), new SimpleDateFormat().format(new Date())); OWLAnnotation provenanceAnnotation = getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(provenanceComment)); Set<OWLAnnotation> metaAnnotations = Collections.singleton(provenanceAnnotation); String changeComment = String.format(DISJOINT_CLASSES_REPLACED, classExpression, classExpression, addedClass); modifiedAnnotations .add(getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(changeComment), metaAnnotations)); return modifiedAnnotations; }
protected Set<OWLAnnotation> makeSingletonDisjoinClassWarningAnnotation( Collection<OWLAnnotation> annotations, OWLClassExpression classExpression, OWLClassExpression addedClass) { Set<OWLAnnotation> modifiedAnnotations = new HashSet<>(annotations.size() + 1); modifiedAnnotations.addAll(annotations); String provenanceComment = String.format("%s on %s", VersionInfo.getVersionInfo().getGeneratedByMessage(), new SimpleDateFormat().format(new Date())); OWLAnnotation provenanceAnnotation = getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(provenanceComment)); Set<OWLAnnotation> metaAnnotations = Collections.singleton(provenanceAnnotation); String changeComment = String.format(DISJOINT_CLASSES_REPLACED, classExpression, classExpression, addedClass); modifiedAnnotations .add(getOWLAnnotation(RDFS_COMMENT, getOWLLiteral(changeComment), metaAnnotations)); return modifiedAnnotations; }