@Override public String getShortForm(OWLEntity entity) { Stream<OWLOntology> onts = ontologySetProvider.ontologies(); List<OWLAnnotationAssertionAxiom> flatMap = asList( onts.flatMap(o -> o.annotationAssertionAxioms(entity.getIRI(), INCLUDED).sorted())); for (OWLAnnotationProperty prop : annotationProperties) { // visit the properties in order of preference AnnotationLanguageFilter checker = new AnnotationLanguageFilter(prop, preferredLanguageMap.get(prop)); flatMap.forEach(ax -> ax.accept(checker)); OWLObject match = checker.getMatch(); if (match != null) { return getRendering(match); } } return alternateShortFormProvider.getShortForm(entity); }
@Override public String getShortForm(OWLEntity entity) { Stream<OWLOntology> onts = ontologySetProvider.ontologies(); List<OWLAnnotationAssertionAxiom> flatMap = asList( onts.flatMap(o -> o.annotationAssertionAxioms(entity.getIRI(), INCLUDED).sorted())); for (OWLAnnotationProperty prop : annotationProperties) { // visit the properties in order of preference AnnotationLanguageFilter checker = new AnnotationLanguageFilter(prop, preferredLanguageMap.get(prop)); flatMap.forEach(ax -> ax.accept(checker)); OWLObject match = checker.getMatch(); if (match != null) { return getRendering(match); } } return alternateShortFormProvider.getShortForm(entity); }
@Override public String getShortForm(OWLEntity entity) { Stream<OWLOntology> onts = ontologySetProvider.ontologies(); List<OWLAnnotationAssertionAxiom> flatMap = asList( onts.flatMap(o -> o.annotationAssertionAxioms(entity.getIRI(), INCLUDED).sorted())); for (OWLAnnotationProperty prop : annotationProperties) { // visit the properties in order of preference AnnotationLanguageFilter checker = new AnnotationLanguageFilter(prop, preferredLanguageMap.get(prop)); flatMap.forEach(ax -> ax.accept(checker)); OWLObject match = checker.getMatch(); if (match != null) { return getRendering(match); } } return alternateShortFormProvider.getShortForm(entity); }
public String getShortForm(OWLEntity entity) { for (OWLAnnotationProperty prop : annotationProperties) { // visit the properties in order of preference AnnotationLanguageFilter checker = new AnnotationLanguageFilter(prop, preferredLanguageMap.get(prop)); for (OWLOntology ontology : ontologySetProvider.getOntologies()) { for (OWLAnnotationAssertionAxiom ax : entity.getAnnotationAssertionAxioms(ontology)) { ax.accept(checker); } } if (checker.getMatch() != null) { return getRendering(checker.getMatch()); } } return alternateShortFormProvider.getShortForm(entity); }