@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { Matcher matcher = PATTERN.matcher(value); OWLDataFactory df = getDataFactory(); String annotationValue; Set<OWLAnnotation> xrefAnnotations = Collections.emptySet(); if (matcher.matches()) { annotationValue = matcher.group(QUOTED_STRING_CONTENT_GROUP); xrefAnnotations = getXRefAnnotations(matcher); } else { annotationValue = getUnquotedString(value); } IRI propertyIRI = getTagIRI(getTagName()); OWLAnnotationProperty property = df.getOWLAnnotationProperty(propertyIRI); OWLEntity currentEntity = getConsumer().getCurrentEntity(); OWLLiteral literal = df.getOWLLiteral(annotationValue); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(property, currentEntity.getIRI(), literal, xrefAnnotations); applyChange(new AddAxiom(getOntology(), ax)); }
private Set<OWLAnnotation> getXRefAnnotations(Matcher matcher) { Set<OWLAnnotation> annotations = new HashSet<>(); String xrefs = matcher.group(XREF_GROUP); if (xrefs != null) { for (String xrefValue : xrefs.split(",")) { annotations.add(getConsumer().parseXRef(xrefValue)); } } return annotations; } }
private void setupTagHandlers() { addTagHandler(new OntologyTagValueHandler(this)); addTagHandler(new IDTagValueHandler(this)); addTagHandler(new NameTagValueHandler(this)); addTagHandler(new IsATagValueHandler(this)); addTagHandler(new PartOfTagValueHandler(this)); addTagHandler(new TransitiveTagValueHandler(this)); addTagHandler(new SymmetricTagValueHandler(this)); addTagHandler(new RelationshipTagValueHandler(this)); addTagHandler(new UnionOfHandler(this)); addTagHandler(new IntersectionOfHandler(this)); addTagHandler(new DisjointFromHandler(this)); addTagHandler(new AsymmetricHandler(this)); addTagHandler(new InverseHandler(this)); addTagHandler(new ReflexiveHandler(this)); addTagHandler(new TransitiveOverHandler(this)); addTagHandler(new DefaultNamespaceTagValueHandler(this)); addTagHandler(new SynonymTagValueHandler(this)); addTagHandler(new XRefTagHandler(this)); addTagHandler(new DefTagValueHandler(this)); addTagHandler(new IsObsoleteTagValueHandler(this)); addTagHandler(new IDSpaceTagValueHandler(this)); addTagHandler(new DataVersionTagValueHandler(this)); addTagHandler(new SynonymTypeDefTagHandler(this)); addTagHandler(new AltIdTagValueHandler(this)); }
private Set<OWLAnnotation> getXRefAnnotations(Matcher matcher) { Set<OWLAnnotation> annotations = new HashSet<>(); String xrefs = matcher.group(XREF_GROUP); if (xrefs != null) { for (String xrefValue : xrefs.split(",")) { annotations.add(getConsumer().parseXRef(xrefValue)); } } return annotations; } }
private void setupTagHandlers() { addTagHandler(new OntologyTagValueHandler(this)); addTagHandler(new IDTagValueHandler(this)); addTagHandler(new NameTagValueHandler(this)); addTagHandler(new IsATagValueHandler(this)); addTagHandler(new PartOfTagValueHandler(this)); addTagHandler(new TransitiveTagValueHandler(this)); addTagHandler(new SymmetricTagValueHandler(this)); addTagHandler(new RelationshipTagValueHandler(this)); addTagHandler(new UnionOfHandler(this)); addTagHandler(new IntersectionOfHandler(this)); addTagHandler(new DisjointFromHandler(this)); addTagHandler(new AsymmetricHandler(this)); addTagHandler(new InverseHandler(this)); addTagHandler(new ReflexiveHandler(this)); addTagHandler(new TransitiveOverHandler(this)); addTagHandler(new DefaultNamespaceTagValueHandler(this)); addTagHandler(new SynonymTagValueHandler(this)); addTagHandler(new XRefTagHandler(this)); addTagHandler(new DefTagValueHandler(this)); addTagHandler(new IsObsoleteTagValueHandler(this)); addTagHandler(new IDSpaceTagValueHandler(this)); addTagHandler(new DataVersionTagValueHandler(this)); addTagHandler(new SynonymTypeDefTagHandler(this)); addTagHandler(new AltIdTagValueHandler(this)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { Matcher matcher = PATTERN.matcher(value); OWLDataFactory df = getDataFactory(); String annotationValue; Set<OWLAnnotation> xrefAnnotations = Collections.emptySet(); if (matcher.matches()) { annotationValue = matcher.group(QUOTED_STRING_CONTENT_GROUP); xrefAnnotations = getXRefAnnotations(matcher); } else { annotationValue = getUnquotedString(value); } IRI propertyIRI = getTagIRI(getTagName()); OWLAnnotationProperty property = df.getOWLAnnotationProperty(propertyIRI); OWLEntity currentEntity = getConsumer().getCurrentEntity(); OWLLiteral literal = df.getOWLLiteral(annotationValue); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(property, currentEntity.getIRI(), literal, xrefAnnotations); applyChange(new AddAxiom(getOntology(), ax)); }
private Set<OWLAnnotation> getXRefAnnotations(Matcher matcher) { Set<OWLAnnotation> annotations = new HashSet<>(); String xrefs = matcher.group(XREF_GROUP); if (xrefs != null) { for (String xrefValue : xrefs.split(",")) { annotations.add(getConsumer().parseXRef(xrefValue)); } } return annotations; } }
private void setupTagHandlers() { addTagHandler(new OntologyTagValueHandler(this)); addTagHandler(new IDTagValueHandler(this)); addTagHandler(new NameTagValueHandler(this)); addTagHandler(new IsATagValueHandler(this)); addTagHandler(new PartOfTagValueHandler(this)); addTagHandler(new TransitiveTagValueHandler(this)); addTagHandler(new SymmetricTagValueHandler(this)); addTagHandler(new RelationshipTagValueHandler(this)); addTagHandler(new UnionOfHandler(this)); addTagHandler(new IntersectionOfHandler(this)); addTagHandler(new DisjointFromHandler(this)); addTagHandler(new AsymmetricHandler(this)); addTagHandler(new InverseHandler(this)); addTagHandler(new ReflexiveHandler(this)); addTagHandler(new TransitiveOverHandler(this)); addTagHandler(new DefaultNamespaceTagValueHandler(this)); addTagHandler(new SynonymTagValueHandler(this)); addTagHandler(new XRefTagHandler(this)); addTagHandler(new DefTagValueHandler(this)); addTagHandler(new IsObsoleteTagValueHandler(this)); addTagHandler(new IDSpaceTagValueHandler(this)); addTagHandler(new DataVersionTagValueHandler(this)); addTagHandler(new SynonymTypeDefTagHandler(this)); addTagHandler(new AltIdTagValueHandler(this)); }
@Override public void handle(String currentId, String value, String qualifierBlock, String comment) { Matcher matcher = PATTERN.matcher(value); OWLDataFactory df = getDataFactory(); String annotationValue; Set<OWLAnnotation> xrefAnnotations = Collections.emptySet(); if (matcher.matches()) { annotationValue = matcher.group(QUOTED_STRING_CONTENT_GROUP); xrefAnnotations = getXRefAnnotations(matcher); } else { annotationValue = getUnquotedString(value); } IRI propertyIRI = getTagIRI(getTagName()); OWLAnnotationProperty property = df.getOWLAnnotationProperty(propertyIRI); OWLEntity currentEntity = getConsumer().getCurrentEntity(); OWLLiteral literal = df.getOWLLiteral(annotationValue); OWLAnnotationAssertionAxiom ax = df .getOWLAnnotationAssertionAxiom(property, currentEntity.getIRI(), literal, xrefAnnotations); applyChange(new AddAxiom(getOntology(), ax)); }